From fe70fae95f29fd10140fb745b6e626b41c49fbf9 Mon Sep 17 00:00:00 2001 From: abs3nt Date: Sun, 7 Jul 2024 18:49:38 -0700 Subject: [PATCH] more --- .yarnrc.yml | 1 + _site/README/index.html | 1 - _site/index.html | 2 - eleventy.config.js | 8 + index.html | 2 - node_modules/.bin/acorn | 1 + node_modules/.bin/cssesc | 1 + node_modules/.bin/dev-ip | 1 + node_modules/.bin/ejs | 1 + node_modules/.bin/eleventy | 1 + node_modules/.bin/eleventy-dev-server | 1 + node_modules/.bin/errno | 1 + node_modules/.bin/esparse | 1 + node_modules/.bin/esvalidate | 1 + node_modules/.bin/handlebars | 1 + node_modules/.bin/jake | 1 + node_modules/.bin/jiti | 1 + node_modules/.bin/js-yaml | 1 + node_modules/.bin/liquid | 1 + node_modules/.bin/liquidjs | 1 + node_modules/.bin/markdown-it | 1 + node_modules/.bin/mime | 1 + node_modules/.bin/mkdirp | 1 + node_modules/.bin/mustache | 1 + node_modules/.bin/nanoid | 1 + node_modules/.bin/node-which | 1 + node_modules/.bin/nunjucks-precompile | 1 + node_modules/.bin/parser | 1 + node_modules/.bin/resolve | 1 + node_modules/.bin/rimraf | 1 + node_modules/.bin/semver | 1 + node_modules/.bin/sucrase | 1 + node_modules/.bin/sucrase-node | 1 + node_modules/.bin/tailwind | 1 + node_modules/.bin/tailwindcss | 1 + node_modules/.bin/uglifyjs | 1 + node_modules/.bin/yaml | 1 + node_modules/.yarn-state.yml | 1169 + node_modules/@11ty/dependency-tree/LICENSE | 21 + node_modules/@11ty/dependency-tree/README.md | 92 + node_modules/@11ty/dependency-tree/main.js | 120 + .../@11ty/dependency-tree/package.json | 30 + .../@11ty/dependency-tree/test/mainTest.js | 92 + .../test/stubs/circular/circle-a.js | 1 + .../test/stubs/circular/circle-b.js | 1 + .../test/stubs/circular/circle-c.js | 1 + .../test/stubs/circular2/circle-a.js | 1 + .../test/stubs/circular2/circle-b.js | 1 + .../test/stubs/circular2/circle-c.js | 1 + .../test/stubs/dotdot/dotdot.js | 1 + .../test/stubs/parent/child1.js | 4 + .../test/stubs/parent/child2.js | 3 + .../test/stubs/parent/grandchild.js | 2 + .../test/stubs/parent/greatgrandchild.js | 0 .../test/stubs/parent/parent.js | 5 + .../dependency-tree/test/stubs/simple.js | 1 + .../dependency-tree/test/stubs/simple2.js | 0 .../test/stubs/uses_node_modules.js | 4 + .../@11ty/eleventy-dev-server/README.md | 56 + node_modules/@11ty/eleventy-dev-server/cli.js | 92 + .../client/reload-client.js | 259 + node_modules/@11ty/eleventy-dev-server/cmd.js | 69 + .../@11ty/eleventy-dev-server/package.json | 56 + .../@11ty/eleventy-dev-server/server.js | 807 + .../server/wrapResponse.js | 129 + node_modules/@11ty/eleventy-utils/LICENSE | 21 + node_modules/@11ty/eleventy-utils/README.md | 29 + node_modules/@11ty/eleventy-utils/index.js | 11 + .../@11ty/eleventy-utils/package.json | 47 + .../@11ty/eleventy-utils/src/IsPlainObject.js | 24 + .../@11ty/eleventy-utils/src/Merge.js | 84 + .../@11ty/eleventy-utils/src/TemplatePath.js | 368 + .../@11ty/eleventy/CODE_OF_CONDUCT.md | 48 + node_modules/@11ty/eleventy/LICENSE | 21 + node_modules/@11ty/eleventy/README.md | 49 + node_modules/@11ty/eleventy/SECURITY.md | 5 + node_modules/@11ty/eleventy/cmd.js | 132 + node_modules/@11ty/eleventy/package.json | 137 + node_modules/@11ty/eleventy/src/Benchmark.js | 52 + .../@11ty/eleventy/src/BenchmarkGroup.js | 124 + .../@11ty/eleventy/src/BenchmarkManager.js | 72 + .../@11ty/eleventy/src/ComputedData.js | 116 + .../@11ty/eleventy/src/ComputedDataProxy.js | 129 + .../@11ty/eleventy/src/ComputedDataQueue.js | 64 + .../src/ComputedDataTemplateString.js | 68 + node_modules/@11ty/eleventy/src/Eleventy.js | 1245 + .../@11ty/eleventy/src/EleventyBaseError.js | 23 + .../eleventy/src/EleventyCommandCheckError.js | 3 + .../eleventy/src/EleventyErrorHandler.js | 121 + .../@11ty/eleventy/src/EleventyErrorUtil.js | 80 + .../eleventy/src/EleventyExtensionMap.js | 268 + .../@11ty/eleventy/src/EleventyFiles.js | 463 + .../@11ty/eleventy/src/EleventyServe.js | 259 + .../eleventy/src/EleventyShortcodeError.js | 5 + .../@11ty/eleventy/src/EleventyWatch.js | 128 + .../eleventy/src/EleventyWatchTargets.js | 155 + .../@11ty/eleventy/src/Engines/Custom.js | 299 + .../@11ty/eleventy/src/Engines/Ejs.js | 55 + .../@11ty/eleventy/src/Engines/Haml.js | 21 + .../@11ty/eleventy/src/Engines/Handlebars.js | 73 + .../@11ty/eleventy/src/Engines/Html.js | 32 + .../@11ty/eleventy/src/Engines/JavaScript.js | 163 + .../@11ty/eleventy/src/Engines/Liquid.js | 273 + .../@11ty/eleventy/src/Engines/Markdown.js | 97 + .../@11ty/eleventy/src/Engines/Mustache.js | 25 + .../@11ty/eleventy/src/Engines/Nunjucks.js | 423 + .../@11ty/eleventy/src/Engines/Pug.js | 42 + .../eleventy/src/Engines/TemplateEngine.js | 275 + .../TemplateContentPrematureUseError.js | 5 + .../TemplateContentUnrenderedTemplateError.js | 5 + ...ngCircularTemplateContentReferenceError.js | 5 + node_modules/@11ty/eleventy/src/EventBus.js | 17 + .../@11ty/eleventy/src/FileSystemSearch.js | 102 + .../eleventy/src/Filters/GetCollectionItem.js | 20 + .../src/Filters/GetCollectionItemIndex.js | 17 + .../src/Filters/GetLocaleCollectionItem.js | 62 + .../eleventy/src/Filters/ServerlessUrl.js | 42 + .../@11ty/eleventy/src/Filters/Slug.js | 14 + .../@11ty/eleventy/src/Filters/Slugify.js | 14 + .../@11ty/eleventy/src/Filters/Url.js | 43 + .../@11ty/eleventy/src/GlobalDependencyMap.js | 308 + .../src/Plugins/DefaultEdgeFunctionContent.js | 28 + .../DefaultServerlessFunctionContent.js | 57 + .../src/Plugins/Edge/EdgeTemplateDataID.js | 39 + .../eleventy/src/Plugins/Edge/LiquidEdge.js | 53 + .../eleventy/src/Plugins/Edge/NunjucksEdge.js | 105 + .../src/Plugins/Edge/PrecompiledNunjucks.js | 58 + .../@11ty/eleventy/src/Plugins/EdgePlugin.js | 222 + .../eleventy/src/Plugins/HtmlBasePlugin.js | 160 + .../@11ty/eleventy/src/Plugins/I18nPlugin.js | 348 + .../@11ty/eleventy/src/Plugins/Pagination.js | 474 + .../eleventy/src/Plugins/RenderPlugin.d.ts | 26 + .../eleventy/src/Plugins/RenderPlugin.js | 403 + .../Plugins/Serverless/NetlifyRedirects.js | 118 + .../src/Plugins/ServerlessBundlerPlugin.js | 418 + node_modules/@11ty/eleventy/src/Serverless.js | 252 + node_modules/@11ty/eleventy/src/Template.js | 1011 + .../@11ty/eleventy/src/TemplateBehavior.js | 67 + .../@11ty/eleventy/src/TemplateCache.js | 99 + .../@11ty/eleventy/src/TemplateCollection.js | 85 + .../@11ty/eleventy/src/TemplateConfig.js | 424 + .../@11ty/eleventy/src/TemplateContent.js | 618 + .../@11ty/eleventy/src/TemplateData.js | 671 + .../src/TemplateDataInitialGlobalData.js | 42 + .../eleventy/src/TemplateEngineManager.js | 147 + .../@11ty/eleventy/src/TemplateFileSlug.js | 56 + .../@11ty/eleventy/src/TemplateGlob.js | 37 + .../@11ty/eleventy/src/TemplateLayout.js | 253 + .../src/TemplateLayoutPathResolver.js | 137 + .../@11ty/eleventy/src/TemplateMap.js | 816 + .../@11ty/eleventy/src/TemplatePassthrough.js | 261 + .../src/TemplatePassthroughManager.js | 299 + .../@11ty/eleventy/src/TemplatePermalink.js | 254 + .../@11ty/eleventy/src/TemplateRender.js | 283 + .../@11ty/eleventy/src/TemplateWriter.js | 472 + node_modules/@11ty/eleventy/src/UserConfig.js | 942 + .../eleventy/src/Util/AsyncEventEmitter.js | 50 + .../@11ty/eleventy/src/Util/Compatibility.js | 53 + .../@11ty/eleventy/src/Util/ConsoleLogger.js | 99 + .../eleventy/src/Util/DateGitFirstAdded.js | 24 + .../eleventy/src/Util/DateGitLastUpdated.js | 28 + .../eleventy/src/Util/DeleteRequireCache.js | 24 + .../@11ty/eleventy/src/Util/DirContains.js | 9 + .../@11ty/eleventy/src/Util/EventBusUtil.js | 11 + .../eleventy/src/Util/GetJavaScriptData.js | 30 + .../src/Util/JavaScriptDependencies.js | 36 + node_modules/@11ty/eleventy/src/Util/Merge.js | 71 + .../src/Util/NormalizeServerlessUrl.js | 7 + .../src/Util/PassthroughCopyBehaviorCheck.js | 17 + .../@11ty/eleventy/src/Util/PathNormalizer.js | 12 + .../@11ty/eleventy/src/Util/PathPrefixer.js | 20 + .../@11ty/eleventy/src/Util/Pluralize.js | 3 + .../@11ty/eleventy/src/Util/ProxyWrap.js | 60 + .../@11ty/eleventy/src/Util/Require.js | 9 + .../@11ty/eleventy/src/Util/Sortable.js | 145 + .../@11ty/eleventy/src/Util/Unique.js | 3 + .../@11ty/eleventy/src/defaultConfig.js | 92 + node_modules/@11ty/eleventy/src/index.d.ts | 3 + node_modules/@11ty/lodash-custom/README.md | 14 + .../@11ty/lodash-custom/lodash.custom.js | 1704 + node_modules/@11ty/lodash-custom/package.json | 38 + node_modules/@alloc/quick-lru/index.d.ts | 128 + node_modules/@alloc/quick-lru/index.js | 263 + node_modules/@alloc/quick-lru/license | 9 + node_modules/@alloc/quick-lru/package.json | 43 + node_modules/@alloc/quick-lru/readme.md | 139 + .../@babel/helper-string-parser/LICENSE | 22 + .../@babel/helper-string-parser/README.md | 19 + .../@babel/helper-string-parser/lib/index.js | 295 + .../helper-string-parser/lib/index.js.map | 1 + .../@babel/helper-string-parser/package.json | 31 + .../helper-validator-identifier/LICENSE | 22 + .../helper-validator-identifier/README.md | 19 + .../lib/identifier.js | 70 + .../lib/identifier.js.map | 1 + .../helper-validator-identifier/lib/index.js | 57 + .../lib/index.js.map | 1 + .../lib/keyword.js | 35 + .../lib/keyword.js.map | 1 + .../helper-validator-identifier/package.json | 31 + .../scripts/generate-identifier-regex.js | 73 + node_modules/@babel/parser/CHANGELOG.md | 1073 + node_modules/@babel/parser/LICENSE | 19 + node_modules/@babel/parser/README.md | 19 + .../@babel/parser/bin/babel-parser.js | 15 + node_modules/@babel/parser/index.cjs | 5 + node_modules/@babel/parser/lib/index.js | 13989 +++ node_modules/@babel/parser/lib/index.js.map | 1 + node_modules/@babel/parser/package.json | 47 + .../@babel/parser/typings/babel-parser.d.ts | 251 + node_modules/@babel/types/LICENSE | 22 + node_modules/@babel/types/README.md | 19 + .../@babel/types/lib/asserts/assertNode.js | 16 + .../types/lib/asserts/assertNode.js.map | 1 + .../types/lib/asserts/generated/index.js | 1235 + .../types/lib/asserts/generated/index.js.map | 1 + .../types/lib/ast-types/generated/index.js | 3 + .../lib/ast-types/generated/index.js.map | 1 + .../lib/builders/flow/createFlowUnionType.js | 18 + .../builders/flow/createFlowUnionType.js.map | 1 + .../flow/createTypeAnnotationBasedOnTypeof.js | 31 + .../createTypeAnnotationBasedOnTypeof.js.map | 1 + .../types/lib/builders/generated/index.js | 1991 + .../types/lib/builders/generated/index.js.map | 1 + .../types/lib/builders/generated/uppercase.js | 1532 + .../lib/builders/generated/uppercase.js.map | 1 + .../@babel/types/lib/builders/productions.js | 12 + .../types/lib/builders/productions.js.map | 1 + .../types/lib/builders/react/buildChildren.js | 24 + .../lib/builders/react/buildChildren.js.map | 1 + .../builders/typescript/createTSUnionType.js | 22 + .../typescript/createTSUnionType.js.map | 1 + .../@babel/types/lib/builders/validateNode.js | 17 + .../types/lib/builders/validateNode.js.map | 1 + node_modules/@babel/types/lib/clone/clone.js | 12 + .../@babel/types/lib/clone/clone.js.map | 1 + .../@babel/types/lib/clone/cloneDeep.js | 12 + .../@babel/types/lib/clone/cloneDeep.js.map | 1 + .../types/lib/clone/cloneDeepWithoutLoc.js | 12 + .../lib/clone/cloneDeepWithoutLoc.js.map | 1 + .../@babel/types/lib/clone/cloneNode.js | 104 + .../@babel/types/lib/clone/cloneNode.js.map | 1 + .../@babel/types/lib/clone/cloneWithoutLoc.js | 12 + .../types/lib/clone/cloneWithoutLoc.js.map | 1 + .../@babel/types/lib/comments/addComment.js | 15 + .../types/lib/comments/addComment.js.map | 1 + .../@babel/types/lib/comments/addComments.js | 22 + .../types/lib/comments/addComments.js.map | 1 + .../lib/comments/inheritInnerComments.js | 12 + .../lib/comments/inheritInnerComments.js.map | 1 + .../lib/comments/inheritLeadingComments.js | 12 + .../comments/inheritLeadingComments.js.map | 1 + .../lib/comments/inheritTrailingComments.js | 12 + .../comments/inheritTrailingComments.js.map | 1 + .../types/lib/comments/inheritsComments.js | 17 + .../lib/comments/inheritsComments.js.map | 1 + .../types/lib/comments/removeComments.js | 15 + .../types/lib/comments/removeComments.js.map | 1 + .../types/lib/constants/generated/index.js | 59 + .../lib/constants/generated/index.js.map | 1 + .../@babel/types/lib/constants/index.js | 31 + .../@babel/types/lib/constants/index.js.map | 1 + .../types/lib/converters/ensureBlock.js | 14 + .../types/lib/converters/ensureBlock.js.map | 1 + .../converters/gatherSequenceExpressions.js | 66 + .../gatherSequenceExpressions.js.map | 1 + .../lib/converters/toBindingIdentifierName.js | 14 + .../converters/toBindingIdentifierName.js.map | 1 + .../@babel/types/lib/converters/toBlock.js | 29 + .../types/lib/converters/toBlock.js.map | 1 + .../types/lib/converters/toComputedKey.js | 14 + .../types/lib/converters/toComputedKey.js.map | 1 + .../types/lib/converters/toExpression.js | 27 + .../types/lib/converters/toExpression.js.map | 1 + .../types/lib/converters/toIdentifier.js | 25 + .../types/lib/converters/toIdentifier.js.map | 1 + .../@babel/types/lib/converters/toKeyAlias.js | 38 + .../types/lib/converters/toKeyAlias.js.map | 1 + .../lib/converters/toSequenceExpression.js | 20 + .../converters/toSequenceExpression.js.map | 1 + .../types/lib/converters/toStatement.js | 39 + .../types/lib/converters/toStatement.js.map | 1 + .../types/lib/converters/valueToNode.js | 76 + .../types/lib/converters/valueToNode.js.map | 1 + .../@babel/types/lib/definitions/core.js | 1689 + .../@babel/types/lib/definitions/core.js.map | 1 + .../lib/definitions/deprecated-aliases.js | 11 + .../lib/definitions/deprecated-aliases.js.map | 1 + .../types/lib/definitions/experimental.js | 134 + .../types/lib/definitions/experimental.js.map | 1 + .../@babel/types/lib/definitions/flow.js | 488 + .../@babel/types/lib/definitions/flow.js.map | 1 + .../@babel/types/lib/definitions/index.js | 96 + .../@babel/types/lib/definitions/index.js.map | 1 + .../@babel/types/lib/definitions/jsx.js | 158 + .../@babel/types/lib/definitions/jsx.js.map | 1 + .../@babel/types/lib/definitions/misc.js | 32 + .../@babel/types/lib/definitions/misc.js.map | 1 + .../types/lib/definitions/placeholders.js | 27 + .../types/lib/definitions/placeholders.js.map | 1 + .../types/lib/definitions/typescript.js | 493 + .../types/lib/definitions/typescript.js.map | 1 + .../@babel/types/lib/definitions/utils.js | 273 + .../@babel/types/lib/definitions/utils.js.map | 1 + .../@babel/types/lib/index-legacy.d.ts | 2758 + node_modules/@babel/types/lib/index.d.ts | 3269 + node_modules/@babel/types/lib/index.js | 576 + node_modules/@babel/types/lib/index.js.flow | 2612 + node_modules/@babel/types/lib/index.js.map | 1 + .../modifications/appendToMemberExpression.js | 15 + .../appendToMemberExpression.js.map | 1 + .../flow/removeTypeDuplicates.js | 65 + .../flow/removeTypeDuplicates.js.map | 1 + .../types/lib/modifications/inherits.js | 28 + .../types/lib/modifications/inherits.js.map | 1 + .../prependToMemberExpression.js | 17 + .../prependToMemberExpression.js.map | 1 + .../lib/modifications/removeProperties.js | 24 + .../lib/modifications/removeProperties.js.map | 1 + .../lib/modifications/removePropertiesDeep.js | 14 + .../modifications/removePropertiesDeep.js.map | 1 + .../typescript/removeTypeDuplicates.js | 65 + .../typescript/removeTypeDuplicates.js.map | 1 + .../lib/retrievers/getBindingIdentifiers.js | 96 + .../retrievers/getBindingIdentifiers.js.map | 1 + .../retrievers/getOuterBindingIdentifiers.js | 13 + .../getOuterBindingIdentifiers.js.map | 1 + .../@babel/types/lib/traverse/traverse.js | 50 + .../@babel/types/lib/traverse/traverse.js.map | 1 + .../@babel/types/lib/traverse/traverseFast.js | 26 + .../types/lib/traverse/traverseFast.js.map | 1 + .../types/lib/utils/deprecationWarning.js | 44 + .../types/lib/utils/deprecationWarning.js.map | 1 + .../@babel/types/lib/utils/inherit.js | 13 + .../@babel/types/lib/utils/inherit.js.map | 1 + .../react/cleanJSXElementLiteralChild.js | 40 + .../react/cleanJSXElementLiteralChild.js.map | 1 + .../@babel/types/lib/utils/shallowEqual.js | 17 + .../types/lib/utils/shallowEqual.js.map | 1 + .../validators/buildMatchMemberExpression.js | 13 + .../buildMatchMemberExpression.js.map | 1 + .../types/lib/validators/generated/index.js | 2752 + .../lib/validators/generated/index.js.map | 1 + .../@babel/types/lib/validators/is.js | 27 + .../@babel/types/lib/validators/is.js.map | 1 + .../@babel/types/lib/validators/isBinding.js | 27 + .../types/lib/validators/isBinding.js.map | 1 + .../types/lib/validators/isBlockScoped.js | 13 + .../types/lib/validators/isBlockScoped.js.map | 1 + .../types/lib/validators/isImmutable.js | 21 + .../types/lib/validators/isImmutable.js.map | 1 + .../@babel/types/lib/validators/isLet.js | 13 + .../@babel/types/lib/validators/isLet.js.map | 1 + .../@babel/types/lib/validators/isNode.js | 12 + .../@babel/types/lib/validators/isNode.js.map | 1 + .../types/lib/validators/isNodesEquivalent.js | 57 + .../lib/validators/isNodesEquivalent.js.map | 1 + .../types/lib/validators/isPlaceholderType.js | 19 + .../lib/validators/isPlaceholderType.js.map | 1 + .../types/lib/validators/isReferenced.js | 96 + .../types/lib/validators/isReferenced.js.map | 1 + .../@babel/types/lib/validators/isScope.js | 18 + .../types/lib/validators/isScope.js.map | 1 + .../lib/validators/isSpecifierDefault.js | 14 + .../lib/validators/isSpecifierDefault.js.map | 1 + .../@babel/types/lib/validators/isType.js | 22 + .../@babel/types/lib/validators/isType.js.map | 1 + .../lib/validators/isValidES3Identifier.js | 13 + .../validators/isValidES3Identifier.js.map | 1 + .../types/lib/validators/isValidIdentifier.js | 18 + .../lib/validators/isValidIdentifier.js.map | 1 + .../@babel/types/lib/validators/isVar.js | 15 + .../@babel/types/lib/validators/isVar.js.map | 1 + .../types/lib/validators/matchesPattern.js | 36 + .../lib/validators/matchesPattern.js.map | 1 + .../types/lib/validators/react/isCompatTag.js | 11 + .../lib/validators/react/isCompatTag.js.map | 1 + .../lib/validators/react/isReactComponent.js | 11 + .../validators/react/isReactComponent.js.map | 1 + .../@babel/types/lib/validators/validate.js | 30 + .../types/lib/validators/validate.js.map | 1 + node_modules/@babel/types/package.json | 40 + node_modules/@catppuccin/tailwindcss/LICENSE | 21 + .../@catppuccin/tailwindcss/README.md | 79 + .../@catppuccin/tailwindcss/dist/index.d.ts | 18 + .../@catppuccin/tailwindcss/dist/index.js | 920 + .../@catppuccin/tailwindcss/package.json | 61 + node_modules/@iarna/toml/CHANGELOG.md | 278 + node_modules/@iarna/toml/LICENSE | 14 + node_modules/@iarna/toml/README.md | 301 + node_modules/@iarna/toml/index.d.ts | 57 + node_modules/@iarna/toml/lib/create-date.js | 23 + .../@iarna/toml/lib/create-datetime-float.js | 24 + .../@iarna/toml/lib/create-datetime.js | 10 + node_modules/@iarna/toml/lib/create-time.js | 22 + node_modules/@iarna/toml/lib/format-num.js | 6 + node_modules/@iarna/toml/lib/parser-debug.js | 60 + node_modules/@iarna/toml/lib/parser.js | 127 + node_modules/@iarna/toml/lib/toml-parser.js | 1379 + node_modules/@iarna/toml/package.json | 82 + node_modules/@iarna/toml/parse-async.js | 30 + .../@iarna/toml/parse-pretty-error.js | 33 + node_modules/@iarna/toml/parse-stream.js | 80 + node_modules/@iarna/toml/parse-string.js | 18 + node_modules/@iarna/toml/parse.js | 5 + node_modules/@iarna/toml/stringify.js | 296 + node_modules/@iarna/toml/toml.js | 3 + node_modules/@isaacs/cliui/LICENSE.txt | 14 + node_modules/@isaacs/cliui/README.md | 143 + node_modules/@isaacs/cliui/build/index.cjs | 317 + node_modules/@isaacs/cliui/build/index.d.cts | 43 + node_modules/@isaacs/cliui/build/lib/index.js | 302 + node_modules/@isaacs/cliui/index.mjs | 14 + node_modules/@isaacs/cliui/package.json | 86 + node_modules/@jridgewell/gen-mapping/LICENSE | 19 + .../@jridgewell/gen-mapping/README.md | 227 + .../gen-mapping/dist/gen-mapping.mjs | 230 + .../gen-mapping/dist/gen-mapping.mjs.map | 1 + .../gen-mapping/dist/gen-mapping.umd.js | 246 + .../gen-mapping/dist/gen-mapping.umd.js.map | 1 + .../gen-mapping/dist/types/gen-mapping.d.ts | 88 + .../dist/types/sourcemap-segment.d.ts | 12 + .../gen-mapping/dist/types/types.d.ts | 36 + .../@jridgewell/gen-mapping/package.json | 76 + node_modules/@jridgewell/resolve-uri/LICENSE | 19 + .../@jridgewell/resolve-uri/README.md | 40 + .../resolve-uri/dist/resolve-uri.mjs | 232 + .../resolve-uri/dist/resolve-uri.mjs.map | 1 + .../resolve-uri/dist/resolve-uri.umd.js | 240 + .../resolve-uri/dist/resolve-uri.umd.js.map | 1 + .../resolve-uri/dist/types/resolve-uri.d.ts | 4 + .../@jridgewell/resolve-uri/package.json | 69 + node_modules/@jridgewell/set-array/LICENSE | 19 + node_modules/@jridgewell/set-array/README.md | 37 + .../@jridgewell/set-array/dist/set-array.mjs | 69 + .../set-array/dist/set-array.mjs.map | 1 + .../set-array/dist/set-array.umd.js | 83 + .../set-array/dist/set-array.umd.js.map | 1 + .../set-array/dist/types/set-array.d.ts | 32 + .../@jridgewell/set-array/package.json | 65 + .../@jridgewell/sourcemap-codec/LICENSE | 21 + .../@jridgewell/sourcemap-codec/README.md | 200 + .../sourcemap-codec/dist/sourcemap-codec.mjs | 164 + .../dist/sourcemap-codec.mjs.map | 1 + .../dist/sourcemap-codec.umd.js | 175 + .../dist/sourcemap-codec.umd.js.map | 1 + .../dist/types/sourcemap-codec.d.ts | 6 + .../@jridgewell/sourcemap-codec/package.json | 74 + .../@jridgewell/trace-mapping/LICENSE | 19 + .../@jridgewell/trace-mapping/README.md | 257 + .../trace-mapping/dist/trace-mapping.mjs | 580 + .../trace-mapping/dist/trace-mapping.mjs.map | 1 + .../trace-mapping/dist/trace-mapping.umd.js | 600 + .../dist/trace-mapping.umd.js.map | 1 + .../trace-mapping/dist/types/any-map.d.ts | 8 + .../dist/types/binary-search.d.ts | 32 + .../trace-mapping/dist/types/by-source.d.ts | 7 + .../trace-mapping/dist/types/resolve.d.ts | 1 + .../trace-mapping/dist/types/sort.d.ts | 2 + .../dist/types/sourcemap-segment.d.ts | 16 + .../dist/types/strip-filename.d.ts | 4 + .../dist/types/trace-mapping.d.ts | 79 + .../trace-mapping/dist/types/types.d.ts | 99 + .../@jridgewell/trace-mapping/package.json | 77 + node_modules/@nodelib/fs.scandir/LICENSE | 21 + node_modules/@nodelib/fs.scandir/README.md | 171 + .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 + .../@nodelib/fs.scandir/out/adapters/fs.js | 19 + .../@nodelib/fs.scandir/out/constants.d.ts | 4 + .../@nodelib/fs.scandir/out/constants.js | 17 + .../@nodelib/fs.scandir/out/index.d.ts | 12 + node_modules/@nodelib/fs.scandir/out/index.js | 26 + .../fs.scandir/out/providers/async.d.ts | 7 + .../fs.scandir/out/providers/async.js | 104 + .../fs.scandir/out/providers/common.d.ts | 1 + .../fs.scandir/out/providers/common.js | 13 + .../fs.scandir/out/providers/sync.d.ts | 5 + .../@nodelib/fs.scandir/out/providers/sync.js | 54 + .../@nodelib/fs.scandir/out/settings.d.ts | 20 + .../@nodelib/fs.scandir/out/settings.js | 24 + .../@nodelib/fs.scandir/out/types/index.d.ts | 20 + .../@nodelib/fs.scandir/out/types/index.js | 2 + .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/fs.js | 19 + .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/index.js | 5 + node_modules/@nodelib/fs.scandir/package.json | 44 + node_modules/@nodelib/fs.stat/LICENSE | 21 + node_modules/@nodelib/fs.stat/README.md | 126 + .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 + .../@nodelib/fs.stat/out/adapters/fs.js | 17 + node_modules/@nodelib/fs.stat/out/index.d.ts | 12 + node_modules/@nodelib/fs.stat/out/index.js | 26 + .../@nodelib/fs.stat/out/providers/async.d.ts | 4 + .../@nodelib/fs.stat/out/providers/async.js | 36 + .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 + .../@nodelib/fs.stat/out/providers/sync.js | 23 + .../@nodelib/fs.stat/out/settings.d.ts | 16 + node_modules/@nodelib/fs.stat/out/settings.js | 16 + .../@nodelib/fs.stat/out/types/index.d.ts | 4 + .../@nodelib/fs.stat/out/types/index.js | 2 + node_modules/@nodelib/fs.stat/package.json | 37 + node_modules/@nodelib/fs.walk/LICENSE | 21 + node_modules/@nodelib/fs.walk/README.md | 215 + node_modules/@nodelib/fs.walk/out/index.d.ts | 14 + node_modules/@nodelib/fs.walk/out/index.js | 34 + .../@nodelib/fs.walk/out/providers/async.d.ts | 12 + .../@nodelib/fs.walk/out/providers/async.js | 30 + .../@nodelib/fs.walk/out/providers/index.d.ts | 4 + .../@nodelib/fs.walk/out/providers/index.js | 9 + .../fs.walk/out/providers/stream.d.ts | 12 + .../@nodelib/fs.walk/out/providers/stream.js | 34 + .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 + .../@nodelib/fs.walk/out/providers/sync.js | 14 + .../@nodelib/fs.walk/out/readers/async.d.ts | 30 + .../@nodelib/fs.walk/out/readers/async.js | 97 + .../@nodelib/fs.walk/out/readers/common.d.ts | 7 + .../@nodelib/fs.walk/out/readers/common.js | 31 + .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 + .../@nodelib/fs.walk/out/readers/reader.js | 11 + .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 + .../@nodelib/fs.walk/out/readers/sync.js | 59 + .../@nodelib/fs.walk/out/settings.d.ts | 30 + node_modules/@nodelib/fs.walk/out/settings.js | 26 + .../@nodelib/fs.walk/out/types/index.d.ts | 8 + .../@nodelib/fs.walk/out/types/index.js | 2 + node_modules/@nodelib/fs.walk/package.json | 44 + node_modules/@pkgjs/parseargs/.editorconfig | 14 + node_modules/@pkgjs/parseargs/CHANGELOG.md | 147 + node_modules/@pkgjs/parseargs/LICENSE | 201 + node_modules/@pkgjs/parseargs/README.md | 413 + .../parseargs/examples/is-default-value.js | 25 + .../parseargs/examples/limit-long-syntax.js | 35 + .../@pkgjs/parseargs/examples/negate.js | 43 + .../parseargs/examples/no-repeated-options.js | 31 + .../parseargs/examples/ordered-options.mjs | 41 + .../parseargs/examples/simple-hard-coded.js | 26 + node_modules/@pkgjs/parseargs/index.js | 396 + .../@pkgjs/parseargs/internal/errors.js | 47 + .../@pkgjs/parseargs/internal/primordials.js | 393 + .../@pkgjs/parseargs/internal/util.js | 14 + .../@pkgjs/parseargs/internal/validators.js | 89 + node_modules/@pkgjs/parseargs/package.json | 36 + node_modules/@pkgjs/parseargs/utils.js | 198 + node_modules/@sindresorhus/slugify/index.d.ts | 215 + node_modules/@sindresorhus/slugify/index.js | 101 + node_modules/@sindresorhus/slugify/license | 9 + .../escape-string-regexp/index.d.ts | 18 + .../escape-string-regexp/index.js | 13 + .../node_modules/escape-string-regexp/license | 9 + .../escape-string-regexp/package.json | 38 + .../escape-string-regexp/readme.md | 34 + .../slugify/overridable-replacements.js | 7 + .../@sindresorhus/slugify/package.json | 52 + node_modules/@sindresorhus/slugify/readme.md | 236 + .../@sindresorhus/transliterate/index.d.ts | 55 + .../@sindresorhus/transliterate/index.js | 35 + .../@sindresorhus/transliterate/license | 9 + .../@sindresorhus/transliterate/package.json | 46 + .../@sindresorhus/transliterate/readme.md | 103 + .../transliterate/replacements.js | 797 + node_modules/@types/minimatch/LICENSE | 21 + node_modules/@types/minimatch/README.md | 16 + node_modules/@types/minimatch/index.d.ts | 204 + node_modules/@types/minimatch/package.json | 30 + node_modules/@types/node/LICENSE | 21 + node_modules/@types/node/README.md | 15 + node_modules/@types/node/assert.d.ts | 1040 + node_modules/@types/node/assert/strict.d.ts | 8 + node_modules/@types/node/async_hooks.d.ts | 541 + node_modules/@types/node/buffer.d.ts | 2363 + node_modules/@types/node/child_process.d.ts | 1544 + node_modules/@types/node/cluster.d.ts | 578 + node_modules/@types/node/console.d.ts | 452 + node_modules/@types/node/constants.d.ts | 19 + node_modules/@types/node/crypto.d.ts | 4523 + node_modules/@types/node/dgram.d.ts | 596 + .../@types/node/diagnostics_channel.d.ts | 554 + node_modules/@types/node/dns.d.ts | 864 + node_modules/@types/node/dns/promises.d.ts | 476 + node_modules/@types/node/dom-events.d.ts | 124 + node_modules/@types/node/domain.d.ts | 170 + node_modules/@types/node/events.d.ts | 931 + node_modules/@types/node/fs.d.ts | 4317 + node_modules/@types/node/fs/promises.d.ts | 1245 + node_modules/@types/node/globals.d.ts | 412 + node_modules/@types/node/globals.global.d.ts | 1 + node_modules/@types/node/http.d.ts | 1908 + node_modules/@types/node/http2.d.ts | 2418 + node_modules/@types/node/https.d.ts | 550 + node_modules/@types/node/index.d.ts | 89 + node_modules/@types/node/inspector.d.ts | 2746 + node_modules/@types/node/module.d.ts | 315 + node_modules/@types/node/net.d.ts | 999 + node_modules/@types/node/os.d.ts | 495 + node_modules/@types/node/package.json | 217 + node_modules/@types/node/path.d.ts | 191 + node_modules/@types/node/perf_hooks.d.ts | 905 + node_modules/@types/node/process.d.ts | 1754 + node_modules/@types/node/punycode.d.ts | 117 + node_modules/@types/node/querystring.d.ts | 153 + node_modules/@types/node/readline.d.ts | 540 + .../@types/node/readline/promises.d.ts | 150 + node_modules/@types/node/repl.d.ts | 430 + node_modules/@types/node/sea.d.ts | 153 + node_modules/@types/node/stream.d.ts | 1707 + .../@types/node/stream/consumers.d.ts | 12 + node_modules/@types/node/stream/promises.d.ts | 83 + node_modules/@types/node/stream/web.d.ts | 367 + node_modules/@types/node/string_decoder.d.ts | 67 + node_modules/@types/node/test.d.ts | 1729 + node_modules/@types/node/timers.d.ts | 240 + node_modules/@types/node/timers/promises.d.ts | 97 + node_modules/@types/node/tls.d.ts | 1217 + node_modules/@types/node/trace_events.d.ts | 197 + node_modules/@types/node/tty.d.ts | 208 + node_modules/@types/node/url.d.ts | 952 + node_modules/@types/node/util.d.ts | 2292 + node_modules/@types/node/v8.d.ts | 808 + node_modules/@types/node/vm.d.ts | 924 + node_modules/@types/node/wasi.d.ts | 181 + node_modules/@types/node/worker_threads.d.ts | 694 + node_modules/@types/node/zlib.d.ts | 530 + node_modules/a-sync-waterfall/LICENSE | 21 + node_modules/a-sync-waterfall/README.md | 95 + node_modules/a-sync-waterfall/index.js | 83 + node_modules/a-sync-waterfall/package.json | 21 + node_modules/a-sync-waterfall/test.js | 77 + node_modules/acorn/CHANGELOG.md | 620 + node_modules/acorn/LICENSE | 21 + node_modules/acorn/README.md | 269 + node_modules/acorn/bin/acorn | 4 + node_modules/acorn/dist/acorn.d.ts | 209 + node_modules/acorn/dist/acorn.js | 5186 + node_modules/acorn/dist/acorn.js.map | 1 + node_modules/acorn/dist/acorn.mjs | 5155 + node_modules/acorn/dist/acorn.mjs.d.ts | 2 + node_modules/acorn/dist/acorn.mjs.map | 1 + node_modules/acorn/dist/bin.js | 64 + node_modules/acorn/package.json | 35 + node_modules/ansi-regex/index.d.ts | 37 + node_modules/ansi-regex/index.js | 10 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 55 + node_modules/ansi-regex/readme.md | 78 + node_modules/ansi-styles/index.d.ts | 345 + node_modules/ansi-styles/index.js | 163 + node_modules/ansi-styles/license | 9 + node_modules/ansi-styles/package.json | 56 + node_modules/ansi-styles/readme.md | 152 + node_modules/any-promise/.jshintrc | 4 + node_modules/any-promise/.npmignore | 7 + node_modules/any-promise/LICENSE | 19 + node_modules/any-promise/README.md | 161 + node_modules/any-promise/implementation.d.ts | 3 + node_modules/any-promise/implementation.js | 1 + node_modules/any-promise/index.d.ts | 73 + node_modules/any-promise/index.js | 1 + node_modules/any-promise/loader.js | 78 + node_modules/any-promise/optional.js | 6 + node_modules/any-promise/package.json | 45 + node_modules/any-promise/register-shim.js | 18 + node_modules/any-promise/register.d.ts | 17 + node_modules/any-promise/register.js | 94 + .../any-promise/register/bluebird.d.ts | 1 + node_modules/any-promise/register/bluebird.js | 2 + .../any-promise/register/es6-promise.d.ts | 1 + .../any-promise/register/es6-promise.js | 2 + node_modules/any-promise/register/lie.d.ts | 1 + node_modules/any-promise/register/lie.js | 2 + .../register/native-promise-only.d.ts | 1 + .../register/native-promise-only.js | 2 + node_modules/any-promise/register/pinkie.d.ts | 1 + node_modules/any-promise/register/pinkie.js | 2 + .../any-promise/register/promise.d.ts | 1 + node_modules/any-promise/register/promise.js | 2 + node_modules/any-promise/register/q.d.ts | 1 + node_modules/any-promise/register/q.js | 2 + node_modules/any-promise/register/rsvp.d.ts | 1 + node_modules/any-promise/register/rsvp.js | 2 + node_modules/any-promise/register/vow.d.ts | 1 + node_modules/any-promise/register/vow.js | 2 + node_modules/any-promise/register/when.d.ts | 1 + node_modules/any-promise/register/when.js | 2 + node_modules/anymatch/LICENSE | 15 + node_modules/anymatch/README.md | 87 + node_modules/anymatch/index.d.ts | 20 + node_modules/anymatch/index.js | 104 + node_modules/anymatch/package.json | 48 + node_modules/arg/LICENSE.md | 21 + node_modules/arg/README.md | 317 + node_modules/arg/index.d.ts | 44 + node_modules/arg/index.js | 195 + node_modules/arg/package.json | 28 + node_modules/argparse/CHANGELOG.md | 185 + node_modules/argparse/LICENSE | 21 + node_modules/argparse/README.md | 257 + node_modules/argparse/index.js | 3 + node_modules/argparse/lib/action.js | 146 + node_modules/argparse/lib/action/append.js | 53 + .../argparse/lib/action/append/constant.js | 47 + node_modules/argparse/lib/action/count.js | 40 + node_modules/argparse/lib/action/help.js | 47 + node_modules/argparse/lib/action/store.js | 50 + .../argparse/lib/action/store/constant.js | 43 + .../argparse/lib/action/store/false.js | 27 + .../argparse/lib/action/store/true.js | 26 + .../argparse/lib/action/subparsers.js | 149 + node_modules/argparse/lib/action/version.js | 47 + node_modules/argparse/lib/action_container.js | 482 + node_modules/argparse/lib/argparse.js | 14 + node_modules/argparse/lib/argument/error.js | 50 + .../argparse/lib/argument/exclusive.js | 54 + node_modules/argparse/lib/argument/group.js | 75 + node_modules/argparse/lib/argument_parser.js | 1161 + node_modules/argparse/lib/const.js | 21 + .../argparse/lib/help/added_formatters.js | 87 + node_modules/argparse/lib/help/formatter.js | 795 + node_modules/argparse/lib/namespace.js | 76 + node_modules/argparse/lib/utils.js | 57 + node_modules/argparse/package.json | 34 + node_modules/array-differ/index.d.ts | 21 + node_modules/array-differ/index.js | 8 + node_modules/array-differ/license | 9 + node_modules/array-differ/package.json | 35 + node_modules/array-differ/readme.md | 41 + node_modules/array-union/index.d.ts | 25 + node_modules/array-union/index.js | 5 + node_modules/array-union/license | 9 + node_modules/array-union/package.json | 38 + node_modules/array-union/readme.md | 34 + node_modules/array-uniq/index.js | 62 + node_modules/array-uniq/license | 21 + node_modules/array-uniq/package.json | 37 + node_modules/array-uniq/readme.md | 30 + node_modules/arrify/index.d.ts | 38 + node_modules/arrify/index.js | 23 + node_modules/arrify/license | 9 + node_modules/arrify/package.json | 35 + node_modules/arrify/readme.md | 39 + node_modules/asap/CHANGES.md | 70 + node_modules/asap/LICENSE.md | 21 + node_modules/asap/README.md | 237 + node_modules/asap/asap.js | 65 + node_modules/asap/browser-asap.js | 66 + node_modules/asap/browser-raw.js | 223 + node_modules/asap/package.json | 58 + node_modules/asap/raw.js | 101 + node_modules/assert-never/README.md | 39 + node_modules/assert-never/index.d.ts | 4 + node_modules/assert-never/index.js | 41 + node_modules/assert-never/index.ts | 48 + node_modules/assert-never/package.json | 36 + node_modules/async/CHANGELOG.md | 348 + node_modules/async/LICENSE | 19 + node_modules/async/README.md | 59 + node_modules/async/all.js | 119 + node_modules/async/allLimit.js | 46 + node_modules/async/allSeries.js | 45 + node_modules/async/any.js | 122 + node_modules/async/anyLimit.js | 47 + node_modules/async/anySeries.js | 46 + node_modules/async/apply.js | 11 + node_modules/async/applyEach.js | 57 + node_modules/async/applyEachSeries.js | 37 + node_modules/async/asyncify.js | 118 + node_modules/async/auto.js | 333 + node_modules/async/autoInject.js | 182 + node_modules/async/bower.json | 17 + node_modules/async/cargo.js | 63 + node_modules/async/cargoQueue.js | 71 + node_modules/async/compose.js | 55 + node_modules/async/concat.js | 115 + node_modules/async/concatLimit.js | 60 + node_modules/async/concatSeries.js | 41 + node_modules/async/constant.js | 14 + node_modules/async/detect.js | 96 + node_modules/async/detectLimit.js | 48 + node_modules/async/detectSeries.js | 47 + node_modules/async/dir.js | 43 + node_modules/async/dist/async.js | 6062 + node_modules/async/dist/async.min.js | 1 + node_modules/async/dist/async.mjs | 5949 + node_modules/async/doDuring.js | 68 + node_modules/async/doUntil.js | 46 + node_modules/async/doWhilst.js | 68 + node_modules/async/during.js | 78 + node_modules/async/each.js | 129 + node_modules/async/eachLimit.js | 50 + node_modules/async/eachOf.js | 185 + node_modules/async/eachOfLimit.js | 47 + node_modules/async/eachOfSeries.js | 39 + node_modules/async/eachSeries.js | 44 + node_modules/async/ensureAsync.js | 67 + node_modules/async/every.js | 119 + node_modules/async/everyLimit.js | 46 + node_modules/async/everySeries.js | 45 + node_modules/async/filter.js | 93 + node_modules/async/filterLimit.js | 45 + node_modules/async/filterSeries.js | 43 + node_modules/async/find.js | 96 + node_modules/async/findLimit.js | 48 + node_modules/async/findSeries.js | 47 + node_modules/async/flatMap.js | 115 + node_modules/async/flatMapLimit.js | 60 + node_modules/async/flatMapSeries.js | 41 + node_modules/async/foldl.js | 153 + node_modules/async/foldr.js | 41 + node_modules/async/forEach.js | 129 + node_modules/async/forEachLimit.js | 50 + node_modules/async/forEachOf.js | 185 + node_modules/async/forEachOfLimit.js | 47 + node_modules/async/forEachOfSeries.js | 39 + node_modules/async/forEachSeries.js | 44 + node_modules/async/forever.js | 68 + node_modules/async/groupBy.js | 108 + node_modules/async/groupByLimit.js | 71 + node_modules/async/groupBySeries.js | 36 + node_modules/async/index.js | 588 + node_modules/async/inject.js | 153 + .../async/internal/DoublyLinkedList.js | 92 + node_modules/async/internal/Heap.js | 120 + node_modules/async/internal/applyEach.js | 29 + .../async/internal/asyncEachOfLimit.js | 75 + node_modules/async/internal/awaitify.js | 28 + node_modules/async/internal/breakLoop.js | 10 + node_modules/async/internal/consoleFunc.js | 31 + node_modules/async/internal/createTester.js | 40 + node_modules/async/internal/eachOfLimit.js | 90 + node_modules/async/internal/filter.js | 55 + node_modules/async/internal/getIterator.js | 11 + node_modules/async/internal/initialParams.js | 14 + node_modules/async/internal/isArrayLike.js | 10 + node_modules/async/internal/iterator.js | 57 + node_modules/async/internal/map.js | 30 + node_modules/async/internal/once.js | 17 + node_modules/async/internal/onlyOnce.js | 15 + node_modules/async/internal/parallel.js | 34 + .../async/internal/promiseCallback.js | 23 + node_modules/async/internal/queue.js | 294 + node_modules/async/internal/range.js | 14 + node_modules/async/internal/reject.js | 26 + node_modules/async/internal/setImmediate.js | 34 + node_modules/async/internal/withoutIndex.js | 10 + node_modules/async/internal/wrapAsync.js | 34 + node_modules/async/log.js | 41 + node_modules/async/map.js | 142 + node_modules/async/mapLimit.js | 45 + node_modules/async/mapSeries.js | 44 + node_modules/async/mapValues.js | 152 + node_modules/async/mapValuesLimit.js | 61 + node_modules/async/mapValuesSeries.js | 37 + node_modules/async/memoize.js | 91 + node_modules/async/nextTick.js | 52 + node_modules/async/package.json | 75 + node_modules/async/parallel.js | 180 + node_modules/async/parallelLimit.js | 41 + node_modules/async/priorityQueue.js | 60 + node_modules/async/queue.js | 24 + node_modules/async/race.js | 67 + node_modules/async/reduce.js | 153 + node_modules/async/reduceRight.js | 41 + node_modules/async/reflect.js | 78 + node_modules/async/reflectAll.js | 93 + node_modules/async/reject.js | 87 + node_modules/async/rejectLimit.js | 45 + node_modules/async/rejectSeries.js | 43 + node_modules/async/retry.js | 159 + node_modules/async/retryable.js | 77 + node_modules/async/select.js | 93 + node_modules/async/selectLimit.js | 45 + node_modules/async/selectSeries.js | 43 + node_modules/async/seq.js | 79 + node_modules/async/series.js | 186 + node_modules/async/setImmediate.js | 45 + node_modules/async/some.js | 122 + node_modules/async/someLimit.js | 47 + node_modules/async/someSeries.js | 46 + node_modules/async/sortBy.js | 190 + node_modules/async/timeout.js | 89 + node_modules/async/times.js | 50 + node_modules/async/timesLimit.js | 43 + node_modules/async/timesSeries.js | 32 + node_modules/async/transform.js | 173 + node_modules/async/tryEach.js | 78 + node_modules/async/unmemoize.js | 25 + node_modules/async/until.js | 61 + node_modules/async/waterfall.js | 105 + node_modules/async/whilst.js | 78 + node_modules/async/wrapSync.js | 118 + node_modules/babel-walk/LICENSE.md | 7 + node_modules/babel-walk/README.md | 127 + node_modules/babel-walk/lib/.tsbuildinfo | 1704 + node_modules/babel-walk/lib/explode.d.ts | 8 + node_modules/babel-walk/lib/explode.js | 109 + node_modules/babel-walk/lib/explode.js.map | 1 + node_modules/babel-walk/lib/index.d.ts | 24 + node_modules/babel-walk/lib/index.js | 136 + node_modules/babel-walk/lib/index.js.map | 1 + node_modules/babel-walk/lib/test.d.ts | 1 + node_modules/babel-walk/lib/test.js | 35 + node_modules/babel-walk/lib/test.js.map | 1 + node_modules/babel-walk/package.json | 36 + .../balanced-match/.github/FUNDING.yml | 2 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 97 + node_modules/balanced-match/index.js | 62 + node_modules/balanced-match/package.json | 48 + node_modules/bcp-47-match/index.js | 142 + node_modules/bcp-47-match/license | 22 + node_modules/bcp-47-match/package.json | 97 + node_modules/bcp-47-match/readme.md | 253 + node_modules/bcp-47-normalize/index.js | 3 + .../bcp-47-normalize/lib/defaults.json | 311 + node_modules/bcp-47-normalize/lib/fields.json | 3232 + node_modules/bcp-47-normalize/lib/index.js | 198 + node_modules/bcp-47-normalize/lib/many.json | 157 + .../bcp-47-normalize/lib/matches.json | 1654 + node_modules/bcp-47-normalize/license | 22 + node_modules/bcp-47-normalize/package.json | 85 + node_modules/bcp-47-normalize/readme.md | 134 + node_modules/bcp-47/index.js | 4 + node_modules/bcp-47/lib/normalize.json | 28 + node_modules/bcp-47/lib/parse.js | 263 + node_modules/bcp-47/lib/regular.json | 11 + node_modules/bcp-47/lib/stringify.js | 43 + node_modules/bcp-47/license | 22 + node_modules/bcp-47/package.json | 95 + node_modules/bcp-47/readme.md | 273 + .../binary-extensions/binary-extensions.json | 263 + .../binary-extensions.json.d.ts | 3 + node_modules/binary-extensions/index.d.ts | 14 + node_modules/binary-extensions/index.js | 1 + node_modules/binary-extensions/license | 10 + node_modules/binary-extensions/package.json | 40 + node_modules/binary-extensions/readme.md | 25 + .../brace-expansion/.github/FUNDING.yml | 2 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 135 + node_modules/brace-expansion/index.js | 203 + node_modules/brace-expansion/package.json | 46 + node_modules/braces/LICENSE | 21 + node_modules/braces/README.md | 586 + node_modules/braces/index.js | 170 + node_modules/braces/lib/compile.js | 60 + node_modules/braces/lib/constants.js | 57 + node_modules/braces/lib/expand.js | 113 + node_modules/braces/lib/parse.js | 331 + node_modules/braces/lib/stringify.js | 32 + node_modules/braces/lib/utils.js | 122 + node_modules/braces/package.json | 77 + node_modules/call-bind/.eslintignore | 1 + node_modules/call-bind/.eslintrc | 16 + node_modules/call-bind/.github/FUNDING.yml | 12 + node_modules/call-bind/.nycrc | 9 + node_modules/call-bind/CHANGELOG.md | 93 + node_modules/call-bind/LICENSE | 21 + node_modules/call-bind/README.md | 64 + node_modules/call-bind/callBound.js | 15 + node_modules/call-bind/index.js | 35 + node_modules/call-bind/package.json | 95 + node_modules/call-bind/test/callBound.js | 54 + node_modules/call-bind/test/index.js | 80 + node_modules/camelcase-css/README.md | 27 + node_modules/camelcase-css/index-es5.js | 24 + node_modules/camelcase-css/index.js | 30 + node_modules/camelcase-css/license | 21 + node_modules/camelcase-css/package.json | 34 + node_modules/chalk/index.d.ts | 415 + node_modules/chalk/license | 9 + node_modules/chalk/package.json | 68 + node_modules/chalk/readme.md | 341 + node_modules/chalk/source/index.js | 229 + node_modules/chalk/source/templates.js | 134 + node_modules/chalk/source/util.js | 39 + node_modules/character-parser/.npmignore | 2 + node_modules/character-parser/LICENSE | 19 + node_modules/character-parser/README.md | 177 + node_modules/character-parser/index.js | 296 + node_modules/character-parser/package.json | 33 + node_modules/chokidar/LICENSE | 21 + node_modules/chokidar/README.md | 308 + node_modules/chokidar/index.js | 973 + node_modules/chokidar/lib/constants.js | 66 + node_modules/chokidar/lib/fsevents-handler.js | 526 + node_modules/chokidar/lib/nodefs-handler.js | 654 + node_modules/chokidar/package.json | 70 + node_modules/chokidar/types/index.d.ts | 192 + node_modules/color-convert/CHANGELOG.md | 54 + node_modules/color-convert/LICENSE | 21 + node_modules/color-convert/README.md | 68 + node_modules/color-convert/conversions.js | 839 + node_modules/color-convert/index.js | 81 + node_modules/color-convert/package.json | 48 + node_modules/color-convert/route.js | 97 + node_modules/color-name/LICENSE | 8 + node_modules/color-name/README.md | 11 + node_modules/color-name/index.js | 152 + node_modules/color-name/package.json | 28 + node_modules/commander/LICENSE | 22 + node_modules/commander/Readme.md | 1134 + node_modules/commander/esm.mjs | 16 + node_modules/commander/index.js | 27 + node_modules/commander/lib/argument.js | 147 + node_modules/commander/lib/command.js | 2179 + node_modules/commander/lib/error.js | 45 + node_modules/commander/lib/help.js | 464 + node_modules/commander/lib/option.js | 331 + node_modules/commander/lib/suggestSimilar.js | 100 + node_modules/commander/package-support.json | 16 + node_modules/commander/package.json | 80 + node_modules/commander/typings/index.d.ts | 889 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 43 + node_modules/concat-map/test/map.js | 39 + node_modules/constantinople/.editorconfig | 10 + node_modules/constantinople/.gitattributes | 22 + node_modules/constantinople/.prettierrc | 13 + node_modules/constantinople/.travis.yml | 5 + node_modules/constantinople/LICENSE | 19 + node_modules/constantinople/README.md | 46 + .../constantinople/lib/binaryOperation.d.ts | 2 + .../constantinople/lib/binaryOperation.js | 51 + node_modules/constantinople/lib/index.d.ts | 19 + node_modules/constantinople/lib/index.js | 368 + node_modules/constantinople/package.json | 36 + .../constantinople/src/binaryOperation.ts | 76 + node_modules/constantinople/src/index.ts | 369 + node_modules/constantinople/test/index.js | 86 + node_modules/constantinople/tsconfig.json | 8 + node_modules/cross-spawn/CHANGELOG.md | 130 + node_modules/cross-spawn/LICENSE | 21 + node_modules/cross-spawn/README.md | 96 + node_modules/cross-spawn/index.js | 39 + node_modules/cross-spawn/lib/enoent.js | 59 + node_modules/cross-spawn/lib/parse.js | 91 + node_modules/cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 23 + .../cross-spawn/lib/util/resolveCommand.js | 52 + node_modules/cross-spawn/package.json | 73 + node_modules/cssesc/LICENSE-MIT.txt | 20 + node_modules/cssesc/README.md | 201 + node_modules/cssesc/bin/cssesc | 116 + node_modules/cssesc/cssesc.js | 110 + node_modules/cssesc/man/cssesc.1 | 70 + node_modules/cssesc/package.json | 51 + node_modules/debug/LICENSE | 20 + node_modules/debug/README.md | 481 + node_modules/debug/node_modules/ms/index.js | 162 + node_modules/debug/node_modules/ms/license.md | 21 + .../debug/node_modules/ms/package.json | 37 + node_modules/debug/node_modules/ms/readme.md | 60 + node_modules/debug/package.json | 60 + node_modules/debug/src/browser.js | 269 + node_modules/debug/src/common.js | 274 + node_modules/debug/src/index.js | 10 + node_modules/debug/src/node.js | 263 + node_modules/define-data-property/.eslintrc | 24 + .../define-data-property/.github/FUNDING.yml | 12 + node_modules/define-data-property/.nycrc | 13 + .../define-data-property/CHANGELOG.md | 70 + node_modules/define-data-property/LICENSE | 21 + node_modules/define-data-property/README.md | 67 + node_modules/define-data-property/index.d.ts | 12 + node_modules/define-data-property/index.js | 56 + .../define-data-property/package.json | 106 + .../define-data-property/test/index.js | 392 + .../define-data-property/tsconfig.json | 59 + node_modules/dependency-graph/CHANGELOG.md | 82 + node_modules/dependency-graph/LICENSE | 19 + node_modules/dependency-graph/README.md | 78 + .../dependency-graph/lib/dep_graph.js | 364 + node_modules/dependency-graph/lib/index.d.ts | 127 + node_modules/dependency-graph/package.json | 31 + .../dependency-graph/specs/dep_graph_spec.js | 542 + node_modules/dev-ip/.jshintrc | 26 + node_modules/dev-ip/.npmignore | 3 + node_modules/dev-ip/.travis.yml | 5 + node_modules/dev-ip/LICENSE-MIT | 22 + node_modules/dev-ip/README.md | 32 + node_modules/dev-ip/example.js | 4 + node_modules/dev-ip/lib/dev-ip.js | 44 + node_modules/dev-ip/package.json | 43 + node_modules/dev-ip/test/.jshintrc | 26 + node_modules/dev-ip/test/devip.js | 77 + .../dev-ip/test/fixtures/resp-multiple.js | 35 + .../dev-ip/test/fixtures/resp-none.js | 19 + .../dev-ip/test/fixtures/resp-single.js | 30 + node_modules/didyoumean/LICENSE | 14 + node_modules/didyoumean/README.md | 134 + node_modules/didyoumean/didYouMean-1.2.1.js | 274 + .../didyoumean/didYouMean-1.2.1.min.js | 17 + node_modules/didyoumean/package.json | 27 + node_modules/dlv/README.md | 76 + node_modules/dlv/dist/dlv.es.js | 2 + node_modules/dlv/dist/dlv.es.js.map | 1 + node_modules/dlv/dist/dlv.js | 2 + node_modules/dlv/dist/dlv.js.map | 1 + node_modules/dlv/dist/dlv.umd.js | 2 + node_modules/dlv/dist/dlv.umd.js.map | 1 + node_modules/dlv/index.js | 7 + node_modules/dlv/package.json | 30 + node_modules/doctypes/.npmignore | 13 + node_modules/doctypes/.travis.yml | 3 + node_modules/doctypes/HISTORY.md | 14 + node_modules/doctypes/LICENSE | 19 + node_modules/doctypes/README.md | 24 + node_modules/doctypes/index.js | 13 + node_modules/doctypes/package.json | 19 + node_modules/doctypes/test.js | 9 + node_modules/dom-serializer/LICENSE | 11 + node_modules/dom-serializer/README.md | 97 + .../dom-serializer/lib/esm/foreignNames.d.ts | 3 + .../lib/esm/foreignNames.d.ts.map | 1 + .../dom-serializer/lib/esm/foreignNames.js | 100 + .../dom-serializer/lib/esm/index.d.ts | 52 + .../dom-serializer/lib/esm/index.d.ts.map | 1 + node_modules/dom-serializer/lib/esm/index.js | 190 + .../dom-serializer/lib/esm/package.json | 1 + .../dom-serializer/lib/foreignNames.d.ts | 3 + .../dom-serializer/lib/foreignNames.d.ts.map | 1 + .../dom-serializer/lib/foreignNames.js | 103 + node_modules/dom-serializer/lib/index.d.ts | 43 + .../dom-serializer/lib/index.d.ts.map | 1 + node_modules/dom-serializer/lib/index.js | 211 + .../node_modules/entities/LICENSE | 11 + .../node_modules/entities/lib/decode.d.ts | 5 + .../node_modules/entities/lib/decode.d.ts.map | 1 + .../node_modules/entities/lib/decode.js | 53 + .../entities/lib/decode_codepoint.d.ts | 2 + .../entities/lib/decode_codepoint.d.ts.map | 1 + .../entities/lib/decode_codepoint.js | 30 + .../node_modules/entities/lib/encode.d.ts | 47 + .../node_modules/entities/lib/encode.d.ts.map | 1 + .../node_modules/entities/lib/encode.js | 136 + .../node_modules/entities/lib/index.d.ts | 27 + .../node_modules/entities/lib/index.d.ts.map | 1 + .../node_modules/entities/lib/index.js | 57 + .../entities/lib/maps/decode.json | 1 + .../entities/lib/maps/entities.json | 1 + .../entities/lib/maps/legacy.json | 1 + .../node_modules/entities/lib/maps/xml.json | 1 + .../node_modules/entities/package.json | 64 + .../node_modules/entities/readme.md | 57 + node_modules/dom-serializer/package.json | 55 + node_modules/domelementtype/LICENSE | 11 + .../domelementtype/lib/esm/index.d.ts | 48 + .../domelementtype/lib/esm/index.d.ts.map | 1 + node_modules/domelementtype/lib/esm/index.js | 51 + .../domelementtype/lib/esm/package.json | 1 + node_modules/domelementtype/lib/index.d.ts | 48 + .../domelementtype/lib/index.d.ts.map | 1 + node_modules/domelementtype/lib/index.js | 55 + node_modules/domelementtype/package.json | 54 + node_modules/domelementtype/readme.md | 1 + node_modules/domhandler/LICENSE | 11 + node_modules/domhandler/lib/index.d.ts | 85 + node_modules/domhandler/lib/index.d.ts.map | 1 + node_modules/domhandler/lib/index.js | 176 + node_modules/domhandler/lib/node.d.ts | 237 + node_modules/domhandler/lib/node.d.ts.map | 1 + node_modules/domhandler/lib/node.js | 444 + node_modules/domhandler/package.json | 58 + node_modules/domhandler/readme.md | 163 + node_modules/domutils/LICENSE | 11 + node_modules/domutils/lib/feeds.d.ts | 45 + node_modules/domutils/lib/feeds.d.ts.map | 1 + node_modules/domutils/lib/feeds.js | 190 + node_modules/domutils/lib/helpers.d.ts | 51 + node_modules/domutils/lib/helpers.d.ts.map | 1 + node_modules/domutils/lib/helpers.js | 125 + node_modules/domutils/lib/index.d.ts | 10 + node_modules/domutils/lib/index.d.ts.map | 1 + node_modules/domutils/lib/index.js | 28 + node_modules/domutils/lib/legacy.d.ts | 47 + node_modules/domutils/lib/legacy.d.ts.map | 1 + node_modules/domutils/lib/legacy.js | 124 + node_modules/domutils/lib/manipulation.d.ts | 43 + .../domutils/lib/manipulation.d.ts.map | 1 + node_modules/domutils/lib/manipulation.js | 129 + node_modules/domutils/lib/querying.d.ts | 55 + node_modules/domutils/lib/querying.d.ts.map | 1 + node_modules/domutils/lib/querying.js | 126 + node_modules/domutils/lib/stringify.d.ts | 41 + node_modules/domutils/lib/stringify.d.ts.map | 1 + node_modules/domutils/lib/stringify.js | 86 + node_modules/domutils/lib/traversal.d.ts | 59 + node_modules/domutils/lib/traversal.d.ts.map | 1 + node_modules/domutils/lib/traversal.js | 117 + node_modules/domutils/package.json | 65 + node_modules/domutils/readme.md | 31 + node_modules/eastasianwidth/README.md | 32 + node_modules/eastasianwidth/eastasianwidth.js | 311 + node_modules/eastasianwidth/package.json | 18 + node_modules/ee-first/LICENSE | 22 + node_modules/ee-first/README.md | 80 + node_modules/ee-first/index.js | 95 + node_modules/ee-first/package.json | 29 + node_modules/ejs/LICENSE | 202 + node_modules/ejs/README.md | 358 + node_modules/ejs/bin/cli.js | 211 + node_modules/ejs/ejs.js | 1746 + node_modules/ejs/ejs.min.js | 1 + node_modules/ejs/jakefile.js | 88 + node_modules/ejs/lib/ejs.js | 952 + node_modules/ejs/lib/utils.js | 250 + node_modules/ejs/package.json | 42 + node_modules/ejs/usage.txt | 24 + node_modules/emoji-regex/LICENSE-MIT.txt | 20 + node_modules/emoji-regex/README.md | 73 + node_modules/emoji-regex/es2015/index.js | 6 + node_modules/emoji-regex/es2015/text.js | 6 + node_modules/emoji-regex/index.d.ts | 23 + node_modules/emoji-regex/index.js | 6 + node_modules/emoji-regex/package.json | 50 + node_modules/emoji-regex/text.js | 6 + node_modules/encodeurl/HISTORY.md | 14 + node_modules/encodeurl/LICENSE | 22 + node_modules/encodeurl/README.md | 128 + node_modules/encodeurl/index.js | 60 + node_modules/encodeurl/package.json | 40 + node_modules/entities/LICENSE | 11 + node_modules/entities/lib/decode.d.ts | 15 + node_modules/entities/lib/decode.d.ts.map | 1 + node_modules/entities/lib/decode.js | 145 + .../entities/lib/decode_codepoint.d.ts | 2 + .../entities/lib/decode_codepoint.d.ts.map | 1 + node_modules/entities/lib/decode_codepoint.js | 54 + node_modules/entities/lib/encode-trie.d.ts | 8 + .../entities/lib/encode-trie.d.ts.map | 1 + node_modules/entities/lib/encode-trie.js | 77 + node_modules/entities/lib/encode.d.ts | 46 + node_modules/entities/lib/encode.d.ts.map | 1 + node_modules/entities/lib/encode.js | 126 + .../lib/generated/decode-data-html.d.ts | 3 + .../lib/generated/decode-data-html.d.ts.map | 1 + .../lib/generated/decode-data-html.js | 5 + .../lib/generated/decode-data-xml.d.ts | 3 + .../lib/generated/decode-data-xml.d.ts.map | 1 + .../entities/lib/generated/decode-data-xml.js | 5 + node_modules/entities/lib/index.d.ts | 91 + node_modules/entities/lib/index.d.ts.map | 1 + node_modules/entities/lib/index.js | 118 + node_modules/entities/lib/maps/entities.json | 1 + node_modules/entities/lib/maps/legacy.json | 1 + node_modules/entities/lib/maps/xml.json | 1 + node_modules/entities/package.json | 67 + node_modules/entities/readme.md | 74 + node_modules/errno/.jshintrc | 59 + node_modules/errno/.travis.yml | 19 + node_modules/errno/README.md | 145 + node_modules/errno/build.js | 43 + node_modules/errno/cli.js | 22 + node_modules/errno/custom.js | 57 + node_modules/errno/errno.js | 313 + node_modules/errno/package.json | 33 + node_modules/errno/test.js | 88 + node_modules/es-define-property/.eslintrc | 13 + .../es-define-property/.github/FUNDING.yml | 12 + node_modules/es-define-property/.nycrc | 9 + node_modules/es-define-property/CHANGELOG.md | 15 + node_modules/es-define-property/LICENSE | 21 + node_modules/es-define-property/README.md | 49 + node_modules/es-define-property/index.d.ts | 3 + node_modules/es-define-property/index.js | 16 + node_modules/es-define-property/package.json | 81 + node_modules/es-define-property/test/index.js | 55 + node_modules/es-define-property/tsconfig.json | 50 + node_modules/es-errors/.eslintrc | 5 + node_modules/es-errors/.github/FUNDING.yml | 12 + node_modules/es-errors/CHANGELOG.md | 40 + node_modules/es-errors/LICENSE | 21 + node_modules/es-errors/README.md | 55 + node_modules/es-errors/eval.d.ts | 3 + node_modules/es-errors/eval.js | 4 + node_modules/es-errors/index.d.ts | 3 + node_modules/es-errors/index.js | 4 + node_modules/es-errors/package.json | 80 + node_modules/es-errors/range.d.ts | 3 + node_modules/es-errors/range.js | 4 + node_modules/es-errors/ref.d.ts | 3 + node_modules/es-errors/ref.js | 4 + node_modules/es-errors/syntax.d.ts | 3 + node_modules/es-errors/syntax.js | 4 + node_modules/es-errors/test/index.js | 19 + node_modules/es-errors/tsconfig.json | 49 + node_modules/es-errors/type.d.ts | 3 + node_modules/es-errors/type.js | 4 + node_modules/es-errors/uri.d.ts | 3 + node_modules/es-errors/uri.js | 4 + node_modules/escape-html/LICENSE | 24 + node_modules/escape-html/Readme.md | 43 + node_modules/escape-html/index.js | 78 + node_modules/escape-html/package.json | 24 + node_modules/escape-string-regexp/index.d.ts | 18 + node_modules/escape-string-regexp/index.js | 11 + node_modules/escape-string-regexp/license | 9 + .../escape-string-regexp/package.json | 43 + node_modules/escape-string-regexp/readme.md | 29 + node_modules/esprima/ChangeLog | 235 + node_modules/esprima/LICENSE.BSD | 21 + node_modules/esprima/README.md | 46 + node_modules/esprima/bin/esparse.js | 139 + node_modules/esprima/bin/esvalidate.js | 236 + node_modules/esprima/dist/esprima.js | 6709 ++ node_modules/esprima/package.json | 112 + node_modules/extend-shallow/LICENSE | 21 + node_modules/extend-shallow/README.md | 61 + node_modules/extend-shallow/index.js | 33 + node_modules/extend-shallow/package.json | 56 + node_modules/fast-glob/LICENSE | 21 + node_modules/fast-glob/README.md | 830 + node_modules/fast-glob/out/index.d.ts | 40 + node_modules/fast-glob/out/index.js | 102 + .../fast-glob/out/managers/tasks.d.ts | 22 + node_modules/fast-glob/out/managers/tasks.js | 110 + .../fast-glob/out/providers/async.d.ts | 9 + node_modules/fast-glob/out/providers/async.js | 23 + .../fast-glob/out/providers/filters/deep.d.ts | 16 + .../fast-glob/out/providers/filters/deep.js | 62 + .../out/providers/filters/entry.d.ts | 16 + .../fast-glob/out/providers/filters/entry.js | 63 + .../out/providers/filters/error.d.ts | 8 + .../fast-glob/out/providers/filters/error.js | 15 + .../out/providers/matchers/matcher.d.ts | 33 + .../out/providers/matchers/matcher.js | 45 + .../out/providers/matchers/partial.d.ts | 4 + .../out/providers/matchers/partial.js | 38 + .../fast-glob/out/providers/provider.d.ts | 19 + .../fast-glob/out/providers/provider.js | 48 + .../fast-glob/out/providers/stream.d.ts | 11 + .../fast-glob/out/providers/stream.js | 31 + .../fast-glob/out/providers/sync.d.ts | 9 + node_modules/fast-glob/out/providers/sync.js | 23 + .../out/providers/transformers/entry.d.ts | 8 + .../out/providers/transformers/entry.js | 26 + node_modules/fast-glob/out/readers/async.d.ts | 10 + node_modules/fast-glob/out/readers/async.js | 35 + .../fast-glob/out/readers/reader.d.ts | 15 + node_modules/fast-glob/out/readers/reader.js | 33 + .../fast-glob/out/readers/stream.d.ts | 14 + node_modules/fast-glob/out/readers/stream.js | 55 + node_modules/fast-glob/out/readers/sync.d.ts | 12 + node_modules/fast-glob/out/readers/sync.js | 43 + node_modules/fast-glob/out/settings.d.ts | 164 + node_modules/fast-glob/out/settings.js | 59 + node_modules/fast-glob/out/types/index.d.ts | 31 + node_modules/fast-glob/out/types/index.js | 2 + node_modules/fast-glob/out/utils/array.d.ts | 2 + node_modules/fast-glob/out/utils/array.js | 22 + node_modules/fast-glob/out/utils/errno.d.ts | 2 + node_modules/fast-glob/out/utils/errno.js | 7 + node_modules/fast-glob/out/utils/fs.d.ts | 4 + node_modules/fast-glob/out/utils/fs.js | 19 + node_modules/fast-glob/out/utils/index.d.ts | 8 + node_modules/fast-glob/out/utils/index.js | 17 + node_modules/fast-glob/out/utils/path.d.ts | 13 + node_modules/fast-glob/out/utils/path.js | 68 + node_modules/fast-glob/out/utils/pattern.d.ts | 47 + node_modules/fast-glob/out/utils/pattern.js | 188 + node_modules/fast-glob/out/utils/stream.d.ts | 4 + node_modules/fast-glob/out/utils/stream.js | 17 + node_modules/fast-glob/out/utils/string.d.ts | 2 + node_modules/fast-glob/out/utils/string.js | 11 + node_modules/fast-glob/package.json | 81 + node_modules/fastq/.github/dependabot.yml | 11 + node_modules/fastq/.github/workflows/ci.yml | 75 + node_modules/fastq/LICENSE | 13 + node_modules/fastq/README.md | 306 + node_modules/fastq/bench.js | 66 + node_modules/fastq/example.js | 14 + node_modules/fastq/example.mjs | 11 + node_modules/fastq/index.d.ts | 38 + node_modules/fastq/package.json | 53 + node_modules/fastq/queue.js | 311 + node_modules/fastq/test/example.ts | 83 + node_modules/fastq/test/promise.js | 248 + node_modules/fastq/test/test.js | 642 + node_modules/fastq/test/tsconfig.json | 11 + node_modules/filelist/README.md | 84 + node_modules/filelist/index.d.ts | 110 + node_modules/filelist/index.js | 495 + node_modules/filelist/jakefile.js | 15 + .../filelist/node_modules/minimatch/LICENSE | 15 + .../filelist/node_modules/minimatch/README.md | 259 + .../node_modules/minimatch/lib/path.js | 4 + .../node_modules/minimatch/minimatch.js | 944 + .../node_modules/minimatch/package.json | 35 + node_modules/filelist/package.json | 28 + node_modules/fill-range/LICENSE | 21 + node_modules/fill-range/README.md | 237 + node_modules/fill-range/index.js | 248 + node_modules/fill-range/package.json | 74 + node_modules/finalhandler/HISTORY.md | 195 + node_modules/finalhandler/LICENSE | 22 + node_modules/finalhandler/README.md | 147 + node_modules/finalhandler/SECURITY.md | 25 + node_modules/finalhandler/index.js | 336 + .../node_modules/debug/.coveralls.yml | 1 + .../finalhandler/node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../finalhandler/node_modules/debug/LICENSE | 19 + .../finalhandler/node_modules/debug/Makefile | 50 + .../finalhandler/node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../finalhandler/node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 49 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + node_modules/finalhandler/package.json | 46 + node_modules/foreground-child/LICENSE | 15 + node_modules/foreground-child/README.md | 128 + .../dist/commonjs/all-signals.d.ts | 3 + .../dist/commonjs/all-signals.d.ts.map | 1 + .../dist/commonjs/all-signals.js | 58 + .../dist/commonjs/all-signals.js.map | 1 + .../foreground-child/dist/commonjs/index.d.ts | 63 + .../dist/commonjs/index.d.ts.map | 1 + .../foreground-child/dist/commonjs/index.js | 121 + .../dist/commonjs/index.js.map | 1 + .../dist/commonjs/package.json | 3 + .../dist/commonjs/proxy-signals.d.ts | 7 + .../dist/commonjs/proxy-signals.d.ts.map | 1 + .../dist/commonjs/proxy-signals.js | 38 + .../dist/commonjs/proxy-signals.js.map | 1 + .../dist/commonjs/watchdog.d.ts | 11 + .../dist/commonjs/watchdog.d.ts.map | 1 + .../dist/commonjs/watchdog.js | 50 + .../dist/commonjs/watchdog.js.map | 1 + .../dist/esm/all-signals.d.ts | 3 + .../dist/esm/all-signals.d.ts.map | 1 + .../foreground-child/dist/esm/all-signals.js | 52 + .../dist/esm/all-signals.js.map | 1 + .../foreground-child/dist/esm/index.d.ts | 63 + .../foreground-child/dist/esm/index.d.ts.map | 1 + .../foreground-child/dist/esm/index.js | 113 + .../foreground-child/dist/esm/index.js.map | 1 + .../foreground-child/dist/esm/package.json | 3 + .../dist/esm/proxy-signals.d.ts | 7 + .../dist/esm/proxy-signals.d.ts.map | 1 + .../dist/esm/proxy-signals.js | 34 + .../dist/esm/proxy-signals.js.map | 1 + .../foreground-child/dist/esm/watchdog.d.ts | 11 + .../dist/esm/watchdog.d.ts.map | 1 + .../foreground-child/dist/esm/watchdog.js | 46 + .../foreground-child/dist/esm/watchdog.js.map | 1 + node_modules/foreground-child/package.json | 111 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 26 + node_modules/function-bind/.eslintrc | 21 + .../function-bind/.github/FUNDING.yml | 12 + .../function-bind/.github/SECURITY.md | 3 + node_modules/function-bind/.nycrc | 13 + node_modules/function-bind/CHANGELOG.md | 136 + node_modules/function-bind/LICENSE | 20 + node_modules/function-bind/README.md | 46 + node_modules/function-bind/implementation.js | 84 + node_modules/function-bind/index.js | 5 + node_modules/function-bind/package.json | 87 + node_modules/function-bind/test/.eslintrc | 9 + node_modules/function-bind/test/index.js | 252 + node_modules/get-intrinsic/.eslintrc | 38 + .../get-intrinsic/.github/FUNDING.yml | 12 + node_modules/get-intrinsic/.nycrc | 9 + node_modules/get-intrinsic/CHANGELOG.md | 143 + node_modules/get-intrinsic/LICENSE | 21 + node_modules/get-intrinsic/README.md | 71 + node_modules/get-intrinsic/index.js | 359 + node_modules/get-intrinsic/package.json | 93 + .../get-intrinsic/test/GetIntrinsic.js | 274 + node_modules/glob-parent/CHANGELOG.md | 110 + node_modules/glob-parent/LICENSE | 15 + node_modules/glob-parent/README.md | 137 + node_modules/glob-parent/index.js | 42 + node_modules/glob-parent/package.json | 48 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 378 + node_modules/glob/common.js | 238 + node_modules/glob/glob.js | 790 + node_modules/glob/package.json | 55 + node_modules/glob/sync.js | 486 + node_modules/gopd/.eslintrc | 16 + node_modules/gopd/.github/FUNDING.yml | 12 + node_modules/gopd/CHANGELOG.md | 25 + node_modules/gopd/LICENSE | 21 + node_modules/gopd/README.md | 40 + node_modules/gopd/index.js | 16 + node_modules/gopd/package.json | 71 + node_modules/gopd/test/index.js | 35 + node_modules/graceful-fs/LICENSE | 15 + node_modules/graceful-fs/README.md | 143 + node_modules/graceful-fs/clone.js | 23 + node_modules/graceful-fs/graceful-fs.js | 448 + node_modules/graceful-fs/legacy-streams.js | 118 + node_modules/graceful-fs/package.json | 53 + node_modules/graceful-fs/polyfills.js | 355 + node_modules/gray-matter/CHANGELOG.md | 24 + node_modules/gray-matter/LICENSE | 21 + node_modules/gray-matter/README.md | 565 + node_modules/gray-matter/gray-matter.d.ts | 114 + node_modules/gray-matter/index.js | 228 + node_modules/gray-matter/lib/defaults.js | 18 + node_modules/gray-matter/lib/engine.js | 30 + node_modules/gray-matter/lib/engines.js | 54 + node_modules/gray-matter/lib/excerpt.js | 32 + node_modules/gray-matter/lib/parse.js | 13 + node_modules/gray-matter/lib/stringify.js | 56 + node_modules/gray-matter/lib/to-file.js | 43 + node_modules/gray-matter/lib/utils.js | 66 + node_modules/gray-matter/package.json | 127 + node_modules/hamljs/.bower.json | 14 + node_modules/hamljs/.gitmodules | 3 + node_modules/hamljs/.ignore | 1 + node_modules/hamljs/.npmignore | 3 + node_modules/hamljs/.travis.yml | 4 + node_modules/hamljs/Gruntfile.js | 19 + node_modules/hamljs/History.md | 120 + node_modules/hamljs/Makefile | 11 + node_modules/hamljs/Readme.md | 318 + node_modules/hamljs/haml.js | 436 + node_modules/hamljs/lib/haml.js | 711 + node_modules/hamljs/package.json | 30 + node_modules/hamljs/test/fixtures/class.haml | 1 + node_modules/hamljs/test/fixtures/class.html | 1 + .../hamljs/test/fixtures/classes.haml | 1 + .../hamljs/test/fixtures/classes.html | 1 + .../hamljs/test/fixtures/code.each.haml | 3 + .../hamljs/test/fixtures/code.each.html | 4 + .../hamljs/test/fixtures/code.each.index.haml | 3 + .../hamljs/test/fixtures/code.each.index.html | 4 + .../fixtures/code.each.non-enumerable.haml | 3 + .../fixtures/code.each.non-enumerable.html | 1 + .../hamljs/test/fixtures/code.escape.haml | 1 + .../hamljs/test/fixtures/code.escape.html | 1 + node_modules/hamljs/test/fixtures/code.haml | 1 + node_modules/hamljs/test/fixtures/code.html | 1 + .../hamljs/test/fixtures/code.if.else.haml | 5 + .../hamljs/test/fixtures/code.if.else.html | 1 + .../hamljs/test/fixtures/code.if.haml | 3 + .../hamljs/test/fixtures/code.if.html | 1 + .../hamljs/test/fixtures/code.nested.haml | 5 + .../hamljs/test/fixtures/code.nested.html | 1 + .../fixtures/comment.block.conditional.haml | 9 + .../fixtures/comment.block.conditional.html | 6 + .../hamljs/test/fixtures/comment.block.haml | 5 + .../hamljs/test/fixtures/comment.block.html | 5 + .../hamljs/test/fixtures/comment.haml | 3 + .../hamljs/test/fixtures/comment.html | 1 + .../hamljs/test/fixtures/comment.tag.haml | 1 + .../hamljs/test/fixtures/comment.tag.html | 2 + .../test/fixtures/comment.text.complex.haml | 7 + .../test/fixtures/comment.text.complex.html | 5 + .../hamljs/test/fixtures/comment.text.haml | 2 + .../hamljs/test/fixtures/comment.text.html | 1 + .../hamljs/test/fixtures/context.haml | 1 + .../hamljs/test/fixtures/context.html | 1 + node_modules/hamljs/test/fixtures/cr.haml | 1 + node_modules/hamljs/test/fixtures/cr.html | 3 + node_modules/hamljs/test/fixtures/crlf.haml | 2 + node_modules/hamljs/test/fixtures/crlf.html | 3 + .../hamljs/test/fixtures/doctype.haml | 1 + .../hamljs/test/fixtures/doctype.html | 1 + .../test/fixtures/doctype.xml.case.haml | 1 + .../test/fixtures/doctype.xml.case.html | 1 + .../hamljs/test/fixtures/doctype.xml.haml | 1 + .../hamljs/test/fixtures/doctype.xml.html | 1 + node_modules/hamljs/test/fixtures/error.haml | 3 + node_modules/hamljs/test/fixtures/escape.haml | 2 + node_modules/hamljs/test/fixtures/escape.html | 1 + node_modules/hamljs/test/fixtures/feed.haml | 11 + node_modules/hamljs/test/fixtures/feed.xml | 11 + .../hamljs/test/fixtures/filter.cdata.haml | 3 + .../hamljs/test/fixtures/filter.cdata.html | 3 + .../fixtures/filter.cdata.whitespace.haml | 7 + .../fixtures/filter.cdata.whitespace.html | 7 + .../test/fixtures/filter.javascript.haml | 8 + .../test/fixtures/filter.javascript.html | 9 + .../hamljs/test/fixtures/filter.plain.haml | 5 + .../hamljs/test/fixtures/filter.plain.html | 3 + node_modules/hamljs/test/fixtures/html.haml | 2 + node_modules/hamljs/test/fixtures/html.html | 1 + node_modules/hamljs/test/fixtures/id.haml | 1 + node_modules/hamljs/test/fixtures/id.html | 1 + .../hamljs/test/fixtures/issue.#10.haml | 1 + .../hamljs/test/fixtures/issue.#10.html | 1 + .../hamljs/test/fixtures/issue.#8.haml | 4 + .../hamljs/test/fixtures/issue.#8.html | 5 + .../hamljs/test/fixtures/literals.haml | 1 + .../hamljs/test/fixtures/literals.html | 1 + .../hamljs/test/fixtures/namespace.haml | 1 + .../hamljs/test/fixtures/namespace.tag.haml | 5 + .../hamljs/test/fixtures/namespace.tag.html | 5 + .../hamljs/test/fixtures/namespace.xml | 1 + .../hamljs/test/fixtures/nesting.complex.haml | 6 + .../hamljs/test/fixtures/nesting.complex.html | 6 + .../hamljs/test/fixtures/nesting.simple.haml | 6 + .../hamljs/test/fixtures/nesting.simple.html | 6 + .../hamljs/test/fixtures/newlines.haml | 12 + .../hamljs/test/fixtures/newlines.html | 9 + .../test/fixtures/newlines.within-tags.haml | 4 + .../test/fixtures/newlines.within-tags.html | 2 + .../string.complex-interpolation.haml | 1 + .../string.complex-interpolation.html | 1 + .../test/fixtures/string.interpolation.haml | 1 + .../test/fixtures/string.interpolation.html | 1 + .../hamljs/test/fixtures/tag.attrs.bools.haml | 1 + .../hamljs/test/fixtures/tag.attrs.bools.html | 1 + .../test/fixtures/tag.attrs.escape.haml | 1 + .../test/fixtures/tag.attrs.escape.html | 1 + .../hamljs/test/fixtures/tag.attrs.haml | 1 + .../hamljs/test/fixtures/tag.attrs.html | 1 + .../test/fixtures/tag.class.attribute.haml | 1 + .../test/fixtures/tag.class.attribute.html | 1 + .../hamljs/test/fixtures/tag.class.haml | 1 + .../hamljs/test/fixtures/tag.class.html | 1 + .../hamljs/test/fixtures/tag.classes.haml | 1 + .../hamljs/test/fixtures/tag.classes.html | 1 + .../hamljs/test/fixtures/tag.code.haml | 1 + .../hamljs/test/fixtures/tag.code.html | 1 + .../test/fixtures/tag.code.no-escape.haml | 1 + .../test/fixtures/tag.code.no-escape.html | 1 + .../hamljs/test/fixtures/tag.complex.haml | 1 + .../hamljs/test/fixtures/tag.complex.html | 1 + .../hamljs/test/fixtures/tag.empty.haml | 7 + .../hamljs/test/fixtures/tag.empty.html | 7 + .../hamljs/test/fixtures/tag.escape.haml | 1 + .../hamljs/test/fixtures/tag.escape.html | 1 + .../hamljs/test/fixtures/tag.self-close.haml | 1 + .../hamljs/test/fixtures/tag.self-close.html | 1 + .../hamljs/test/fixtures/tag.simple.haml | 1 + .../hamljs/test/fixtures/tag.simple.html | 1 + .../test/fixtures/tag.text.block.complex.haml | 5 + .../test/fixtures/tag.text.block.complex.html | 2 + .../hamljs/test/fixtures/tag.text.block.haml | 5 + .../hamljs/test/fixtures/tag.text.block.html | 1 + .../hamljs/test/fixtures/tag.text.haml | 1 + .../hamljs/test/fixtures/tag.text.html | 1 + .../hamljs/test/fixtures/trailing-indent.haml | 4 + .../hamljs/test/fixtures/trailing-indent.html | 2 + node_modules/hamljs/test/test.js | 366 + node_modules/hamljs/test/unit/spec.helper.js | 0 node_modules/hamljs/test/unit/spec.js | 329 + node_modules/handlebars/LICENSE | 19 + node_modules/handlebars/README.markdown | 169 + node_modules/handlebars/bin/.eslintrc.js | 6 + node_modules/handlebars/bin/handlebars | 176 + .../handlebars/dist/amd/handlebars.js | 52 + .../handlebars/dist/amd/handlebars.runtime.js | 44 + .../handlebars/dist/amd/handlebars/base.js | 106 + .../dist/amd/handlebars/compiler/ast.js | 31 + .../dist/amd/handlebars/compiler/base.js | 45 + .../dist/amd/handlebars/compiler/code-gen.js | 165 + .../dist/amd/handlebars/compiler/compiler.js | 562 + .../dist/amd/handlebars/compiler/helpers.js | 228 + .../compiler/javascript-compiler.js | 1150 + .../dist/amd/handlebars/compiler/parser.js | 737 + .../dist/amd/handlebars/compiler/printer.js | 186 + .../dist/amd/handlebars/compiler/visitor.js | 138 + .../handlebars/compiler/whitespace-control.js | 219 + .../dist/amd/handlebars/decorators.js | 16 + .../dist/amd/handlebars/decorators/inline.js | 25 + .../dist/amd/handlebars/exception.js | 64 + .../handlebars/dist/amd/handlebars/helpers.js | 44 + .../helpers/block-helper-missing.js | 35 + .../dist/amd/handlebars/helpers/each.js | 99 + .../amd/handlebars/helpers/helper-missing.js | 22 + .../dist/amd/handlebars/helpers/if.js | 41 + .../dist/amd/handlebars/helpers/log.js | 24 + .../dist/amd/handlebars/helpers/lookup.js | 14 + .../dist/amd/handlebars/helpers/with.js | 38 + .../internal/create-new-lookup-object.js | 22 + .../amd/handlebars/internal/proto-access.js | 71 + .../amd/handlebars/internal/wrapHelper.js | 21 + .../handlebars/dist/amd/handlebars/logger.js | 44 + .../dist/amd/handlebars/no-conflict.js | 28 + .../handlebars/dist/amd/handlebars/runtime.js | 356 + .../dist/amd/handlebars/safe-string.js | 15 + .../handlebars/dist/amd/handlebars/utils.js | 126 + .../handlebars/dist/amd/precompiler.js | 314 + .../handlebars/dist/cjs/handlebars.js | 66 + .../handlebars/dist/cjs/handlebars.runtime.js | 66 + .../handlebars/dist/cjs/handlebars/base.js | 116 + .../dist/cjs/handlebars/compiler/ast.js | 31 + .../dist/cjs/handlebars/compiler/base.js | 57 + .../dist/cjs/handlebars/compiler/code-gen.js | 168 + .../dist/cjs/handlebars/compiler/compiler.js | 566 + .../dist/cjs/handlebars/compiler/helpers.js | 228 + .../compiler/javascript-compiler.js | 1158 + .../dist/cjs/handlebars/compiler/parser.js | 737 + .../dist/cjs/handlebars/compiler/printer.js | 186 + .../dist/cjs/handlebars/compiler/visitor.js | 140 + .../handlebars/compiler/whitespace-control.js | 221 + .../dist/cjs/handlebars/decorators.js | 16 + .../dist/cjs/handlebars/decorators/inline.js | 29 + .../dist/cjs/handlebars/exception.js | 64 + .../handlebars/dist/cjs/handlebars/helpers.js | 56 + .../helpers/block-helper-missing.js | 39 + .../dist/cjs/handlebars/helpers/each.js | 104 + .../cjs/handlebars/helpers/helper-missing.js | 25 + .../dist/cjs/handlebars/helpers/if.js | 46 + .../dist/cjs/handlebars/helpers/log.js | 26 + .../dist/cjs/handlebars/helpers/lookup.js | 16 + .../dist/cjs/handlebars/helpers/with.js | 43 + .../internal/create-new-lookup-object.js | 22 + .../cjs/handlebars/internal/proto-access.js | 73 + .../cjs/handlebars/internal/wrapHelper.js | 19 + .../handlebars/dist/cjs/handlebars/logger.js | 47 + .../dist/cjs/handlebars/no-conflict.js | 30 + .../handlebars/dist/cjs/handlebars/runtime.js | 372 + .../dist/cjs/handlebars/safe-string.js | 15 + .../handlebars/dist/cjs/handlebars/utils.js | 124 + .../handlebars/dist/cjs/precompiler.js | 328 + .../handlebars/dist/handlebars.amd.js | 4639 + .../handlebars/dist/handlebars.amd.min.js | 29 + node_modules/handlebars/dist/handlebars.js | 5972 + .../handlebars/dist/handlebars.min.js | 29 + .../handlebars/dist/handlebars.runtime.amd.js | 1302 + .../dist/handlebars.runtime.amd.min.js | 27 + .../handlebars/dist/handlebars.runtime.js | 2563 + .../handlebars/dist/handlebars.runtime.min.js | 27 + node_modules/handlebars/lib/.eslintrc.js | 8 + node_modules/handlebars/lib/handlebars.js | 46 + .../handlebars/lib/handlebars.runtime.js | 37 + .../handlebars/lib/handlebars/base.js | 94 + .../handlebars/lib/handlebars/compiler/ast.js | 32 + .../lib/handlebars/compiler/base.js | 34 + .../lib/handlebars/compiler/code-gen.js | 171 + .../lib/handlebars/compiler/compiler.js | 594 + .../lib/handlebars/compiler/helpers.js | 219 + .../compiler/javascript-compiler.js | 1293 + .../lib/handlebars/compiler/parser.js | 622 + .../lib/handlebars/compiler/printer.js | 178 + .../lib/handlebars/compiler/visitor.js | 136 + .../handlebars/compiler/whitespace-control.js | 234 + .../handlebars/lib/handlebars/decorators.js | 5 + .../lib/handlebars/decorators/inline.js | 22 + .../handlebars/lib/handlebars/exception.js | 68 + .../handlebars/lib/handlebars/helpers.js | 26 + .../helpers/block-helper-missing.js | 35 + .../handlebars/lib/handlebars/helpers/each.js | 101 + .../lib/handlebars/helpers/helper-missing.js | 15 + .../handlebars/lib/handlebars/helpers/if.js | 33 + .../handlebars/lib/handlebars/helpers/log.js | 19 + .../lib/handlebars/helpers/lookup.js | 9 + .../handlebars/lib/handlebars/helpers/with.js | 39 + .../internal/create-new-lookup-object.js | 11 + .../lib/handlebars/internal/proto-access.js | 70 + .../lib/handlebars/internal/wrapHelper.js | 13 + .../handlebars/lib/handlebars/logger.js | 39 + .../handlebars/lib/handlebars/no-conflict.js | 23 + .../handlebars/lib/handlebars/runtime.js | 450 + .../handlebars/lib/handlebars/safe-string.js | 10 + .../handlebars/lib/handlebars/utils.js | 116 + node_modules/handlebars/lib/index.js | 26 + node_modules/handlebars/lib/precompiler.js | 341 + node_modules/handlebars/package.json | 135 + node_modules/handlebars/release-notes.md | 1102 + node_modules/handlebars/runtime.d.ts | 5 + node_modules/handlebars/runtime.js | 3 + node_modules/handlebars/types/index.d.ts | 422 + node_modules/has-flag/index.d.ts | 39 + node_modules/has-flag/index.js | 8 + node_modules/has-flag/license | 9 + node_modules/has-flag/package.json | 46 + node_modules/has-flag/readme.md | 89 + .../has-property-descriptors/.eslintrc | 13 + .../.github/FUNDING.yml | 12 + node_modules/has-property-descriptors/.nycrc | 9 + .../has-property-descriptors/CHANGELOG.md | 35 + node_modules/has-property-descriptors/LICENSE | 21 + .../has-property-descriptors/README.md | 43 + .../has-property-descriptors/index.js | 22 + .../has-property-descriptors/package.json | 77 + .../has-property-descriptors/test/index.js | 57 + node_modules/has-proto/.eslintrc | 5 + node_modules/has-proto/.github/FUNDING.yml | 12 + node_modules/has-proto/CHANGELOG.md | 38 + node_modules/has-proto/LICENSE | 21 + node_modules/has-proto/README.md | 38 + node_modules/has-proto/index.d.ts | 3 + node_modules/has-proto/index.js | 15 + node_modules/has-proto/package.json | 78 + node_modules/has-proto/test/index.js | 19 + node_modules/has-proto/tsconfig.json | 49 + node_modules/has-symbols/.eslintrc | 11 + node_modules/has-symbols/.github/FUNDING.yml | 12 + node_modules/has-symbols/.nycrc | 9 + node_modules/has-symbols/CHANGELOG.md | 75 + node_modules/has-symbols/LICENSE | 21 + node_modules/has-symbols/README.md | 46 + node_modules/has-symbols/index.js | 13 + node_modules/has-symbols/package.json | 101 + node_modules/has-symbols/shams.js | 42 + node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + node_modules/has-symbols/test/tests.js | 56 + node_modules/has-tostringtag/.eslintrc | 5 + .../has-tostringtag/.github/FUNDING.yml | 12 + node_modules/has-tostringtag/.nycrc | 13 + node_modules/has-tostringtag/CHANGELOG.md | 42 + node_modules/has-tostringtag/LICENSE | 21 + node_modules/has-tostringtag/README.md | 46 + node_modules/has-tostringtag/index.d.ts | 3 + node_modules/has-tostringtag/index.js | 8 + node_modules/has-tostringtag/package.json | 108 + node_modules/has-tostringtag/shams.d.ts | 3 + node_modules/has-tostringtag/shams.js | 8 + node_modules/has-tostringtag/test/index.js | 21 + .../has-tostringtag/test/shams/core-js.js | 31 + .../test/shams/get-own-property-symbols.js | 30 + node_modules/has-tostringtag/test/tests.js | 15 + node_modules/has-tostringtag/tsconfig.json | 49 + node_modules/hasown/.eslintrc | 5 + node_modules/hasown/.github/FUNDING.yml | 12 + node_modules/hasown/.nycrc | 13 + node_modules/hasown/CHANGELOG.md | 40 + node_modules/hasown/LICENSE | 21 + node_modules/hasown/README.md | 40 + node_modules/hasown/index.d.ts | 3 + node_modules/hasown/index.js | 8 + node_modules/hasown/package.json | 92 + node_modules/hasown/tsconfig.json | 6 + node_modules/htmlparser2/LICENSE | 18 + node_modules/htmlparser2/README.md | 166 + node_modules/htmlparser2/lib/FeedHandler.d.ts | 23 + .../htmlparser2/lib/FeedHandler.d.ts.map | 1 + node_modules/htmlparser2/lib/FeedHandler.js | 68 + node_modules/htmlparser2/lib/Parser.d.ts | 180 + node_modules/htmlparser2/lib/Parser.d.ts.map | 1 + node_modules/htmlparser2/lib/Parser.js | 424 + node_modules/htmlparser2/lib/Tokenizer.d.ts | 173 + .../htmlparser2/lib/Tokenizer.d.ts.map | 1 + node_modules/htmlparser2/lib/Tokenizer.js | 821 + .../htmlparser2/lib/WritableStream.d.ts | 16 + .../htmlparser2/lib/WritableStream.d.ts.map | 1 + .../htmlparser2/lib/WritableStream.js | 53 + node_modules/htmlparser2/lib/index.d.ts | 39 + node_modules/htmlparser2/lib/index.d.ts.map | 1 + node_modules/htmlparser2/lib/index.js | 84 + node_modules/htmlparser2/package.json | 75 + node_modules/http-equiv-refresh/README.md | 29 + node_modules/http-equiv-refresh/index.js | 50 + node_modules/http-equiv-refresh/license | 21 + node_modules/http-equiv-refresh/package.json | 41 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 29 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 9 + node_modules/inherits/inherits_browser.js | 27 + node_modules/inherits/package.json | 29 + node_modules/is-alphabetical/index.js | 14 + node_modules/is-alphabetical/license | 22 + node_modules/is-alphabetical/package.json | 75 + node_modules/is-alphabetical/readme.md | 70 + node_modules/is-alphanumerical/index.js | 12 + node_modules/is-alphanumerical/license | 22 + node_modules/is-alphanumerical/package.json | 77 + node_modules/is-alphanumerical/readme.md | 71 + node_modules/is-binary-path/index.d.ts | 17 + node_modules/is-binary-path/index.js | 7 + node_modules/is-binary-path/license | 9 + node_modules/is-binary-path/package.json | 40 + node_modules/is-binary-path/readme.md | 34 + node_modules/is-core-module/.eslintrc | 18 + node_modules/is-core-module/.nycrc | 9 + node_modules/is-core-module/CHANGELOG.md | 189 + node_modules/is-core-module/LICENSE | 20 + node_modules/is-core-module/README.md | 40 + node_modules/is-core-module/core.json | 160 + node_modules/is-core-module/index.js | 69 + node_modules/is-core-module/package.json | 76 + node_modules/is-core-module/test/index.js | 133 + node_modules/is-decimal/index.js | 11 + node_modules/is-decimal/license | 22 + node_modules/is-decimal/package.json | 72 + node_modules/is-decimal/readme.md | 69 + node_modules/is-expression/CHANGELOG.md | 48 + node_modules/is-expression/LICENSE.md | 19 + node_modules/is-expression/README.md | 67 + node_modules/is-expression/index.js | 45 + node_modules/is-expression/package.json | 30 + node_modules/is-extendable/LICENSE | 21 + node_modules/is-extendable/README.md | 72 + node_modules/is-extendable/index.js | 13 + node_modules/is-extendable/package.json | 51 + node_modules/is-extglob/LICENSE | 21 + node_modules/is-extglob/README.md | 107 + node_modules/is-extglob/index.js | 20 + node_modules/is-extglob/package.json | 69 + .../is-fullwidth-code-point/index.d.ts | 17 + node_modules/is-fullwidth-code-point/index.js | 50 + node_modules/is-fullwidth-code-point/license | 9 + .../is-fullwidth-code-point/package.json | 42 + .../is-fullwidth-code-point/readme.md | 39 + node_modules/is-glob/LICENSE | 21 + node_modules/is-glob/README.md | 206 + node_modules/is-glob/index.js | 150 + node_modules/is-glob/package.json | 81 + node_modules/is-json/.npmignore | 12 + node_modules/is-json/.travis.yml | 14 + node_modules/is-json/LICENSE | 15 + node_modules/is-json/README.md | 41 + node_modules/is-json/index.js | 48 + node_modules/is-json/package.json | 29 + node_modules/is-json/test/index.js | 33 + node_modules/is-number/LICENSE | 21 + node_modules/is-number/README.md | 187 + node_modules/is-number/index.js | 18 + node_modules/is-number/package.json | 82 + node_modules/is-promise/LICENSE | 19 + node_modules/is-promise/index.js | 6 + node_modules/is-promise/index.mjs | 3 + node_modules/is-promise/package.json | 23 + node_modules/is-promise/readme.md | 33 + node_modules/is-regex/.editorconfig | 20 + node_modules/is-regex/.eslintignore | 1 + node_modules/is-regex/.eslintrc | 19 + node_modules/is-regex/.nycrc | 10 + node_modules/is-regex/CHANGELOG.md | 197 + node_modules/is-regex/LICENSE | 20 + node_modules/is-regex/README.md | 52 + node_modules/is-regex/index.js | 58 + node_modules/is-regex/package.json | 86 + node_modules/is-regex/test/index.js | 104 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 31 + node_modules/isexe/test/basic.js | 221 + node_modules/isexe/windows.js | 42 + node_modules/iso-639-1/.eslintrc | 38 + node_modules/iso-639-1/.nvmrc | 1 + node_modules/iso-639-1/.prettierrc | 4 + node_modules/iso-639-1/.travis.yml | 6 + node_modules/iso-639-1/.vscode/settings.json | 5 + node_modules/iso-639-1/CHANGELOG.md | 34 + node_modules/iso-639-1/LICENSE | 21 + node_modules/iso-639-1/build/index.js | 1643 + node_modules/iso-639-1/build/index.js.map | 1 + node_modules/iso-639-1/index.d.ts | 205 + node_modules/iso-639-1/package.json | 46 + node_modules/iso-639-1/readme.md | 121 + node_modules/iso-639-1/src/data.js | 736 + node_modules/iso-639-1/src/index.js | 47 + node_modules/iso-639-1/test/test.js | 92 + node_modules/iso-639-1/webpack.config.js | 41 + node_modules/jackspeak/LICENSE.md | 55 + node_modules/jackspeak/README.md | 357 + .../jackspeak/dist/commonjs/index.d.ts | 315 + .../jackspeak/dist/commonjs/index.d.ts.map | 1 + node_modules/jackspeak/dist/commonjs/index.js | 1010 + .../jackspeak/dist/commonjs/index.js.map | 1 + .../jackspeak/dist/commonjs/package.json | 3 + .../dist/commonjs/parse-args-cjs.cjs.map | 1 + .../dist/commonjs/parse-args-cjs.d.cts.map | 1 + .../jackspeak/dist/commonjs/parse-args.d.ts | 4 + .../jackspeak/dist/commonjs/parse-args.js | 50 + node_modules/jackspeak/dist/esm/index.d.ts | 315 + .../jackspeak/dist/esm/index.d.ts.map | 1 + node_modules/jackspeak/dist/esm/index.js | 1000 + node_modules/jackspeak/dist/esm/index.js.map | 1 + node_modules/jackspeak/dist/esm/package.json | 3 + .../jackspeak/dist/esm/parse-args.d.ts | 4 + .../jackspeak/dist/esm/parse-args.d.ts.map | 1 + node_modules/jackspeak/dist/esm/parse-args.js | 26 + .../jackspeak/dist/esm/parse-args.js.map | 1 + node_modules/jackspeak/package.json | 95 + node_modules/jake/Makefile | 44 + node_modules/jake/README.md | 17 + node_modules/jake/bin/bash_completion.sh | 41 + node_modules/jake/bin/cli.js | 31 + node_modules/jake/jakefile.js | 112 + node_modules/jake/lib/api.js | 409 + node_modules/jake/lib/jake.js | 330 + node_modules/jake/lib/loader.js | 173 + node_modules/jake/lib/namespace.js | 115 + node_modules/jake/lib/package_task.js | 406 + node_modules/jake/lib/parseargs.js | 134 + node_modules/jake/lib/program.js | 282 + node_modules/jake/lib/publish_task.js | 290 + node_modules/jake/lib/rule.js | 311 + node_modules/jake/lib/task/directory_task.js | 30 + node_modules/jake/lib/task/file_task.js | 126 + node_modules/jake/lib/task/index.js | 9 + node_modules/jake/lib/task/task.js | 458 + node_modules/jake/lib/test_task.js | 270 + node_modules/jake/lib/utils/file.js | 286 + node_modules/jake/lib/utils/index.js | 297 + node_modules/jake/lib/utils/logger.js | 24 + node_modules/jake/package.json | 42 + .../jake/test/integration/concurrent.js | 45 + node_modules/jake/test/integration/file.js | 228 + .../jake/test/integration/file_task.js | 141 + node_modules/jake/test/integration/helpers.js | 80 + .../jake/test/integration/jakefile.js | 352 + .../integration/jakelib/concurrent.jake.js | 113 + .../test/integration/jakelib/publish.jake.js | 49 + .../jakelib/required_module.jake.js | 10 + .../test/integration/jakelib/rule.jake.js | 222 + .../jake/test/integration/list_tasks.js | 15 + .../jake/test/integration/publish_task.js | 27 + node_modules/jake/test/integration/rule.js | 217 + node_modules/jake/test/integration/selfdep.js | 42 + .../jake/test/integration/task_base.js | 167 + node_modules/jake/test/unit/jakefile.js | 36 + node_modules/jake/test/unit/namespace.js | 77 + node_modules/jake/test/unit/parseargs.js | 169 + node_modules/jake/usage.txt | 17 + node_modules/jiti/LICENSE | 21 + node_modules/jiti/README.md | 164 + node_modules/jiti/bin/jiti.js | 16 + node_modules/jiti/dist/babel.d.ts | 2 + node_modules/jiti/dist/babel.js | 202 + node_modules/jiti/dist/jiti.d.ts | 22 + node_modules/jiti/dist/jiti.js | 1 + .../babel-plugin-transform-import-meta.d.ts | 4 + .../jiti/dist/plugins/import-meta-env.d.ts | 5 + node_modules/jiti/dist/types.d.ts | 35 + node_modules/jiti/dist/utils.d.ts | 8 + node_modules/jiti/lib/index.js | 15 + node_modules/jiti/package.json | 81 + node_modules/jiti/register.js | 3 + node_modules/js-stringify/.npmignore | 13 + node_modules/js-stringify/.travis.yml | 3 + node_modules/js-stringify/LICENSE | 19 + node_modules/js-stringify/README.md | 34 + node_modules/js-stringify/index.js | 17 + node_modules/js-stringify/package.json | 17 + node_modules/js-stringify/test/index.js | 17 + node_modules/js-yaml/CHANGELOG.md | 557 + node_modules/js-yaml/LICENSE | 21 + node_modules/js-yaml/README.md | 299 + node_modules/js-yaml/bin/js-yaml.js | 132 + node_modules/js-yaml/dist/js-yaml.js | 3989 + node_modules/js-yaml/dist/js-yaml.min.js | 1 + node_modules/js-yaml/index.js | 7 + node_modules/js-yaml/lib/js-yaml.js | 39 + node_modules/js-yaml/lib/js-yaml/common.js | 59 + node_modules/js-yaml/lib/js-yaml/dumper.js | 850 + node_modules/js-yaml/lib/js-yaml/exception.js | 43 + node_modules/js-yaml/lib/js-yaml/loader.js | 1644 + node_modules/js-yaml/lib/js-yaml/mark.js | 76 + node_modules/js-yaml/lib/js-yaml/schema.js | 108 + .../js-yaml/lib/js-yaml/schema/core.js | 18 + .../lib/js-yaml/schema/default_full.js | 25 + .../lib/js-yaml/schema/default_safe.js | 28 + .../js-yaml/lib/js-yaml/schema/failsafe.js | 17 + .../js-yaml/lib/js-yaml/schema/json.js | 25 + node_modules/js-yaml/lib/js-yaml/type.js | 61 + .../js-yaml/lib/js-yaml/type/binary.js | 138 + node_modules/js-yaml/lib/js-yaml/type/bool.js | 35 + .../js-yaml/lib/js-yaml/type/float.js | 116 + node_modules/js-yaml/lib/js-yaml/type/int.js | 173 + .../js-yaml/lib/js-yaml/type/js/function.js | 93 + .../js-yaml/lib/js-yaml/type/js/regexp.js | 60 + .../js-yaml/lib/js-yaml/type/js/undefined.js | 28 + node_modules/js-yaml/lib/js-yaml/type/map.js | 8 + .../js-yaml/lib/js-yaml/type/merge.js | 12 + node_modules/js-yaml/lib/js-yaml/type/null.js | 34 + node_modules/js-yaml/lib/js-yaml/type/omap.js | 44 + .../js-yaml/lib/js-yaml/type/pairs.js | 53 + node_modules/js-yaml/lib/js-yaml/type/seq.js | 8 + node_modules/js-yaml/lib/js-yaml/type/set.js | 29 + node_modules/js-yaml/lib/js-yaml/type/str.js | 8 + .../js-yaml/lib/js-yaml/type/timestamp.js | 88 + node_modules/js-yaml/package.json | 49 + node_modules/jstransformer/CHANGELOG.md | 38 + node_modules/jstransformer/LICENSE.md | 21 + node_modules/jstransformer/README.md | 114 + node_modules/jstransformer/index.js | 359 + node_modules/jstransformer/package.json | 31 + node_modules/junk/index.js | 30 + node_modules/junk/license | 21 + node_modules/junk/package.json | 37 + node_modules/junk/readme.md | 46 + node_modules/kind-of/CHANGELOG.md | 160 + node_modules/kind-of/LICENSE | 21 + node_modules/kind-of/README.md | 367 + node_modules/kind-of/index.js | 129 + node_modules/kind-of/package.json | 88 + node_modules/kleur/colors.d.ts | 38 + node_modules/kleur/colors.js | 53 + node_modules/kleur/colors.mjs | 53 + node_modules/kleur/index.d.ts | 45 + node_modules/kleur/index.js | 110 + node_modules/kleur/index.mjs | 110 + node_modules/kleur/license | 21 + node_modules/kleur/package.json | 51 + node_modules/kleur/readme.md | 232 + node_modules/lilconfig/LICENSE | 21 + node_modules/lilconfig/dist/index.d.ts | 38 + node_modules/lilconfig/dist/index.js | 251 + node_modules/lilconfig/package.json | 48 + node_modules/lilconfig/readme.md | 118 + node_modules/lines-and-columns/LICENSE | 21 + node_modules/lines-and-columns/README.md | 33 + .../lines-and-columns/build/index.d.ts | 13 + node_modules/lines-and-columns/build/index.js | 62 + node_modules/lines-and-columns/package.json | 49 + node_modules/linkify-it/LICENSE | 22 + node_modules/linkify-it/README.md | 195 + node_modules/linkify-it/index.js | 664 + node_modules/linkify-it/lib/re.js | 183 + node_modules/linkify-it/package.json | 47 + node_modules/liquidjs/LICENSE | 21 + node_modules/liquidjs/README.md | 220 + node_modules/liquidjs/bin/liquid.js | 139 + .../liquidjs/dist/build/fs-impl-browser.d.ts | 7 + .../dist/build/fs-impl-browser.spec.d.ts | 1 + .../dist/build/streamed-emitter-browser.d.ts | 10 + .../build/streamed-emitter-browser.spec.d.ts | 1 + node_modules/liquidjs/dist/cache/cache.d.ts | 7 + node_modules/liquidjs/dist/cache/index.d.ts | 2 + node_modules/liquidjs/dist/cache/lru.d.ts | 14 + .../liquidjs/dist/cache/lru.spec.d.ts | 1 + .../liquidjs/dist/context/block-mode.d.ts | 4 + .../liquidjs/dist/context/context.d.ts | 55 + .../liquidjs/dist/context/context.spec.d.ts | 1 + node_modules/liquidjs/dist/context/index.d.ts | 3 + node_modules/liquidjs/dist/context/scope.d.ts | 6 + .../liquidjs/dist/drop/blank-drop.d.ts | 4 + .../liquidjs/dist/drop/block-drop.d.ts | 10 + .../liquidjs/dist/drop/comparable.d.ts | 8 + node_modules/liquidjs/dist/drop/drop.d.ts | 3 + .../liquidjs/dist/drop/empty-drop.d.ts | 10 + .../liquidjs/dist/drop/forloop-drop.d.ts | 15 + node_modules/liquidjs/dist/drop/index.d.ts | 7 + .../liquidjs/dist/drop/null-drop.d.ts | 10 + .../liquidjs/dist/drop/tablerowloop-drop.d.ts | 10 + .../liquidjs/dist/emitters/emitter.d.ts | 11 + .../liquidjs/dist/emitters/index.d.ts | 4 + .../dist/emitters/keeping-type-emitter.d.ts | 5 + .../dist/emitters/simple-emitter.d.ts | 5 + .../dist/emitters/streamed-emitter.d.ts | 9 + node_modules/liquidjs/dist/filters/array.d.ts | 26 + node_modules/liquidjs/dist/filters/date.d.ts | 6 + node_modules/liquidjs/dist/filters/html.d.ts | 5 + node_modules/liquidjs/dist/filters/index.d.ts | 2 + node_modules/liquidjs/dist/filters/math.d.ts | 11 + node_modules/liquidjs/dist/filters/misc.d.ts | 18 + .../liquidjs/dist/filters/string.d.ts | 26 + node_modules/liquidjs/dist/filters/url.d.ts | 14 + node_modules/liquidjs/dist/fs/fs-impl.d.ts | 9 + .../liquidjs/dist/fs/fs-impl.spec.d.ts | 1 + node_modules/liquidjs/dist/fs/fs.d.ts | 20 + node_modules/liquidjs/dist/fs/index.d.ts | 2 + node_modules/liquidjs/dist/fs/loader.d.ts | 24 + .../liquidjs/dist/fs/loader.spec.d.ts | 1 + .../liquidjs/dist/fs/node-require.d.ts | 2 + node_modules/liquidjs/dist/index.d.ts | 15 + .../liquidjs/dist/liquid-options.d.ts | 133 + .../liquidjs/dist/liquid-options.spec.d.ts | 1 + .../liquidjs/dist/liquid.browser.esm.js | 4037 + .../liquidjs/dist/liquid.browser.min.js | 2 + .../liquidjs/dist/liquid.browser.min.js.map | 1 + .../liquidjs/dist/liquid.browser.umd.js | 5618 + .../liquidjs/dist/liquid.browser.umd.js.map | 1 + node_modules/liquidjs/dist/liquid.d.ts | 39 + node_modules/liquidjs/dist/liquid.node.cjs.js | 4084 + node_modules/liquidjs/dist/liquid.node.esm.js | 4046 + .../liquidjs/dist/parser/filter-arg.d.ts | 5 + node_modules/liquidjs/dist/parser/index.d.ts | 4 + .../liquidjs/dist/parser/parse-stream.d.ts | 15 + .../dist/parser/parse-stream.spec.d.ts | 1 + node_modules/liquidjs/dist/parser/parser.d.ts | 19 + .../liquidjs/dist/parser/token-kind.d.ts | 16 + .../liquidjs/dist/parser/tokenizer.d.ts | 62 + .../liquidjs/dist/parser/tokenizer.spec.d.ts | 1 + .../liquidjs/dist/parser/whitespace-ctrl.d.ts | 3 + .../liquidjs/dist/render/boolean.d.ts | 3 + .../liquidjs/dist/render/boolean.spec.d.ts | 1 + .../liquidjs/dist/render/expression.d.ts | 10 + .../liquidjs/dist/render/expression.spec.d.ts | 1 + node_modules/liquidjs/dist/render/index.d.ts | 4 + .../liquidjs/dist/render/operator.d.ts | 7 + node_modules/liquidjs/dist/render/render.d.ts | 8 + .../liquidjs/dist/render/render.spec.d.ts | 1 + node_modules/liquidjs/dist/render/string.d.ts | 1 + .../liquidjs/dist/render/string.spec.d.ts | 1 + node_modules/liquidjs/dist/tags/assign.d.ts | 7 + node_modules/liquidjs/dist/tags/block.d.ts | 8 + node_modules/liquidjs/dist/tags/break.d.ts | 4 + node_modules/liquidjs/dist/tags/capture.d.ts | 8 + node_modules/liquidjs/dist/tags/case.d.ts | 11 + node_modules/liquidjs/dist/tags/comment.d.ts | 5 + node_modules/liquidjs/dist/tags/continue.d.ts | 4 + node_modules/liquidjs/dist/tags/cycle.d.ts | 7 + .../liquidjs/dist/tags/decrement.d.ts | 6 + node_modules/liquidjs/dist/tags/echo.d.ts | 6 + node_modules/liquidjs/dist/tags/for.d.ts | 10 + node_modules/liquidjs/dist/tags/if.d.ts | 10 + node_modules/liquidjs/dist/tags/include.d.ts | 7 + .../liquidjs/dist/tags/increment.d.ts | 6 + node_modules/liquidjs/dist/tags/index.d.ts | 24 + .../liquidjs/dist/tags/inline-comment.d.ts | 5 + node_modules/liquidjs/dist/tags/layout.d.ts | 9 + node_modules/liquidjs/dist/tags/liquid.d.ts | 6 + node_modules/liquidjs/dist/tags/raw.d.ts | 6 + node_modules/liquidjs/dist/tags/render.d.ts | 17 + node_modules/liquidjs/dist/tags/tablerow.d.ts | 9 + node_modules/liquidjs/dist/tags/unless.d.ts | 11 + .../dist/template/filter-impl-options.d.ts | 12 + .../liquidjs/dist/template/filter.d.ts | 13 + .../liquidjs/dist/template/filter.spec.d.ts | 1 + node_modules/liquidjs/dist/template/hash.d.ts | 17 + .../liquidjs/dist/template/hash.spec.d.ts | 1 + node_modules/liquidjs/dist/template/html.d.ts | 9 + .../liquidjs/dist/template/index.d.ts | 10 + .../liquidjs/dist/template/output.d.ts | 11 + .../liquidjs/dist/template/output.spec.d.ts | 1 + .../dist/template/tag-options-adapter.d.ts | 10 + node_modules/liquidjs/dist/template/tag.d.ts | 18 + .../liquidjs/dist/template/template-impl.d.ts | 4 + .../liquidjs/dist/template/template.d.ts | 7 + .../liquidjs/dist/template/value.d.ts | 15 + .../liquidjs/dist/template/value.spec.d.ts | 1 + .../liquidjs/dist/tokens/delimited-token.d.ts | 9 + .../liquidjs/dist/tokens/filter-token.d.ts | 7 + .../dist/tokens/filtered-value-token.d.ts | 17 + .../liquidjs/dist/tokens/hash-token.d.ts | 12 + .../liquidjs/dist/tokens/html-token.d.ts | 11 + .../dist/tokens/identifier-token.d.ts | 10 + node_modules/liquidjs/dist/tokens/index.d.ts | 18 + .../dist/tokens/liquid-tag-token.d.ts | 12 + .../liquidjs/dist/tokens/literal-token.d.ts | 11 + .../liquidjs/dist/tokens/number-token.d.ts | 9 + .../liquidjs/dist/tokens/operator-token.d.ts | 38 + .../liquidjs/dist/tokens/output-token.d.ts | 5 + .../dist/tokens/property-access-token.d.ts | 12 + .../liquidjs/dist/tokens/quoted-token.d.ts | 9 + .../liquidjs/dist/tokens/range-token.d.ts | 11 + .../liquidjs/dist/tokens/tag-token.d.ts | 9 + node_modules/liquidjs/dist/tokens/token.d.ts | 12 + .../liquidjs/dist/tokens/top-level-token.d.ts | 4 + .../liquidjs/dist/tokens/value-token.d.ts | 6 + node_modules/liquidjs/dist/util/assert.d.ts | 1 + .../liquidjs/dist/util/assert.spec.d.ts | 1 + node_modules/liquidjs/dist/util/async.d.ts | 2 + .../liquidjs/dist/util/async.spec.d.ts | 1 + .../liquidjs/dist/util/character.d.ts | 10 + node_modules/liquidjs/dist/util/error.d.ts | 35 + node_modules/liquidjs/dist/util/index.d.ts | 11 + .../liquidjs/dist/util/liquid-date.d.ts | 20 + node_modules/liquidjs/dist/util/literal.d.ts | 11 + .../liquidjs/dist/util/operator-trie.d.ts | 14 + node_modules/liquidjs/dist/util/strftime.d.ts | 2 + .../liquidjs/dist/util/strftime.spec.d.ts | 1 + .../liquidjs/dist/util/timezone-date.d.ts | 44 + .../dist/util/timezone-date.spec.d.ts | 1 + .../liquidjs/dist/util/type-guards.d.ts | 12 + .../liquidjs/dist/util/underscore.d.ts | 35 + .../liquidjs/dist/util/underscore.spec.d.ts | 1 + node_modules/liquidjs/package.json | 161 + node_modules/list-to-array/.npmignore | 27 + node_modules/list-to-array/LICENSE | 22 + node_modules/list-to-array/README.md | 52 + node_modules/list-to-array/index.js | 18 + node_modules/list-to-array/package.json | 32 + node_modules/list-to-array/tests.js | 29 + node_modules/lodash.deburr/LICENSE | 47 + node_modules/lodash.deburr/README.md | 18 + node_modules/lodash.deburr/index.js | 257 + node_modules/lodash.deburr/package.json | 17 + node_modules/lru-cache/LICENSE | 15 + node_modules/lru-cache/README.md | 331 + .../lru-cache/dist/commonjs/index.d.ts | 1277 + .../lru-cache/dist/commonjs/index.d.ts.map | 1 + node_modules/lru-cache/dist/commonjs/index.js | 1546 + .../lru-cache/dist/commonjs/index.js.map | 1 + .../lru-cache/dist/commonjs/index.min.js | 2 + .../lru-cache/dist/commonjs/index.min.js.map | 7 + .../lru-cache/dist/commonjs/package.json | 3 + node_modules/lru-cache/dist/esm/index.d.ts | 1277 + .../lru-cache/dist/esm/index.d.ts.map | 1 + node_modules/lru-cache/dist/esm/index.js | 1542 + node_modules/lru-cache/dist/esm/index.js.map | 1 + node_modules/lru-cache/dist/esm/index.min.js | 2 + .../lru-cache/dist/esm/index.min.js.map | 7 + node_modules/lru-cache/dist/esm/package.json | 3 + node_modules/lru-cache/package.json | 118 + node_modules/luxon/LICENSE.md | 7 + node_modules/luxon/README.md | 55 + node_modules/luxon/build/amd/luxon.js | 8311 ++ node_modules/luxon/build/amd/luxon.js.map | 1 + node_modules/luxon/build/cjs-browser/luxon.js | 8309 ++ .../luxon/build/cjs-browser/luxon.js.map | 1 + node_modules/luxon/build/es6/luxon.js | 7695 ++ node_modules/luxon/build/es6/luxon.js.map | 1 + node_modules/luxon/build/global/luxon.js | 8314 ++ node_modules/luxon/build/global/luxon.js.map | 1 + node_modules/luxon/build/global/luxon.min.js | 1 + .../luxon/build/global/luxon.min.js.map | 1 + node_modules/luxon/build/node/luxon.js | 7384 ++ node_modules/luxon/build/node/luxon.js.map | 1 + node_modules/luxon/package.json | 87 + node_modules/luxon/src/datetime.js | 2422 + node_modules/luxon/src/duration.js | 990 + node_modules/luxon/src/errors.js | 61 + node_modules/luxon/src/impl/conversions.js | 206 + node_modules/luxon/src/impl/diff.js | 95 + node_modules/luxon/src/impl/digits.js | 75 + node_modules/luxon/src/impl/english.js | 233 + node_modules/luxon/src/impl/formats.js | 176 + node_modules/luxon/src/impl/formatter.js | 409 + node_modules/luxon/src/impl/invalid.js | 14 + node_modules/luxon/src/impl/locale.js | 542 + node_modules/luxon/src/impl/regexParser.js | 335 + node_modules/luxon/src/impl/tokenParser.js | 473 + node_modules/luxon/src/impl/util.js | 309 + node_modules/luxon/src/impl/zoneUtil.js | 34 + node_modules/luxon/src/info.js | 205 + node_modules/luxon/src/interval.js | 657 + node_modules/luxon/src/luxon.js | 26 + node_modules/luxon/src/package.json | 4 + node_modules/luxon/src/settings.js | 175 + node_modules/luxon/src/zone.js | 91 + node_modules/luxon/src/zones/IANAZone.js | 189 + .../luxon/src/zones/fixedOffsetZone.js | 102 + node_modules/luxon/src/zones/invalidZone.js | 53 + node_modules/luxon/src/zones/systemZone.js | 61 + node_modules/markdown-it/LICENSE | 22 + node_modules/markdown-it/README.md | 309 + node_modules/markdown-it/bin/markdown-it.js | 117 + node_modules/markdown-it/dist/markdown-it.js | 8441 ++ .../markdown-it/dist/markdown-it.min.js | 3 + node_modules/markdown-it/index.js | 4 + .../markdown-it/lib/common/entities.js | 6 + .../markdown-it/lib/common/html_blocks.js | 70 + .../markdown-it/lib/common/html_re.js | 28 + node_modules/markdown-it/lib/common/utils.js | 317 + node_modules/markdown-it/lib/helpers/index.js | 7 + .../lib/helpers/parse_link_destination.js | 80 + .../lib/helpers/parse_link_label.js | 48 + .../lib/helpers/parse_link_title.js | 55 + node_modules/markdown-it/lib/index.js | 582 + node_modules/markdown-it/lib/parser_block.js | 131 + node_modules/markdown-it/lib/parser_core.js | 61 + node_modules/markdown-it/lib/parser_inline.js | 192 + .../markdown-it/lib/presets/commonmark.js | 81 + .../markdown-it/lib/presets/default.js | 41 + node_modules/markdown-it/lib/presets/zero.js | 63 + node_modules/markdown-it/lib/renderer.js | 341 + node_modules/markdown-it/lib/ruler.js | 352 + .../markdown-it/lib/rules_block/blockquote.js | 226 + .../markdown-it/lib/rules_block/code.js | 34 + .../markdown-it/lib/rules_block/fence.js | 98 + .../markdown-it/lib/rules_block/heading.js | 55 + .../markdown-it/lib/rules_block/hr.js | 45 + .../markdown-it/lib/rules_block/html_block.js | 74 + .../markdown-it/lib/rules_block/lheading.js | 83 + .../markdown-it/lib/rules_block/list.js | 362 + .../markdown-it/lib/rules_block/paragraph.js | 51 + .../markdown-it/lib/rules_block/reference.js | 198 + .../lib/rules_block/state_block.js | 231 + .../markdown-it/lib/rules_block/table.js | 221 + .../markdown-it/lib/rules_core/block.js | 16 + .../markdown-it/lib/rules_core/inline.js | 13 + .../markdown-it/lib/rules_core/linkify.js | 142 + .../markdown-it/lib/rules_core/normalize.js | 21 + .../lib/rules_core/replacements.js | 105 + .../markdown-it/lib/rules_core/smartquotes.js | 201 + .../markdown-it/lib/rules_core/state_core.js | 20 + .../markdown-it/lib/rules_core/text_join.js | 45 + .../markdown-it/lib/rules_inline/autolink.js | 76 + .../markdown-it/lib/rules_inline/backticks.js | 63 + .../lib/rules_inline/balance_pairs.js | 130 + .../markdown-it/lib/rules_inline/emphasis.js | 130 + .../markdown-it/lib/rules_inline/entity.js | 55 + .../markdown-it/lib/rules_inline/escape.js | 71 + .../lib/rules_inline/fragments_join.js | 41 + .../lib/rules_inline/html_inline.js | 58 + .../markdown-it/lib/rules_inline/image.js | 152 + .../markdown-it/lib/rules_inline/link.js | 150 + .../markdown-it/lib/rules_inline/linkify.js | 62 + .../markdown-it/lib/rules_inline/newline.js | 46 + .../lib/rules_inline/state_inline.js | 158 + .../lib/rules_inline/strikethrough.js | 130 + .../markdown-it/lib/rules_inline/text.js | 89 + node_modules/markdown-it/lib/token.js | 201 + .../node_modules/argparse/CHANGELOG.md | 216 + .../markdown-it/node_modules/argparse/LICENSE | 254 + .../node_modules/argparse/README.md | 84 + .../node_modules/argparse/argparse.js | 3707 + .../node_modules/argparse/lib/sub.js | 67 + .../node_modules/argparse/lib/textwrap.js | 440 + .../node_modules/argparse/package.json | 31 + node_modules/markdown-it/package.json | 87 + node_modules/maximatch/index.js | 39 + node_modules/maximatch/license | 21 + .../node_modules/array-differ/index.js | 7 + .../node_modules/array-differ/package.json | 32 + .../node_modules/array-differ/readme.md | 41 + .../node_modules/array-union/index.js | 6 + .../node_modules/array-union/license | 21 + .../node_modules/array-union/package.json | 40 + .../node_modules/array-union/readme.md | 28 + .../maximatch/node_modules/arrify/index.js | 8 + .../maximatch/node_modules/arrify/license | 21 + .../node_modules/arrify/package.json | 33 + .../maximatch/node_modules/arrify/readme.md | 36 + node_modules/maximatch/package.json | 44 + node_modules/maximatch/readme.md | 71 + node_modules/mdurl/CHANGELOG.md | 16 + node_modules/mdurl/LICENSE | 45 + node_modules/mdurl/README.md | 102 + node_modules/mdurl/decode.js | 122 + node_modules/mdurl/encode.js | 98 + node_modules/mdurl/format.js | 25 + node_modules/mdurl/index.js | 7 + node_modules/mdurl/package.json | 16 + node_modules/mdurl/parse.js | 312 + node_modules/merge2/LICENSE | 21 + node_modules/merge2/README.md | 144 + node_modules/merge2/index.js | 144 + node_modules/merge2/package.json | 43 + node_modules/micromatch/LICENSE | 21 + node_modules/micromatch/README.md | 1017 + node_modules/micromatch/index.js | 467 + node_modules/micromatch/package.json | 101 + node_modules/mime/CHANGELOG.md | 312 + node_modules/mime/LICENSE | 21 + node_modules/mime/Mime.js | 97 + node_modules/mime/README.md | 178 + node_modules/mime/cli.js | 46 + node_modules/mime/index.js | 4 + node_modules/mime/lite.js | 4 + node_modules/mime/package.json | 52 + node_modules/mime/types/other.js | 1 + node_modules/mime/types/standard.js | 1 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 230 + node_modules/minimatch/minimatch.js | 947 + .../node_modules/brace-expansion/LICENSE | 21 + .../node_modules/brace-expansion/README.md | 129 + .../node_modules/brace-expansion/index.js | 201 + .../node_modules/brace-expansion/package.json | 47 + node_modules/minimatch/package.json | 33 + node_modules/minimist/.eslintrc | 29 + node_modules/minimist/.github/FUNDING.yml | 12 + node_modules/minimist/.nycrc | 14 + node_modules/minimist/CHANGELOG.md | 298 + node_modules/minimist/LICENSE | 18 + node_modules/minimist/README.md | 121 + node_modules/minimist/example/parse.js | 4 + node_modules/minimist/index.js | 263 + node_modules/minimist/package.json | 75 + node_modules/minimist/test/all_bool.js | 34 + node_modules/minimist/test/bool.js | 177 + node_modules/minimist/test/dash.js | 43 + node_modules/minimist/test/default_bool.js | 37 + node_modules/minimist/test/dotted.js | 24 + node_modules/minimist/test/kv_short.js | 32 + node_modules/minimist/test/long.js | 33 + node_modules/minimist/test/num.js | 38 + node_modules/minimist/test/parse.js | 209 + node_modules/minimist/test/parse_modified.js | 11 + node_modules/minimist/test/proto.js | 64 + node_modules/minimist/test/short.js | 69 + node_modules/minimist/test/stop_early.js | 17 + node_modules/minimist/test/unknown.js | 104 + node_modules/minimist/test/whitespace.js | 10 + node_modules/minipass/LICENSE | 15 + node_modules/minipass/README.md | 825 + .../minipass/dist/commonjs/index.d.ts | 549 + .../minipass/dist/commonjs/index.d.ts.map | 1 + node_modules/minipass/dist/commonjs/index.js | 1028 + .../minipass/dist/commonjs/index.js.map | 1 + .../minipass/dist/commonjs/package.json | 3 + node_modules/minipass/dist/esm/index.d.ts | 549 + node_modules/minipass/dist/esm/index.d.ts.map | 1 + node_modules/minipass/dist/esm/index.js | 1018 + node_modules/minipass/dist/esm/index.js.map | 1 + node_modules/minipass/dist/esm/package.json | 3 + node_modules/minipass/package.json | 82 + node_modules/mkdirp/LICENSE | 21 + node_modules/mkdirp/bin/cmd.js | 33 + node_modules/mkdirp/bin/usage.txt | 12 + node_modules/mkdirp/index.js | 102 + node_modules/mkdirp/package.json | 33 + node_modules/mkdirp/readme.markdown | 100 + node_modules/moo/LICENSE | 29 + node_modules/moo/README.md | 383 + node_modules/moo/moo.js | 642 + node_modules/moo/package.json | 29 + node_modules/morphdom/CHANGELOG.md | 240 + node_modules/morphdom/LICENSE | 21 + node_modules/morphdom/README.md | 260 + node_modules/morphdom/dist/morphdom-esm.js | 764 + .../morphdom/dist/morphdom-factory.js | 700 + node_modules/morphdom/dist/morphdom-umd.js | 772 + .../morphdom/dist/morphdom-umd.min.js | 1 + node_modules/morphdom/dist/morphdom.js | 766 + node_modules/morphdom/docs/old-benchmark.md | 204 + node_modules/morphdom/docs/virtual-dom.md | 38 + node_modules/morphdom/factory.js | 1 + node_modules/morphdom/index.d.ts | 19 + node_modules/morphdom/package.json | 63 + node_modules/morphdom/src/index.js | 6 + node_modules/morphdom/src/morphAttrs.js | 63 + node_modules/morphdom/src/morphdom.js | 477 + .../morphdom/src/specialElHandlers.js | 110 + node_modules/morphdom/src/util.js | 113 + node_modules/ms/index.js | 152 + node_modules/ms/license.md | 21 + node_modules/ms/package.json | 37 + node_modules/ms/readme.md | 51 + node_modules/multimatch/index.d.ts | 28 + node_modules/multimatch/index.js | 30 + node_modules/multimatch/license | 9 + node_modules/multimatch/package.json | 48 + node_modules/multimatch/readme.md | 80 + node_modules/mustache/CHANGELOG.md | 618 + node_modules/mustache/LICENSE | 11 + node_modules/mustache/README.md | 621 + node_modules/mustache/bin/mustache | 150 + node_modules/mustache/mustache.js | 772 + node_modules/mustache/mustache.min.js | 1 + node_modules/mustache/mustache.mjs | 764 + node_modules/mustache/package.json | 67 + .../mustache/wrappers/dojo/mustache.js.post | 4 + .../mustache/wrappers/dojo/mustache.js.pre | 9 + .../mustache/wrappers/jquery/mustache.js.post | 13 + .../mustache/wrappers/jquery/mustache.js.pre | 9 + .../wrappers/mootools/mustache.js.post | 5 + .../wrappers/mootools/mustache.js.pre | 2 + .../wrappers/qooxdoo/mustache.js.post | 9 + .../mustache/wrappers/qooxdoo/mustache.js.pre | 172 + .../mustache/wrappers/yui3/mustache.js.post | 4 + .../mustache/wrappers/yui3/mustache.js.pre | 1 + node_modules/mz/HISTORY.md | 66 + node_modules/mz/LICENSE | 22 + node_modules/mz/README.md | 106 + node_modules/mz/child_process.js | 8 + node_modules/mz/crypto.js | 9 + node_modules/mz/dns.js | 16 + node_modules/mz/fs.js | 62 + node_modules/mz/index.js | 8 + node_modules/mz/package.json | 44 + node_modules/mz/readline.js | 64 + node_modules/mz/zlib.js | 13 + node_modules/nanoid/LICENSE | 20 + node_modules/nanoid/README.md | 39 + node_modules/nanoid/async/index.browser.cjs | 34 + node_modules/nanoid/async/index.browser.js | 34 + node_modules/nanoid/async/index.cjs | 35 + node_modules/nanoid/async/index.d.ts | 56 + node_modules/nanoid/async/index.js | 35 + node_modules/nanoid/async/index.native.js | 26 + node_modules/nanoid/async/package.json | 12 + node_modules/nanoid/bin/nanoid.cjs | 55 + node_modules/nanoid/index.browser.cjs | 34 + node_modules/nanoid/index.browser.js | 34 + node_modules/nanoid/index.cjs | 45 + node_modules/nanoid/index.d.cts | 91 + node_modules/nanoid/index.d.ts | 91 + node_modules/nanoid/index.js | 45 + node_modules/nanoid/nanoid.js | 1 + node_modules/nanoid/non-secure/index.cjs | 21 + node_modules/nanoid/non-secure/index.d.ts | 33 + node_modules/nanoid/non-secure/index.js | 21 + node_modules/nanoid/non-secure/package.json | 6 + node_modules/nanoid/package.json | 88 + node_modules/nanoid/url-alphabet/index.cjs | 3 + node_modules/nanoid/url-alphabet/index.js | 3 + node_modules/nanoid/url-alphabet/package.json | 6 + node_modules/neo-async/LICENSE | 22 + node_modules/neo-async/README.md | 273 + node_modules/neo-async/all.js | 3 + node_modules/neo-async/allLimit.js | 3 + node_modules/neo-async/allSeries.js | 3 + node_modules/neo-async/angelFall.js | 3 + node_modules/neo-async/any.js | 3 + node_modules/neo-async/anyLimit.js | 3 + node_modules/neo-async/anySeries.js | 3 + node_modules/neo-async/apply.js | 3 + node_modules/neo-async/applyEach.js | 3 + node_modules/neo-async/applyEachSeries.js | 3 + node_modules/neo-async/async.js | 9184 ++ node_modules/neo-async/async.min.js | 80 + node_modules/neo-async/asyncify.js | 3 + node_modules/neo-async/auto.js | 3 + node_modules/neo-async/autoInject.js | 3 + node_modules/neo-async/cargo.js | 3 + node_modules/neo-async/compose.js | 3 + node_modules/neo-async/concat.js | 3 + node_modules/neo-async/concatLimit.js | 3 + node_modules/neo-async/concatSeries.js | 3 + node_modules/neo-async/constant.js | 3 + node_modules/neo-async/createLogger.js | 3 + node_modules/neo-async/detect.js | 3 + node_modules/neo-async/detectLimit.js | 3 + node_modules/neo-async/detectSeries.js | 3 + node_modules/neo-async/dir.js | 3 + node_modules/neo-async/doDuring.js | 3 + node_modules/neo-async/doUntil.js | 3 + node_modules/neo-async/doWhilst.js | 3 + node_modules/neo-async/during.js | 3 + node_modules/neo-async/each.js | 3 + node_modules/neo-async/eachLimit.js | 3 + node_modules/neo-async/eachOf.js | 3 + node_modules/neo-async/eachOfLimit.js | 3 + node_modules/neo-async/eachOfSeries.js | 3 + node_modules/neo-async/eachSeries.js | 3 + node_modules/neo-async/ensureAsync.js | 3 + node_modules/neo-async/every.js | 3 + node_modules/neo-async/everyLimit.js | 3 + node_modules/neo-async/everySeries.js | 3 + node_modules/neo-async/fast.js | 3 + node_modules/neo-async/filter.js | 3 + node_modules/neo-async/filterLimit.js | 3 + node_modules/neo-async/filterSeries.js | 3 + node_modules/neo-async/find.js | 3 + node_modules/neo-async/findLimit.js | 3 + node_modules/neo-async/findSeries.js | 3 + node_modules/neo-async/foldl.js | 3 + node_modules/neo-async/foldr.js | 3 + node_modules/neo-async/forEach.js | 3 + node_modules/neo-async/forEachLimit.js | 3 + node_modules/neo-async/forEachOf.js | 3 + node_modules/neo-async/forEachOfLimit.js | 3 + node_modules/neo-async/forEachOfSeries.js | 3 + node_modules/neo-async/forEachSeries.js | 3 + node_modules/neo-async/forever.js | 3 + node_modules/neo-async/groupBy.js | 3 + node_modules/neo-async/groupByLimit.js | 3 + node_modules/neo-async/groupBySeries.js | 3 + node_modules/neo-async/inject.js | 3 + node_modules/neo-async/iterator.js | 3 + node_modules/neo-async/log.js | 3 + node_modules/neo-async/map.js | 3 + node_modules/neo-async/mapLimit.js | 3 + node_modules/neo-async/mapSeries.js | 3 + node_modules/neo-async/mapValues.js | 3 + node_modules/neo-async/mapValuesLimit.js | 3 + node_modules/neo-async/mapValuesSeries.js | 3 + node_modules/neo-async/memoize.js | 3 + node_modules/neo-async/nextTick.js | 3 + node_modules/neo-async/omit.js | 3 + node_modules/neo-async/omitLimit.js | 3 + node_modules/neo-async/omitSeries.js | 3 + node_modules/neo-async/package.json | 57 + node_modules/neo-async/parallel.js | 3 + node_modules/neo-async/parallelLimit.js | 3 + node_modules/neo-async/pick.js | 3 + node_modules/neo-async/pickLimit.js | 3 + node_modules/neo-async/pickSeries.js | 3 + node_modules/neo-async/priorityQueue.js | 3 + node_modules/neo-async/queue.js | 3 + node_modules/neo-async/race.js | 3 + node_modules/neo-async/reduce.js | 3 + node_modules/neo-async/reduceRight.js | 3 + node_modules/neo-async/reflect.js | 3 + node_modules/neo-async/reflectAll.js | 3 + node_modules/neo-async/reject.js | 3 + node_modules/neo-async/rejectLimit.js | 3 + node_modules/neo-async/rejectSeries.js | 3 + node_modules/neo-async/retry.js | 3 + node_modules/neo-async/retryable.js | 3 + node_modules/neo-async/safe.js | 3 + node_modules/neo-async/select.js | 3 + node_modules/neo-async/selectLimit.js | 3 + node_modules/neo-async/selectSeries.js | 3 + node_modules/neo-async/seq.js | 3 + node_modules/neo-async/series.js | 3 + node_modules/neo-async/setImmediate.js | 3 + node_modules/neo-async/some.js | 3 + node_modules/neo-async/someLimit.js | 3 + node_modules/neo-async/someSeries.js | 3 + node_modules/neo-async/sortBy.js | 3 + node_modules/neo-async/sortByLimit.js | 3 + node_modules/neo-async/sortBySeries.js | 3 + node_modules/neo-async/timeout.js | 3 + node_modules/neo-async/times.js | 3 + node_modules/neo-async/timesLimit.js | 3 + node_modules/neo-async/timesSeries.js | 3 + node_modules/neo-async/transform.js | 3 + node_modules/neo-async/transformLimit.js | 3 + node_modules/neo-async/transformSeries.js | 3 + node_modules/neo-async/tryEach.js | 3 + node_modules/neo-async/unmemoize.js | 3 + node_modules/neo-async/until.js | 3 + node_modules/neo-async/waterfall.js | 3 + node_modules/neo-async/whilst.js | 3 + node_modules/neo-async/wrapSync.js | 3 + node_modules/normalize-path/LICENSE | 21 + node_modules/normalize-path/README.md | 127 + node_modules/normalize-path/index.js | 35 + node_modules/normalize-path/package.json | 77 + node_modules/nunjucks/LICENSE | 26 + node_modules/nunjucks/README.md | 58 + node_modules/nunjucks/bin/precompile | 58 + node_modules/nunjucks/bin/precompile.cmd | 5 + .../nunjucks/browser/nunjucks-slim.js | 3709 + .../nunjucks/browser/nunjucks-slim.js.map | 1 + .../nunjucks/browser/nunjucks-slim.min.js | 3 + .../nunjucks/browser/nunjucks-slim.min.js.map | 1 + node_modules/nunjucks/browser/nunjucks.js | 7021 ++ node_modules/nunjucks/browser/nunjucks.js.map | 1 + node_modules/nunjucks/browser/nunjucks.min.js | 3 + .../nunjucks/browser/nunjucks.min.js.map | 1 + node_modules/nunjucks/index.js | 82 + .../node_modules/commander/CHANGELOG.md | 385 + .../nunjucks/node_modules/commander/LICENSE | 22 + .../nunjucks/node_modules/commander/Readme.md | 737 + .../nunjucks/node_modules/commander/index.js | 1756 + .../node_modules/commander/package.json | 48 + .../node_modules/commander/typings/index.d.ts | 386 + node_modules/nunjucks/package.json | 112 + node_modules/nunjucks/src/compiler.js | 1027 + node_modules/nunjucks/src/environment.js | 548 + node_modules/nunjucks/src/express-app.js | 23 + node_modules/nunjucks/src/filters.js | 546 + node_modules/nunjucks/src/globals.js | 65 + node_modules/nunjucks/src/jinja-compat.js | 293 + node_modules/nunjucks/src/lexer.js | 474 + node_modules/nunjucks/src/lib.js | 325 + node_modules/nunjucks/src/loader.js | 21 + node_modules/nunjucks/src/loaders.js | 5 + node_modules/nunjucks/src/node-loaders.js | 139 + node_modules/nunjucks/src/nodes.js | 350 + node_modules/nunjucks/src/object.js | 100 + node_modules/nunjucks/src/parser.js | 1028 + .../nunjucks/src/precompile-global.js | 17 + node_modules/nunjucks/src/precompile.js | 108 + .../nunjucks/src/precompiled-loader.js | 31 + node_modules/nunjucks/src/runtime.js | 333 + node_modules/nunjucks/src/tests.js | 265 + node_modules/nunjucks/src/transformer.js | 166 + node_modules/nunjucks/src/web-loaders.js | 94 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 42 + node_modules/object-assign/readme.md | 61 + node_modules/object-hash/LICENSE | 22 + node_modules/object-hash/dist/object_hash.js | 1 + node_modules/object-hash/index.js | 453 + node_modules/object-hash/package.json | 53 + node_modules/object-hash/readme.markdown | 198 + node_modules/on-finished/HISTORY.md | 98 + node_modules/on-finished/LICENSE | 23 + node_modules/on-finished/README.md | 162 + node_modules/on-finished/index.js | 234 + node_modules/on-finished/package.json | 39 + node_modules/once/LICENSE | 15 + node_modules/once/README.md | 79 + node_modules/once/once.js | 42 + node_modules/once/package.json | 33 + .../package-json-from-dist/LICENSE.md | 63 + node_modules/package-json-from-dist/README.md | 95 + .../dist/commonjs/index.d.ts | 89 + .../dist/commonjs/index.d.ts.map | 1 + .../dist/commonjs/index.js | 124 + .../dist/commonjs/index.js.map | 1 + .../dist/commonjs/package.json | 3 + .../dist/esm/index.d.ts | 89 + .../dist/esm/index.d.ts.map | 1 + .../package-json-from-dist/dist/esm/index.js | 119 + .../dist/esm/index.js.map | 1 + .../dist/esm/package.json | 3 + .../package-json-from-dist/package.json | 68 + node_modules/parse-srcset/.jscs.json | 83 + node_modules/parse-srcset/.jshintrc | 15 + node_modules/parse-srcset/.npmignore | 8 + node_modules/parse-srcset/LICENSE | 22 + node_modules/parse-srcset/README.md | 19 + node_modules/parse-srcset/package.json | 25 + node_modules/parse-srcset/src/parse-srcset.js | 330 + node_modules/parse-srcset/tests/he.js | 329 + node_modules/parse-srcset/tests/intern.js | 74 + node_modules/parse-srcset/tests/unit/ps.js | 345 + node_modules/parseurl/HISTORY.md | 58 + node_modules/parseurl/LICENSE | 24 + node_modules/parseurl/README.md | 133 + node_modules/parseurl/index.js | 158 + node_modules/parseurl/package.json | 40 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 43 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-key/index.d.ts | 40 + node_modules/path-key/index.js | 16 + node_modules/path-key/license | 9 + node_modules/path-key/package.json | 39 + node_modules/path-key/readme.md | 61 + node_modules/path-parse/LICENSE | 21 + node_modules/path-parse/README.md | 42 + node_modules/path-parse/index.js | 75 + node_modules/path-parse/package.json | 33 + node_modules/path-scurry/LICENSE.md | 55 + node_modules/path-scurry/README.md | 636 + .../path-scurry/dist/commonjs/index.d.ts | 1116 + .../path-scurry/dist/commonjs/index.d.ts.map | 1 + .../path-scurry/dist/commonjs/index.js | 2014 + .../path-scurry/dist/commonjs/index.js.map | 1 + .../path-scurry/dist/commonjs/package.json | 3 + node_modules/path-scurry/dist/esm/index.d.ts | 1116 + .../path-scurry/dist/esm/index.d.ts.map | 1 + node_modules/path-scurry/dist/esm/index.js | 1979 + .../path-scurry/dist/esm/index.js.map | 1 + .../path-scurry/dist/esm/package.json | 3 + node_modules/path-scurry/package.json | 89 + node_modules/path-to-regexp/LICENSE | 21 + node_modules/path-to-regexp/Readme.md | 350 + .../path-to-regexp/dist.es2015/index.js | 400 + .../path-to-regexp/dist.es2015/index.js.map | 1 + node_modules/path-to-regexp/dist/index.d.ts | 127 + node_modules/path-to-regexp/dist/index.js | 410 + node_modules/path-to-regexp/dist/index.js.map | 1 + node_modules/path-to-regexp/package.json | 62 + node_modules/picocolors/LICENSE | 15 + node_modules/picocolors/README.md | 21 + node_modules/picocolors/package.json | 25 + node_modules/picocolors/picocolors.browser.js | 4 + node_modules/picocolors/picocolors.d.ts | 5 + node_modules/picocolors/picocolors.js | 65 + node_modules/picocolors/types.ts | 30 + node_modules/picomatch/CHANGELOG.md | 136 + node_modules/picomatch/LICENSE | 21 + node_modules/picomatch/README.md | 708 + node_modules/picomatch/index.js | 3 + node_modules/picomatch/lib/constants.js | 179 + node_modules/picomatch/lib/parse.js | 1091 + node_modules/picomatch/lib/picomatch.js | 342 + node_modules/picomatch/lib/scan.js | 391 + node_modules/picomatch/lib/utils.js | 64 + node_modules/picomatch/package.json | 81 + node_modules/pify/index.js | 68 + node_modules/pify/license | 21 + node_modules/pify/package.json | 48 + node_modules/pify/readme.md | 119 + node_modules/pirates/LICENSE | 21 + node_modules/pirates/README.md | 69 + node_modules/pirates/index.d.ts | 82 + node_modules/pirates/lib/index.js | 139 + node_modules/pirates/package.json | 74 + node_modules/please-upgrade-node/.eslintrc.js | 12 + .../please-upgrade-node/.github/FUNDING.yml | 1 + node_modules/please-upgrade-node/LICENSE | 21 + node_modules/please-upgrade-node/README.md | 72 + node_modules/please-upgrade-node/index.d.ts | 11 + node_modules/please-upgrade-node/index.js | 25 + node_modules/please-upgrade-node/package.json | 46 + node_modules/postcss-import/LICENSE | 20 + node_modules/postcss-import/README.md | 244 + node_modules/postcss-import/index.js | 420 + .../postcss-import/lib/assign-layer-names.js | 17 + node_modules/postcss-import/lib/data-url.js | 17 + node_modules/postcss-import/lib/join-layer.js | 9 + node_modules/postcss-import/lib/join-media.js | 28 + .../postcss-import/lib/load-content.js | 12 + .../postcss-import/lib/parse-statements.js | 172 + .../postcss-import/lib/process-content.js | 59 + node_modules/postcss-import/lib/resolve-id.js | 42 + node_modules/postcss-import/package.json | 65 + node_modules/postcss-js/LICENSE | 20 + node_modules/postcss-js/README.md | 22 + node_modules/postcss-js/async.js | 15 + node_modules/postcss-js/index.js | 11 + node_modules/postcss-js/index.mjs | 8 + node_modules/postcss-js/objectifier.js | 85 + node_modules/postcss-js/package.json | 42 + node_modules/postcss-js/parser.js | 104 + node_modules/postcss-js/process-result.js | 11 + node_modules/postcss-js/sync.js | 12 + node_modules/postcss-load-config/LICENSE | 20 + node_modules/postcss-load-config/README.md | 466 + .../node_modules/lilconfig/LICENSE | 21 + .../node_modules/lilconfig/package.json | 42 + .../node_modules/lilconfig/readme.md | 98 + .../node_modules/lilconfig/src/index.d.ts | 54 + .../node_modules/lilconfig/src/index.js | 457 + node_modules/postcss-load-config/package.json | 54 + .../postcss-load-config/src/index.d.ts | 65 + node_modules/postcss-load-config/src/index.js | 185 + .../postcss-load-config/src/options.js | 47 + .../postcss-load-config/src/plugins.js | 85 + node_modules/postcss-load-config/src/req.js | 10 + node_modules/postcss-nested/LICENSE | 20 + node_modules/postcss-nested/README.md | 86 + node_modules/postcss-nested/index.d.ts | 41 + node_modules/postcss-nested/index.js | 361 + node_modules/postcss-nested/package.json | 28 + node_modules/postcss-selector-parser/API.md | 872 + .../postcss-selector-parser/CHANGELOG.md | 541 + .../postcss-selector-parser/LICENSE-MIT | 22 + .../postcss-selector-parser/README.md | 49 + .../postcss-selector-parser/dist/index.js | 17 + .../postcss-selector-parser/dist/parser.js | 1015 + .../postcss-selector-parser/dist/processor.js | 170 + .../dist/selectors/attribute.js | 448 + .../dist/selectors/className.js | 50 + .../dist/selectors/combinator.js | 21 + .../dist/selectors/comment.js | 21 + .../dist/selectors/constructors.js | 65 + .../dist/selectors/container.js | 308 + .../dist/selectors/guards.js | 58 + .../dist/selectors/id.js | 25 + .../dist/selectors/index.js | 21 + .../dist/selectors/namespace.js | 80 + .../dist/selectors/nesting.js | 22 + .../dist/selectors/node.js | 192 + .../dist/selectors/pseudo.js | 26 + .../dist/selectors/root.js | 44 + .../dist/selectors/selector.js | 21 + .../dist/selectors/string.js | 21 + .../dist/selectors/tag.js | 21 + .../dist/selectors/types.js | 28 + .../dist/selectors/universal.js | 22 + .../dist/sortAscending.js | 11 + .../dist/tokenTypes.js | 70 + .../postcss-selector-parser/dist/tokenize.js | 239 + .../dist/util/ensureObject.js | 17 + .../dist/util/getProp.js | 18 + .../dist/util/index.js | 13 + .../dist/util/stripComments.js | 21 + .../dist/util/unesc.js | 76 + .../postcss-selector-parser/package.json | 80 + .../postcss-selector-parser.d.ts | 555 + node_modules/postcss-value-parser/LICENSE | 22 + node_modules/postcss-value-parser/README.md | 263 + .../postcss-value-parser/lib/index.d.ts | 177 + .../postcss-value-parser/lib/index.js | 28 + .../postcss-value-parser/lib/parse.js | 321 + .../postcss-value-parser/lib/stringify.js | 48 + node_modules/postcss-value-parser/lib/unit.js | 120 + node_modules/postcss-value-parser/lib/walk.js | 22 + .../postcss-value-parser/package.json | 58 + node_modules/postcss/LICENSE | 20 + node_modules/postcss/README.md | 28 + node_modules/postcss/lib/at-rule.d.ts | 137 + node_modules/postcss/lib/at-rule.js | 25 + node_modules/postcss/lib/comment.d.ts | 67 + node_modules/postcss/lib/comment.js | 13 + node_modules/postcss/lib/container.d.ts | 490 + node_modules/postcss/lib/container.js | 441 + .../postcss/lib/css-syntax-error.d.ts | 248 + node_modules/postcss/lib/css-syntax-error.js | 100 + node_modules/postcss/lib/declaration.d.ts | 148 + node_modules/postcss/lib/declaration.js | 24 + node_modules/postcss/lib/document.d.ts | 69 + node_modules/postcss/lib/document.js | 33 + node_modules/postcss/lib/fromJSON.d.ts | 9 + node_modules/postcss/lib/fromJSON.js | 54 + node_modules/postcss/lib/input.d.ts | 194 + node_modules/postcss/lib/input.js | 248 + node_modules/postcss/lib/lazy-result.d.ts | 190 + node_modules/postcss/lib/lazy-result.js | 550 + node_modules/postcss/lib/list.d.ts | 57 + node_modules/postcss/lib/list.js | 58 + node_modules/postcss/lib/map-generator.js | 368 + node_modules/postcss/lib/no-work-result.d.ts | 46 + node_modules/postcss/lib/no-work-result.js | 138 + node_modules/postcss/lib/node.d.ts | 536 + node_modules/postcss/lib/node.js | 381 + node_modules/postcss/lib/parse.d.ts | 9 + node_modules/postcss/lib/parse.js | 42 + node_modules/postcss/lib/parser.js | 609 + node_modules/postcss/lib/postcss.d.mts | 72 + node_modules/postcss/lib/postcss.d.ts | 441 + node_modules/postcss/lib/postcss.js | 101 + node_modules/postcss/lib/postcss.mjs | 30 + node_modules/postcss/lib/previous-map.d.ts | 81 + node_modules/postcss/lib/previous-map.js | 142 + node_modules/postcss/lib/processor.d.ts | 115 + node_modules/postcss/lib/processor.js | 67 + node_modules/postcss/lib/result.d.ts | 206 + node_modules/postcss/lib/result.js | 42 + node_modules/postcss/lib/root.d.ts | 87 + node_modules/postcss/lib/root.js | 61 + node_modules/postcss/lib/rule.d.ts | 117 + node_modules/postcss/lib/rule.js | 27 + node_modules/postcss/lib/stringifier.d.ts | 46 + node_modules/postcss/lib/stringifier.js | 353 + node_modules/postcss/lib/stringify.d.ts | 9 + node_modules/postcss/lib/stringify.js | 11 + node_modules/postcss/lib/symbols.js | 5 + .../postcss/lib/terminal-highlight.js | 70 + node_modules/postcss/lib/tokenize.js | 266 + node_modules/postcss/lib/warn-once.js | 13 + node_modules/postcss/lib/warning.d.ts | 147 + node_modules/postcss/lib/warning.js | 37 + node_modules/postcss/package.json | 88 + .../posthtml-parser/dist/chunk.2UQLUWPH.js | 1 + node_modules/posthtml-parser/dist/index.d.ts | 27 + node_modules/posthtml-parser/dist/index.js | 1 + .../dist/location-tracker.d.ts | 17 + .../posthtml-parser/dist/location-tracker.js | 1 + node_modules/posthtml-parser/license | 22 + node_modules/posthtml-parser/package.json | 69 + node_modules/posthtml-parser/readme.md | 130 + node_modules/posthtml-render/changelog.md | 310 + node_modules/posthtml-render/dist/index.d.ts | 67 + node_modules/posthtml-render/dist/index.js | 1 + node_modules/posthtml-render/license | 22 + node_modules/posthtml-render/package.json | 55 + node_modules/posthtml-render/readme.md | 225 + node_modules/posthtml-urls/LICENSE | 21 + node_modules/posthtml-urls/README.md | 58 + .../posthtml-urls/lib/defaultOptions.js | 54 + node_modules/posthtml-urls/lib/index.js | 142 + node_modules/posthtml-urls/package.json | 34 + node_modules/posthtml/lib/api.js | 145 + node_modules/posthtml/lib/index.js | 323 + node_modules/posthtml/license | 21 + node_modules/posthtml/package.json | 64 + node_modules/posthtml/readme.md | 412 + node_modules/posthtml/types/posthtml.d.ts | 108 + node_modules/promise-each/LICENSE | 21 + node_modules/promise-each/README.md | 57 + node_modules/promise-each/index.js | 18 + .../node_modules/any-promise/.jshintrc | 4 + .../node_modules/any-promise/.npmignore | 6 + .../node_modules/any-promise/LICENSE | 19 + .../node_modules/any-promise/README.md | 37 + .../any-promise/any-promise-shim.js | 1 + .../node_modules/any-promise/any-promise.js | 33 + .../node_modules/any-promise/package.json | 36 + node_modules/promise-each/package.json | 32 + node_modules/promise/.jshintrc | 5 + node_modules/promise/.npmignore | 7 + node_modules/promise/LICENSE | 19 + node_modules/promise/Readme.md | 231 + node_modules/promise/build.js | 69 + node_modules/promise/core.js | 5 + node_modules/promise/domains/core.js | 213 + node_modules/promise/domains/done.js | 13 + .../promise/domains/es6-extensions.js | 107 + node_modules/promise/domains/finally.js | 16 + node_modules/promise/domains/index.js | 8 + .../promise/domains/node-extensions.js | 130 + .../promise/domains/rejection-tracking.js | 113 + node_modules/promise/domains/synchronous.js | 62 + node_modules/promise/index.d.ts | 256 + node_modules/promise/index.js | 3 + node_modules/promise/lib/core.js | 213 + node_modules/promise/lib/done.js | 13 + node_modules/promise/lib/es6-extensions.js | 107 + node_modules/promise/lib/finally.js | 16 + node_modules/promise/lib/index.js | 8 + node_modules/promise/lib/node-extensions.js | 130 + .../promise/lib/rejection-tracking.js | 113 + node_modules/promise/lib/synchronous.js | 62 + node_modules/promise/package.json | 35 + node_modules/promise/polyfill-done.js | 12 + node_modules/promise/polyfill.js | 10 + node_modules/promise/setimmediate/core.js | 213 + node_modules/promise/setimmediate/done.js | 13 + .../promise/setimmediate/es6-extensions.js | 107 + node_modules/promise/setimmediate/finally.js | 16 + node_modules/promise/setimmediate/index.js | 8 + .../promise/setimmediate/node-extensions.js | 130 + .../setimmediate/rejection-tracking.js | 113 + .../promise/setimmediate/synchronous.js | 62 + node_modules/promise/src/core.js | 213 + node_modules/promise/src/done.js | 13 + node_modules/promise/src/es6-extensions.js | 107 + node_modules/promise/src/finally.js | 16 + node_modules/promise/src/index.js | 8 + node_modules/promise/src/node-extensions.js | 130 + .../promise/src/rejection-tracking.js | 113 + node_modules/promise/src/synchronous.js | 62 + node_modules/prr/.jshintrc | 61 + node_modules/prr/.npmignore | 1 + node_modules/prr/.travis.yml | 10 + node_modules/prr/LICENSE.md | 11 + node_modules/prr/README.md | 47 + node_modules/prr/package.json | 26 + node_modules/prr/prr.js | 63 + node_modules/prr/test.js | 169 + node_modules/pug-attrs/LICENSE | 19 + node_modules/pug-attrs/README.md | 75 + node_modules/pug-attrs/index.js | 150 + node_modules/pug-attrs/package.json | 22 + node_modules/pug-code-gen/HISTORY.md | 13 + node_modules/pug-code-gen/LICENSE | 19 + node_modules/pug-code-gen/README.md | 64 + node_modules/pug-code-gen/index.js | 1031 + node_modules/pug-code-gen/package.json | 27 + node_modules/pug-error/LICENSE | 19 + node_modules/pug-error/README.md | 55 + node_modules/pug-error/lib/index.d.ts | 6 + node_modules/pug-error/lib/index.js | 56 + node_modules/pug-error/lib/index.js.map | 1 + .../pug-error/lib/tsconfig.tsbuildinfo | 1 + node_modules/pug-error/package.json | 19 + node_modules/pug-filters/CHANGELOG.md | 34 + node_modules/pug-filters/LICENSE | 19 + node_modules/pug-filters/README.md | 42 + node_modules/pug-filters/index.js | 4 + .../pug-filters/lib/handle-filters.js | 144 + node_modules/pug-filters/lib/run-filter.js | 47 + node_modules/pug-filters/package.json | 37 + node_modules/pug-lexer/History.md | 66 + node_modules/pug-lexer/LICENSE | 19 + node_modules/pug-lexer/README.md | 73 + node_modules/pug-lexer/index.d.ts | 366 + node_modules/pug-lexer/index.js | 1710 + node_modules/pug-lexer/package.json | 27 + node_modules/pug-linker/HISTORY.md | 10 + node_modules/pug-linker/LICENSE | 19 + node_modules/pug-linker/README.md | 28 + node_modules/pug-linker/index.js | 206 + node_modules/pug-linker/package.json | 26 + node_modules/pug-load/HISTORY.md | 19 + node_modules/pug-load/LICENSE | 19 + node_modules/pug-load/README.md | 105 + node_modules/pug-load/index.js | 120 + node_modules/pug-load/package.json | 25 + node_modules/pug-parser/HISTORY.md | 11 + node_modules/pug-parser/LICENSE | 19 + node_modules/pug-parser/README.md | 90 + node_modules/pug-parser/index.js | 1300 + node_modules/pug-parser/lib/inline-tags.js | 23 + node_modules/pug-parser/package.json | 23 + node_modules/pug-runtime/CHANGELOG.md | 45 + node_modules/pug-runtime/LICENSE | 19 + node_modules/pug-runtime/README.md | 68 + node_modules/pug-runtime/build.js | 27 + node_modules/pug-runtime/index.js | 286 + node_modules/pug-runtime/lib/dependencies.js | 34 + node_modules/pug-runtime/lib/internals.js | 8 + node_modules/pug-runtime/lib/sources.js | 13 + node_modules/pug-runtime/package.json | 33 + node_modules/pug-runtime/wrap.js | 10 + node_modules/pug-strip-comments/CHANGELOG.md | 16 + node_modules/pug-strip-comments/LICENSE.md | 7 + node_modules/pug-strip-comments/README.md | 46 + node_modules/pug-strip-comments/index.js | 77 + node_modules/pug-strip-comments/package.json | 23 + node_modules/pug-walk/HISTORY.md | 4 + node_modules/pug-walk/LICENSE | 19 + node_modules/pug-walk/README.md | 138 + node_modules/pug-walk/index.js | 120 + node_modules/pug-walk/package.json | 21 + node_modules/pug/History.md | 991 + node_modules/pug/LICENSE | 22 + node_modules/pug/README.md | 168 + node_modules/pug/lib/index.js | 494 + node_modules/pug/package.json | 58 + node_modules/pug/register.js | 20 + node_modules/queue-microtask/LICENSE | 20 + node_modules/queue-microtask/README.md | 90 + node_modules/queue-microtask/index.d.ts | 2 + node_modules/queue-microtask/index.js | 9 + node_modules/queue-microtask/package.json | 55 + node_modules/read-cache/LICENSE | 20 + node_modules/read-cache/README.md | 46 + node_modules/read-cache/index.js | 78 + node_modules/read-cache/package.json | 34 + node_modules/readdirp/LICENSE | 21 + node_modules/readdirp/README.md | 122 + node_modules/readdirp/index.d.ts | 43 + node_modules/readdirp/index.js | 287 + node_modules/readdirp/package.json | 122 + node_modules/recursive-copy/README.md | 201 + node_modules/recursive-copy/index.d.ts | 117 + node_modules/recursive-copy/index.js | 3 + node_modules/recursive-copy/lib/copy.js | 423 + node_modules/recursive-copy/package.json | 71 + node_modules/resolve/.editorconfig | 37 + node_modules/resolve/.eslintrc | 65 + node_modules/resolve/.github/FUNDING.yml | 12 + node_modules/resolve/LICENSE | 21 + node_modules/resolve/SECURITY.md | 3 + node_modules/resolve/async.js | 3 + node_modules/resolve/bin/resolve | 50 + node_modules/resolve/example/async.js | 5 + node_modules/resolve/example/sync.js | 3 + node_modules/resolve/index.js | 6 + node_modules/resolve/lib/async.js | 329 + node_modules/resolve/lib/caller.js | 8 + node_modules/resolve/lib/core.js | 12 + node_modules/resolve/lib/core.json | 158 + node_modules/resolve/lib/homedir.js | 24 + node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + node_modules/resolve/lib/normalize-options.js | 119 + node_modules/resolve/lib/sync.js | 208 + node_modules/resolve/package.json | 72 + node_modules/resolve/readme.markdown | 301 + node_modules/resolve/sync.js | 3 + node_modules/resolve/test/core.js | 88 + node_modules/resolve/test/dotdot.js | 29 + node_modules/resolve/test/dotdot/abc/index.js | 2 + node_modules/resolve/test/dotdot/index.js | 1 + node_modules/resolve/test/faulty_basedir.js | 29 + node_modules/resolve/test/filter.js | 34 + node_modules/resolve/test/filter_sync.js | 33 + node_modules/resolve/test/home_paths.js | 127 + node_modules/resolve/test/home_paths_sync.js | 114 + node_modules/resolve/test/mock.js | 315 + node_modules/resolve/test/mock_sync.js | 214 + node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + node_modules/resolve/test/nonstring.js | 9 + node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 + node_modules/resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + node_modules/resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + node_modules/resolve/test/resolver.js | 597 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + node_modules/resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + .../resolve/test/resolver/false_main/index.js | 0 .../test/resolver/false_main/package.json | 4 + node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + node_modules/resolve/test/resolver_sync.js | 730 + node_modules/resolve/test/shadowed_core.js | 54 + .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 + node_modules/resolve/test/symlinks.js | 176 + node_modules/reusify/.coveralls.yml | 1 + node_modules/reusify/.travis.yml | 28 + node_modules/reusify/LICENSE | 22 + node_modules/reusify/README.md | 145 + .../benchmarks/createNoCodeFunction.js | 30 + node_modules/reusify/benchmarks/fib.js | 13 + .../reusify/benchmarks/reuseNoCodeFunction.js | 38 + node_modules/reusify/package.json | 45 + node_modules/reusify/reusify.js | 33 + node_modules/reusify/test.js | 66 + node_modules/rimraf/LICENSE | 15 + node_modules/rimraf/README.md | 101 + node_modules/rimraf/bin.js | 50 + node_modules/rimraf/package.json | 29 + node_modules/rimraf/rimraf.js | 372 + node_modules/run-parallel/LICENSE | 20 + node_modules/run-parallel/README.md | 85 + node_modules/run-parallel/index.js | 51 + node_modules/run-parallel/package.json | 58 + node_modules/section-matter/LICENSE | 21 + node_modules/section-matter/README.md | 236 + node_modules/section-matter/index.js | 136 + node_modules/section-matter/package.json | 55 + node_modules/semver-compare/.travis.yml | 6 + node_modules/semver-compare/LICENSE | 18 + node_modules/semver-compare/example/cmp.js | 13 + node_modules/semver-compare/example/lex.js | 12 + node_modules/semver-compare/index.js | 13 + node_modules/semver-compare/package.json | 31 + node_modules/semver-compare/readme.markdown | 77 + node_modules/semver-compare/test/cmp.js | 29 + node_modules/semver/LICENSE | 15 + node_modules/semver/README.md | 654 + node_modules/semver/bin/semver.js | 188 + node_modules/semver/classes/comparator.js | 141 + node_modules/semver/classes/index.js | 5 + node_modules/semver/classes/range.js | 540 + node_modules/semver/classes/semver.js | 302 + node_modules/semver/functions/clean.js | 6 + node_modules/semver/functions/cmp.js | 52 + node_modules/semver/functions/coerce.js | 60 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + node_modules/semver/functions/compare.js | 5 + node_modules/semver/functions/diff.js | 65 + node_modules/semver/functions/eq.js | 3 + node_modules/semver/functions/gt.js | 3 + node_modules/semver/functions/gte.js | 3 + node_modules/semver/functions/inc.js | 19 + node_modules/semver/functions/lt.js | 3 + node_modules/semver/functions/lte.js | 3 + node_modules/semver/functions/major.js | 3 + node_modules/semver/functions/minor.js | 3 + node_modules/semver/functions/neq.js | 3 + node_modules/semver/functions/parse.js | 16 + node_modules/semver/functions/patch.js | 3 + node_modules/semver/functions/prerelease.js | 6 + node_modules/semver/functions/rcompare.js | 3 + node_modules/semver/functions/rsort.js | 3 + node_modules/semver/functions/satisfies.js | 10 + node_modules/semver/functions/sort.js | 3 + node_modules/semver/functions/valid.js | 6 + node_modules/semver/index.js | 89 + node_modules/semver/internal/constants.js | 35 + node_modules/semver/internal/debug.js | 9 + node_modules/semver/internal/identifiers.js | 23 + node_modules/semver/internal/lrucache.js | 40 + node_modules/semver/internal/parse-options.js | 15 + node_modules/semver/internal/re.js | 217 + node_modules/semver/package.json | 77 + node_modules/semver/preload.js | 2 + node_modules/semver/range.bnf | 16 + node_modules/semver/ranges/gtr.js | 4 + node_modules/semver/ranges/intersects.js | 7 + node_modules/semver/ranges/ltr.js | 4 + node_modules/semver/ranges/max-satisfying.js | 25 + node_modules/semver/ranges/min-satisfying.js | 24 + node_modules/semver/ranges/min-version.js | 61 + node_modules/semver/ranges/outside.js | 80 + node_modules/semver/ranges/simplify.js | 47 + node_modules/semver/ranges/subset.js | 247 + node_modules/semver/ranges/to-comparators.js | 8 + node_modules/semver/ranges/valid.js | 11 + node_modules/set-function-length/.eslintrc | 27 + .../set-function-length/.github/FUNDING.yml | 12 + node_modules/set-function-length/.nycrc | 13 + node_modules/set-function-length/CHANGELOG.md | 70 + node_modules/set-function-length/LICENSE | 21 + node_modules/set-function-length/README.md | 56 + node_modules/set-function-length/env.d.ts | 9 + node_modules/set-function-length/env.js | 25 + node_modules/set-function-length/index.d.ts | 7 + node_modules/set-function-length/index.js | 42 + node_modules/set-function-length/package.json | 102 + .../set-function-length/tsconfig.json | 9 + node_modules/shebang-command/index.js | 19 + node_modules/shebang-command/license | 9 + node_modules/shebang-command/package.json | 34 + node_modules/shebang-command/readme.md | 34 + node_modules/shebang-regex/index.d.ts | 22 + node_modules/shebang-regex/index.js | 2 + node_modules/shebang-regex/license | 9 + node_modules/shebang-regex/package.json | 35 + node_modules/shebang-regex/readme.md | 33 + node_modules/signal-exit/LICENSE.txt | 16 + node_modules/signal-exit/README.md | 74 + .../signal-exit/dist/cjs/browser.d.ts | 12 + .../signal-exit/dist/cjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/browser.js | 10 + .../signal-exit/dist/cjs/browser.js.map | 1 + node_modules/signal-exit/dist/cjs/index.d.ts | 48 + .../signal-exit/dist/cjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/index.js | 279 + .../signal-exit/dist/cjs/index.js.map | 1 + .../signal-exit/dist/cjs/package.json | 3 + .../signal-exit/dist/cjs/signals.d.ts | 29 + .../signal-exit/dist/cjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/signals.js | 42 + .../signal-exit/dist/cjs/signals.js.map | 1 + .../signal-exit/dist/mjs/browser.d.ts | 12 + .../signal-exit/dist/mjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/browser.js | 4 + .../signal-exit/dist/mjs/browser.js.map | 1 + node_modules/signal-exit/dist/mjs/index.d.ts | 48 + .../signal-exit/dist/mjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/index.js | 275 + .../signal-exit/dist/mjs/index.js.map | 1 + .../signal-exit/dist/mjs/package.json | 3 + .../signal-exit/dist/mjs/signals.d.ts | 29 + .../signal-exit/dist/mjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/signals.js | 39 + .../signal-exit/dist/mjs/signals.js.map | 1 + node_modules/signal-exit/package.json | 106 + node_modules/slash/index.js | 11 + node_modules/slash/package.json | 33 + node_modules/slash/readme.md | 44 + node_modules/slugify/CHANGELOG.md | 94 + node_modules/slugify/LICENSE | 21 + node_modules/slugify/README.md | 98 + node_modules/slugify/package.json | 42 + node_modules/slugify/slugify.d.ts | 24 + node_modules/slugify/slugify.js | 69 + node_modules/source-map-js/LICENSE | 28 + node_modules/source-map-js/README.md | 765 + node_modules/source-map-js/lib/array-set.js | 121 + node_modules/source-map-js/lib/base64-vlq.js | 140 + node_modules/source-map-js/lib/base64.js | 67 + .../source-map-js/lib/binary-search.js | 111 + .../source-map-js/lib/mapping-list.js | 79 + node_modules/source-map-js/lib/quick-sort.js | 132 + .../source-map-js/lib/source-map-consumer.js | 1184 + .../source-map-js/lib/source-map-generator.js | 444 + node_modules/source-map-js/lib/source-node.js | 413 + node_modules/source-map-js/lib/util.js | 594 + node_modules/source-map-js/package.json | 71 + node_modules/source-map-js/source-map.d.ts | 115 + node_modules/source-map-js/source-map.js | 8 + node_modules/source-map/CHANGELOG.md | 301 + node_modules/source-map/LICENSE | 28 + node_modules/source-map/README.md | 742 + .../source-map/dist/source-map.debug.js | 3234 + node_modules/source-map/dist/source-map.js | 3233 + .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + node_modules/source-map/lib/array-set.js | 121 + node_modules/source-map/lib/base64-vlq.js | 140 + node_modules/source-map/lib/base64.js | 67 + node_modules/source-map/lib/binary-search.js | 111 + node_modules/source-map/lib/mapping-list.js | 79 + node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1145 + .../source-map/lib/source-map-generator.js | 425 + node_modules/source-map/lib/source-node.js | 413 + node_modules/source-map/lib/util.js | 488 + node_modules/source-map/package.json | 73 + node_modules/source-map/source-map.d.ts | 98 + node_modules/source-map/source-map.js | 8 + node_modules/sprintf-js/.npmignore | 1 + node_modules/sprintf-js/LICENSE | 24 + node_modules/sprintf-js/README.md | 88 + node_modules/sprintf-js/bower.json | 14 + node_modules/sprintf-js/demo/angular.html | 20 + .../sprintf-js/dist/angular-sprintf.min.js | 4 + .../dist/angular-sprintf.min.js.map | 1 + .../sprintf-js/dist/angular-sprintf.min.map | 1 + node_modules/sprintf-js/dist/sprintf.min.js | 4 + .../sprintf-js/dist/sprintf.min.js.map | 1 + node_modules/sprintf-js/dist/sprintf.min.map | 1 + node_modules/sprintf-js/gruntfile.js | 36 + node_modules/sprintf-js/package.json | 22 + .../sprintf-js/src/angular-sprintf.js | 18 + node_modules/sprintf-js/src/sprintf.js | 208 + node_modules/sprintf-js/test/test.js | 82 + node_modules/ssri/CHANGELOG.md | 355 + node_modules/ssri/LICENSE.md | 16 + node_modules/ssri/README.md | 528 + node_modules/ssri/index.js | 470 + .../ssri/node_modules/minipass/LICENSE | 15 + .../ssri/node_modules/minipass/README.md | 728 + .../ssri/node_modules/minipass/index.d.ts | 155 + .../ssri/node_modules/minipass/index.js | 649 + .../ssri/node_modules/minipass/package.json | 56 + node_modules/ssri/package.json | 52 + node_modules/statuses/HISTORY.md | 82 + node_modules/statuses/LICENSE | 23 + node_modules/statuses/README.md | 136 + node_modules/statuses/codes.json | 65 + node_modules/statuses/index.js | 146 + node_modules/statuses/package.json | 49 + node_modules/string-width-cjs/index.d.ts | 29 + node_modules/string-width-cjs/index.js | 47 + node_modules/string-width-cjs/license | 9 + .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../node_modules/strip-ansi/readme.md | 46 + node_modules/string-width-cjs/package.json | 56 + node_modules/string-width-cjs/readme.md | 50 + node_modules/string-width/index.d.ts | 29 + node_modules/string-width/index.js | 54 + node_modules/string-width/license | 9 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../node_modules/emoji-regex/README.md | 137 + .../node_modules/emoji-regex/RGI_Emoji.d.ts | 5 + .../node_modules/emoji-regex/RGI_Emoji.js | 6 + .../emoji-regex/es2015/RGI_Emoji.d.ts | 5 + .../emoji-regex/es2015/RGI_Emoji.js | 6 + .../emoji-regex/es2015/index.d.ts | 5 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.d.ts | 5 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../node_modules/emoji-regex/index.d.ts | 5 + .../node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 52 + .../node_modules/emoji-regex/text.d.ts | 5 + .../node_modules/emoji-regex/text.js | 6 + node_modules/string-width/package.json | 59 + node_modules/string-width/readme.md | 67 + node_modules/strip-ansi-cjs/index.d.ts | 17 + node_modules/strip-ansi-cjs/index.js | 4 + node_modules/strip-ansi-cjs/license | 9 + node_modules/strip-ansi-cjs/package.json | 54 + node_modules/strip-ansi-cjs/readme.md | 46 + node_modules/strip-ansi/index.d.ts | 15 + node_modules/strip-ansi/index.js | 14 + node_modules/strip-ansi/license | 9 + .../node_modules/ansi-regex/index.d.ts | 33 + .../node_modules/ansi-regex/index.js | 8 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 58 + .../node_modules/ansi-regex/readme.md | 72 + node_modules/strip-ansi/package.json | 57 + node_modules/strip-ansi/readme.md | 41 + node_modules/strip-bom-string/LICENSE | 21 + node_modules/strip-bom-string/README.md | 66 + node_modules/strip-bom-string/index.js | 15 + node_modules/strip-bom-string/package.json | 60 + node_modules/sucrase/LICENSE | 21 + node_modules/sucrase/README.md | 295 + node_modules/sucrase/bin/sucrase | 3 + node_modules/sucrase/bin/sucrase-node | 18 + .../sucrase/dist/CJSImportProcessor.js | 456 + node_modules/sucrase/dist/HelperManager.js | 176 + node_modules/sucrase/dist/NameManager.js | 27 + .../sucrase/dist/Options-gen-types.js | 42 + node_modules/sucrase/dist/Options.js | 101 + node_modules/sucrase/dist/TokenProcessor.js | 357 + node_modules/sucrase/dist/cli.js | 317 + node_modules/sucrase/dist/computeSourceMap.js | 89 + .../sucrase/dist/esm/CJSImportProcessor.js | 456 + .../sucrase/dist/esm/HelperManager.js | 176 + node_modules/sucrase/dist/esm/NameManager.js | 27 + .../sucrase/dist/esm/Options-gen-types.js | 42 + node_modules/sucrase/dist/esm/Options.js | 101 + .../sucrase/dist/esm/TokenProcessor.js | 357 + node_modules/sucrase/dist/esm/cli.js | 317 + .../sucrase/dist/esm/computeSourceMap.js | 89 + .../dist/esm/identifyShadowedGlobals.js | 98 + node_modules/sucrase/dist/esm/index.js | 133 + node_modules/sucrase/dist/esm/parser/index.js | 31 + .../sucrase/dist/esm/parser/plugins/flow.js | 1105 + .../dist/esm/parser/plugins/jsx/index.js | 367 + .../dist/esm/parser/plugins/jsx/xhtml.js | 256 + .../sucrase/dist/esm/parser/plugins/types.js | 37 + .../dist/esm/parser/plugins/typescript.js | 1632 + .../dist/esm/parser/tokenizer/index.js | 1004 + .../dist/esm/parser/tokenizer/keywords.js | 43 + .../dist/esm/parser/tokenizer/readWord.js | 64 + .../dist/esm/parser/tokenizer/readWordTree.js | 671 + .../dist/esm/parser/tokenizer/state.js | 106 + .../dist/esm/parser/tokenizer/types.js | 361 + .../sucrase/dist/esm/parser/traverser/base.js | 60 + .../dist/esm/parser/traverser/expression.js | 1022 + .../dist/esm/parser/traverser/index.js | 18 + .../sucrase/dist/esm/parser/traverser/lval.js | 159 + .../dist/esm/parser/traverser/statement.js | 1332 + .../sucrase/dist/esm/parser/traverser/util.js | 104 + .../sucrase/dist/esm/parser/util/charcodes.js | 115 + .../dist/esm/parser/util/identifier.js | 34 + .../dist/esm/parser/util/whitespace.js | 33 + node_modules/sucrase/dist/esm/register.js | 88 + .../esm/transformers/CJSImportTransformer.js | 916 + .../esm/transformers/ESMImportTransformer.js | 415 + .../dist/esm/transformers/FlowTransformer.js | 182 + .../dist/esm/transformers/JSXTransformer.js | 733 + .../esm/transformers/JestHoistTransformer.js | 111 + .../NumericSeparatorTransformer.js | 20 + .../OptionalCatchBindingTransformer.js | 19 + .../OptionalChainingNullishTransformer.js | 155 + .../ReactDisplayNameTransformer.js | 160 + .../transformers/ReactHotLoaderTransformer.js | 69 + .../dist/esm/transformers/RootTransformer.js | 462 + .../dist/esm/transformers/Transformer.js | 16 + .../esm/transformers/TypeScriptTransformer.js | 279 + .../dist/esm/util/elideImportEquals.js | 29 + .../sucrase/dist/esm/util/formatTokens.js | 74 + .../sucrase/dist/esm/util/getClassInfo.js | 352 + .../dist/esm/util/getDeclarationInfo.js | 40 + .../dist/esm/util/getIdentifierNames.js | 15 + .../esm/util/getImportExportSpecifierInfo.js | 92 + .../sucrase/dist/esm/util/getJSXPragmaInfo.js | 22 + .../dist/esm/util/getNonTypeIdentifiers.js | 43 + .../dist/esm/util/getTSImportedNames.js | 84 + .../sucrase/dist/esm/util/isAsyncOperation.js | 38 + .../sucrase/dist/esm/util/isExportFrom.js | 18 + .../sucrase/dist/esm/util/isIdentifier.js | 81 + .../esm/util/removeMaybeImportAttributes.js | 22 + .../dist/esm/util/shouldElideDefaultExport.js | 38 + .../sucrase/dist/identifyShadowedGlobals.js | 98 + node_modules/sucrase/dist/index.js | 133 + node_modules/sucrase/dist/parser/index.js | 31 + .../sucrase/dist/parser/plugins/flow.js | 1105 + .../sucrase/dist/parser/plugins/jsx/index.js | 367 + .../sucrase/dist/parser/plugins/jsx/xhtml.js | 256 + .../sucrase/dist/parser/plugins/types.js | 37 + .../sucrase/dist/parser/plugins/typescript.js | 1632 + .../sucrase/dist/parser/tokenizer/index.js | 1004 + .../sucrase/dist/parser/tokenizer/keywords.js | 43 + .../sucrase/dist/parser/tokenizer/readWord.js | 64 + .../dist/parser/tokenizer/readWordTree.js | 671 + .../sucrase/dist/parser/tokenizer/state.js | 106 + .../sucrase/dist/parser/tokenizer/types.js | 361 + .../sucrase/dist/parser/traverser/base.js | 60 + .../dist/parser/traverser/expression.js | 1022 + .../sucrase/dist/parser/traverser/index.js | 18 + .../sucrase/dist/parser/traverser/lval.js | 159 + .../dist/parser/traverser/statement.js | 1332 + .../sucrase/dist/parser/traverser/util.js | 104 + .../sucrase/dist/parser/util/charcodes.js | 115 + .../sucrase/dist/parser/util/identifier.js | 34 + .../sucrase/dist/parser/util/whitespace.js | 33 + node_modules/sucrase/dist/register.js | 88 + .../dist/transformers/CJSImportTransformer.js | 916 + .../dist/transformers/ESMImportTransformer.js | 415 + .../dist/transformers/FlowTransformer.js | 182 + .../dist/transformers/JSXTransformer.js | 733 + .../dist/transformers/JestHoistTransformer.js | 111 + .../NumericSeparatorTransformer.js | 20 + .../OptionalCatchBindingTransformer.js | 19 + .../OptionalChainingNullishTransformer.js | 155 + .../ReactDisplayNameTransformer.js | 160 + .../transformers/ReactHotLoaderTransformer.js | 69 + .../dist/transformers/RootTransformer.js | 462 + .../sucrase/dist/transformers/Transformer.js | 16 + .../transformers/TypeScriptTransformer.js | 279 + .../dist/types/CJSImportProcessor.d.ts | 67 + .../sucrase/dist/types/HelperManager.d.ts | 15 + .../sucrase/dist/types/NameManager.d.ts | 7 + .../sucrase/dist/types/Options-gen-types.d.ts | 9 + node_modules/sucrase/dist/types/Options.d.ts | 90 + .../sucrase/dist/types/TokenProcessor.d.ts | 87 + node_modules/sucrase/dist/types/cli.d.ts | 1 + .../sucrase/dist/types/computeSourceMap.d.ts | 17 + .../dist/types/identifyShadowedGlobals.d.ts | 12 + node_modules/sucrase/dist/types/index.d.ts | 26 + .../sucrase/dist/types/parser/index.d.ts | 8 + .../dist/types/parser/plugins/flow.d.ts | 27 + .../dist/types/parser/plugins/jsx/index.d.ts | 2 + .../dist/types/parser/plugins/jsx/xhtml.d.ts | 2 + .../dist/types/parser/plugins/types.d.ts | 5 + .../dist/types/parser/plugins/typescript.d.ts | 49 + .../dist/types/parser/tokenizer/index.d.ts | 93 + .../dist/types/parser/tokenizer/keywords.d.ts | 43 + .../dist/types/parser/tokenizer/readWord.d.ts | 7 + .../types/parser/tokenizer/readWordTree.d.ts | 1 + .../dist/types/parser/tokenizer/state.d.ts | 50 + .../dist/types/parser/tokenizer/types.d.ts | 126 + .../dist/types/parser/traverser/base.d.ts | 16 + .../types/parser/traverser/expression.d.ts | 34 + .../dist/types/parser/traverser/index.d.ts | 2 + .../dist/types/parser/traverser/lval.d.ts | 9 + .../types/parser/traverser/statement.d.ts | 20 + .../dist/types/parser/traverser/util.d.ts | 17 + .../dist/types/parser/util/charcodes.d.ts | 107 + .../dist/types/parser/util/identifier.d.ts | 2 + .../dist/types/parser/util/whitespace.d.ts | 3 + node_modules/sucrase/dist/types/register.d.ts | 14 + .../transformers/CJSImportTransformer.d.ts | 149 + .../transformers/ESMImportTransformer.d.ts | 52 + .../types/transformers/FlowTransformer.d.ts | 79 + .../types/transformers/JSXTransformer.d.ts | 144 + .../transformers/JestHoistTransformer.d.ts | 32 + .../NumericSeparatorTransformer.d.ts | 7 + .../OptionalCatchBindingTransformer.d.ts | 9 + .../OptionalChainingNullishTransformer.d.ts | 36 + .../ReactDisplayNameTransformer.d.ts | 29 + .../ReactHotLoaderTransformer.d.ts | 12 + .../types/transformers/RootTransformer.d.ts | 52 + .../dist/types/transformers/Transformer.d.ts | 6 + .../transformers/TypeScriptTransformer.d.ts | 104 + .../dist/types/util/elideImportEquals.d.ts | 2 + .../sucrase/dist/types/util/formatTokens.d.ts | 2 + .../sucrase/dist/types/util/getClassInfo.d.ts | 34 + .../dist/types/util/getDeclarationInfo.d.ts | 18 + .../dist/types/util/getIdentifierNames.d.ts | 5 + .../util/getImportExportSpecifierInfo.d.ts | 36 + .../dist/types/util/getJSXPragmaInfo.d.ts | 8 + .../types/util/getNonTypeIdentifiers.d.ts | 3 + .../dist/types/util/getTSImportedNames.d.ts | 9 + .../dist/types/util/isAsyncOperation.d.ts | 11 + .../sucrase/dist/types/util/isExportFrom.d.ts | 6 + .../sucrase/dist/types/util/isIdentifier.d.ts | 8 + .../util/removeMaybeImportAttributes.d.ts | 6 + .../types/util/shouldElideDefaultExport.d.ts | 6 + .../sucrase/dist/util/elideImportEquals.js | 29 + .../sucrase/dist/util/formatTokens.js | 74 + .../sucrase/dist/util/getClassInfo.js | 352 + .../sucrase/dist/util/getDeclarationInfo.js | 40 + .../sucrase/dist/util/getIdentifierNames.js | 15 + .../dist/util/getImportExportSpecifierInfo.js | 92 + .../sucrase/dist/util/getJSXPragmaInfo.js | 22 + .../dist/util/getNonTypeIdentifiers.js | 43 + .../sucrase/dist/util/getTSImportedNames.js | 84 + .../sucrase/dist/util/isAsyncOperation.js | 38 + .../sucrase/dist/util/isExportFrom.js | 18 + .../sucrase/dist/util/isIdentifier.js | 81 + .../dist/util/removeMaybeImportAttributes.js | 22 + .../dist/util/shouldElideDefaultExport.js | 38 + node_modules/sucrase/node_modules/.bin/glob | 1 + .../node_modules/commander/CHANGELOG.md | 436 + .../sucrase/node_modules/commander/LICENSE | 22 + .../sucrase/node_modules/commander/Readme.md | 713 + .../sucrase/node_modules/commander/index.js | 1649 + .../node_modules/commander/package.json | 41 + .../node_modules/commander/typings/index.d.ts | 311 + .../sucrase/node_modules/glob/LICENSE | 15 + .../sucrase/node_modules/glob/README.md | 1265 + .../node_modules/glob/dist/commonjs/glob.d.ts | 389 + .../glob/dist/commonjs/glob.d.ts.map | 1 + .../node_modules/glob/dist/commonjs/glob.js | 247 + .../glob/dist/commonjs/glob.js.map | 1 + .../glob/dist/commonjs/has-magic.d.ts | 14 + .../glob/dist/commonjs/has-magic.d.ts.map | 1 + .../glob/dist/commonjs/has-magic.js | 27 + .../glob/dist/commonjs/has-magic.js.map | 1 + .../glob/dist/commonjs/ignore.d.ts | 25 + .../glob/dist/commonjs/ignore.d.ts.map | 1 + .../node_modules/glob/dist/commonjs/ignore.js | 119 + .../glob/dist/commonjs/ignore.js.map | 1 + .../glob/dist/commonjs/index.d.ts | 97 + .../glob/dist/commonjs/index.d.ts.map | 1 + .../node_modules/glob/dist/commonjs/index.js | 68 + .../glob/dist/commonjs/index.js.map | 1 + .../glob/dist/commonjs/package.json | 3 + .../glob/dist/commonjs/pattern.d.ts | 77 + .../glob/dist/commonjs/pattern.d.ts.map | 1 + .../glob/dist/commonjs/pattern.js | 219 + .../glob/dist/commonjs/pattern.js.map | 1 + .../glob/dist/commonjs/processor.d.ts | 59 + .../glob/dist/commonjs/processor.d.ts.map | 1 + .../glob/dist/commonjs/processor.js | 301 + .../glob/dist/commonjs/processor.js.map | 1 + .../glob/dist/commonjs/walker.d.ts | 98 + .../glob/dist/commonjs/walker.d.ts.map | 1 + .../node_modules/glob/dist/commonjs/walker.js | 387 + .../glob/dist/commonjs/walker.js.map | 1 + .../node_modules/glob/dist/esm/bin.d.mts | 3 + .../node_modules/glob/dist/esm/bin.d.mts.map | 1 + .../node_modules/glob/dist/esm/bin.mjs | 270 + .../node_modules/glob/dist/esm/bin.mjs.map | 1 + .../node_modules/glob/dist/esm/glob.d.ts | 389 + .../node_modules/glob/dist/esm/glob.d.ts.map | 1 + .../node_modules/glob/dist/esm/glob.js | 243 + .../node_modules/glob/dist/esm/glob.js.map | 1 + .../node_modules/glob/dist/esm/has-magic.d.ts | 14 + .../glob/dist/esm/has-magic.d.ts.map | 1 + .../node_modules/glob/dist/esm/has-magic.js | 23 + .../glob/dist/esm/has-magic.js.map | 1 + .../node_modules/glob/dist/esm/ignore.d.ts | 25 + .../glob/dist/esm/ignore.d.ts.map | 1 + .../node_modules/glob/dist/esm/ignore.js | 115 + .../node_modules/glob/dist/esm/ignore.js.map | 1 + .../node_modules/glob/dist/esm/index.d.ts | 97 + .../node_modules/glob/dist/esm/index.d.ts.map | 1 + .../node_modules/glob/dist/esm/index.js | 55 + .../node_modules/glob/dist/esm/index.js.map | 1 + .../node_modules/glob/dist/esm/package.json | 3 + .../node_modules/glob/dist/esm/pattern.d.ts | 77 + .../glob/dist/esm/pattern.d.ts.map | 1 + .../node_modules/glob/dist/esm/pattern.js | 215 + .../node_modules/glob/dist/esm/pattern.js.map | 1 + .../node_modules/glob/dist/esm/processor.d.ts | 59 + .../glob/dist/esm/processor.d.ts.map | 1 + .../node_modules/glob/dist/esm/processor.js | 294 + .../glob/dist/esm/processor.js.map | 1 + .../node_modules/glob/dist/esm/walker.d.ts | 98 + .../glob/dist/esm/walker.d.ts.map | 1 + .../node_modules/glob/dist/esm/walker.js | 381 + .../node_modules/glob/dist/esm/walker.js.map | 1 + .../sucrase/node_modules/glob/package.json | 98 + .../sucrase/node_modules/minimatch/LICENSE | 15 + .../sucrase/node_modules/minimatch/README.md | 454 + .../dist/commonjs/assert-valid-pattern.d.ts | 2 + .../commonjs/assert-valid-pattern.d.ts.map | 1 + .../dist/commonjs/assert-valid-pattern.js | 14 + .../dist/commonjs/assert-valid-pattern.js.map | 1 + .../minimatch/dist/commonjs/ast.d.ts | 20 + .../minimatch/dist/commonjs/ast.d.ts.map | 1 + .../minimatch/dist/commonjs/ast.js | 592 + .../minimatch/dist/commonjs/ast.js.map | 1 + .../dist/commonjs/brace-expressions.d.ts | 8 + .../dist/commonjs/brace-expressions.d.ts.map | 1 + .../dist/commonjs/brace-expressions.js | 152 + .../dist/commonjs/brace-expressions.js.map | 1 + .../minimatch/dist/commonjs/escape.d.ts | 12 + .../minimatch/dist/commonjs/escape.d.ts.map | 1 + .../minimatch/dist/commonjs/escape.js | 22 + .../minimatch/dist/commonjs/escape.js.map | 1 + .../minimatch/dist/commonjs/index.d.ts | 94 + .../minimatch/dist/commonjs/index.d.ts.map | 1 + .../minimatch/dist/commonjs/index.js | 1017 + .../minimatch/dist/commonjs/index.js.map | 1 + .../minimatch/dist/commonjs/package.json | 3 + .../minimatch/dist/commonjs/unescape.d.ts | 17 + .../minimatch/dist/commonjs/unescape.d.ts.map | 1 + .../minimatch/dist/commonjs/unescape.js | 24 + .../minimatch/dist/commonjs/unescape.js.map | 1 + .../dist/esm/assert-valid-pattern.d.ts | 2 + .../dist/esm/assert-valid-pattern.d.ts.map | 1 + .../dist/esm/assert-valid-pattern.js | 10 + .../dist/esm/assert-valid-pattern.js.map | 1 + .../node_modules/minimatch/dist/esm/ast.d.ts | 20 + .../minimatch/dist/esm/ast.d.ts.map | 1 + .../node_modules/minimatch/dist/esm/ast.js | 588 + .../minimatch/dist/esm/ast.js.map | 1 + .../minimatch/dist/esm/brace-expressions.d.ts | 8 + .../dist/esm/brace-expressions.d.ts.map | 1 + .../minimatch/dist/esm/brace-expressions.js | 148 + .../dist/esm/brace-expressions.js.map | 1 + .../minimatch/dist/esm/escape.d.ts | 12 + .../minimatch/dist/esm/escape.d.ts.map | 1 + .../node_modules/minimatch/dist/esm/escape.js | 18 + .../minimatch/dist/esm/escape.js.map | 1 + .../minimatch/dist/esm/index.d.ts | 94 + .../minimatch/dist/esm/index.d.ts.map | 1 + .../node_modules/minimatch/dist/esm/index.js | 1001 + .../minimatch/dist/esm/index.js.map | 1 + .../minimatch/dist/esm/package.json | 3 + .../minimatch/dist/esm/unescape.d.ts | 17 + .../minimatch/dist/esm/unescape.d.ts.map | 1 + .../minimatch/dist/esm/unescape.js | 20 + .../minimatch/dist/esm/unescape.js.map | 1 + .../node_modules/minimatch/package.json | 82 + node_modules/sucrase/package.json | 88 + node_modules/sucrase/register/index.js | 1 + node_modules/sucrase/register/js.js | 1 + node_modules/sucrase/register/jsx.js | 1 + .../register/ts-legacy-module-interop.js | 1 + node_modules/sucrase/register/ts.js | 1 + .../register/tsx-legacy-module-interop.js | 1 + node_modules/sucrase/register/tsx.js | 1 + node_modules/sucrase/ts-node-plugin/index.js | 83 + node_modules/supports-color/browser.js | 5 + node_modules/supports-color/index.js | 135 + node_modules/supports-color/license | 9 + node_modules/supports-color/package.json | 53 + node_modules/supports-color/readme.md | 76 + .../supports-preserve-symlinks-flag/.eslintrc | 14 + .../.github/FUNDING.yml | 12 + .../supports-preserve-symlinks-flag/.nycrc | 9 + .../CHANGELOG.md | 22 + .../supports-preserve-symlinks-flag/LICENSE | 21 + .../supports-preserve-symlinks-flag/README.md | 42 + .../browser.js | 3 + .../supports-preserve-symlinks-flag/index.js | 9 + .../package.json | 70 + .../test/index.js | 29 + node_modules/tailwindcss/CHANGELOG.md | 2608 + node_modules/tailwindcss/LICENSE | 21 + node_modules/tailwindcss/README.md | 40 + node_modules/tailwindcss/base.css | 1 + node_modules/tailwindcss/colors.d.ts | 3 + node_modules/tailwindcss/colors.js | 2 + node_modules/tailwindcss/components.css | 1 + node_modules/tailwindcss/defaultConfig.d.ts | 3 + node_modules/tailwindcss/defaultConfig.js | 2 + node_modules/tailwindcss/defaultTheme.d.ts | 4 + node_modules/tailwindcss/defaultTheme.js | 2 + .../tailwindcss/lib/cli-peer-dependencies.js | 36 + node_modules/tailwindcss/lib/cli.js | 3 + .../tailwindcss/lib/cli/build/deps.js | 62 + .../tailwindcss/lib/cli/build/index.js | 54 + .../tailwindcss/lib/cli/build/plugin.js | 371 + .../tailwindcss/lib/cli/build/utils.js | 88 + .../tailwindcss/lib/cli/build/watching.js | 182 + .../tailwindcss/lib/cli/help/index.js | 73 + node_modules/tailwindcss/lib/cli/index.js | 230 + .../tailwindcss/lib/cli/init/index.js | 63 + .../tailwindcss/lib/corePluginList.js | 191 + node_modules/tailwindcss/lib/corePlugins.js | 4328 + node_modules/tailwindcss/lib/css/LICENSE | 25 + .../tailwindcss/lib/css/preflight.css | 386 + node_modules/tailwindcss/lib/featureFlags.js | 79 + node_modules/tailwindcss/lib/index.js | 2 + .../tailwindcss/lib/lib/cacheInvalidation.js | 92 + .../lib/lib/collapseAdjacentRules.js | 61 + .../lib/lib/collapseDuplicateDeclarations.js | 85 + node_modules/tailwindcss/lib/lib/content.js | 181 + .../tailwindcss/lib/lib/defaultExtractor.js | 251 + .../lib/lib/evaluateTailwindFunctions.js | 238 + .../tailwindcss/lib/lib/expandApplyAtRules.js | 553 + .../lib/lib/expandTailwindAtRules.js | 279 + .../tailwindcss/lib/lib/findAtConfigPath.js | 46 + .../tailwindcss/lib/lib/generateRules.js | 907 + .../lib/lib/getModuleDependencies.js | 99 + .../tailwindcss/lib/lib/load-config.js | 57 + .../lib/lib/normalizeTailwindDirectives.js | 89 + node_modules/tailwindcss/lib/lib/offsets.js | 355 + .../lib/lib/partitionApplyAtRules.js | 58 + node_modules/tailwindcss/lib/lib/regex.js | 74 + .../tailwindcss/lib/lib/remap-bitfield.js | 89 + .../lib/lib/resolveDefaultsAtRules.js | 167 + .../tailwindcss/lib/lib/setupContextUtils.js | 1298 + .../lib/lib/setupTrackingContext.js | 166 + .../tailwindcss/lib/lib/sharedState.js | 79 + .../lib/lib/substituteScreenAtRules.js | 31 + node_modules/tailwindcss/lib/plugin.js | 48 + .../lib/postcss-plugins/nesting/README.md | 42 + .../lib/postcss-plugins/nesting/index.js | 21 + .../lib/postcss-plugins/nesting/plugin.js | 89 + .../lib/processTailwindFeatures.js | 62 + node_modules/tailwindcss/lib/public/colors.js | 355 + .../tailwindcss/lib/public/create-plugin.js | 17 + .../tailwindcss/lib/public/default-config.js | 18 + .../tailwindcss/lib/public/default-theme.js | 18 + .../tailwindcss/lib/public/load-config.js | 12 + .../tailwindcss/lib/public/resolve-config.js | 24 + .../lib/util/applyImportantSelector.js | 36 + node_modules/tailwindcss/lib/util/bigSign.js | 13 + .../tailwindcss/lib/util/buildMediaQuery.js | 27 + .../tailwindcss/lib/util/cloneDeep.js | 22 + .../tailwindcss/lib/util/cloneNodes.js | 54 + node_modules/tailwindcss/lib/util/color.js | 116 + .../tailwindcss/lib/util/colorNames.js | 752 + .../tailwindcss/lib/util/configurePlugins.js | 23 + .../tailwindcss/lib/util/createPlugin.js | 32 + .../lib/util/createUtilityPlugin.js | 53 + .../tailwindcss/lib/util/dataTypes.js | 415 + node_modules/tailwindcss/lib/util/defaults.js | 27 + .../tailwindcss/lib/util/escapeClassName.js | 24 + .../tailwindcss/lib/util/escapeCommas.js | 13 + .../lib/util/flattenColorPalette.js | 18 + .../lib/util/formatVariantSelector.js | 270 + .../tailwindcss/lib/util/getAllConfigs.js | 50 + .../tailwindcss/lib/util/hashConfig.js | 21 + .../tailwindcss/lib/util/isKeyframeRule.js | 13 + .../tailwindcss/lib/util/isPlainObject.js | 17 + .../util/isSyntacticallyValidPropertyValue.js | 74 + node_modules/tailwindcss/lib/util/log.js | 61 + .../tailwindcss/lib/util/nameClass.js | 49 + .../tailwindcss/lib/util/negateValue.js | 36 + .../tailwindcss/lib/util/normalizeConfig.js | 282 + .../tailwindcss/lib/util/normalizeScreens.js | 178 + .../lib/util/parseAnimationValue.js | 93 + .../lib/util/parseBoxShadowValue.js | 88 + .../tailwindcss/lib/util/parseDependency.js | 47 + .../tailwindcss/lib/util/parseGlob.js | 36 + .../tailwindcss/lib/util/parseObjectStyles.js | 36 + .../tailwindcss/lib/util/pluginUtils.js | 289 + .../tailwindcss/lib/util/prefixSelector.js | 39 + .../tailwindcss/lib/util/pseudoElements.js | 212 + .../lib/util/removeAlphaVariables.js | 31 + .../tailwindcss/lib/util/resolveConfig.js | 256 + .../tailwindcss/lib/util/resolveConfigPath.js | 70 + .../tailwindcss/lib/util/responsive.js | 24 + .../lib/util/splitAtTopLevelOnly.js | 51 + node_modules/tailwindcss/lib/util/tap.js | 14 + .../tailwindcss/lib/util/toColorValue.js | 13 + node_modules/tailwindcss/lib/util/toPath.js | 32 + .../lib/util/transformThemeValue.js | 73 + .../tailwindcss/lib/util/validateConfig.js | 37 + .../lib/util/validateFormalSyntax.js | 26 + .../tailwindcss/lib/util/withAlphaVariable.js | 79 + .../tailwindcss/lib/value-parser/LICENSE | 22 + .../tailwindcss/lib/value-parser/README.md | 3 + .../tailwindcss/lib/value-parser/index.d.js | 2 + .../tailwindcss/lib/value-parser/index.js | 22 + .../tailwindcss/lib/value-parser/parse.js | 259 + .../tailwindcss/lib/value-parser/stringify.js | 38 + .../tailwindcss/lib/value-parser/unit.js | 86 + .../tailwindcss/lib/value-parser/walk.js | 16 + node_modules/tailwindcss/loadConfig.d.ts | 4 + node_modules/tailwindcss/loadConfig.js | 2 + node_modules/tailwindcss/nesting/index.d.ts | 4 + node_modules/tailwindcss/nesting/index.js | 2 + .../node_modules/glob-parent/LICENSE | 15 + .../node_modules/glob-parent/README.md | 134 + .../node_modules/glob-parent/index.js | 75 + .../node_modules/glob-parent/package.json | 54 + node_modules/tailwindcss/package.json | 118 + node_modules/tailwindcss/peers/index.js | 96792 ++++++++++++++++ node_modules/tailwindcss/plugin.d.ts | 11 + node_modules/tailwindcss/plugin.js | 2 + node_modules/tailwindcss/prettier.config.js | 19 + node_modules/tailwindcss/resolveConfig.d.ts | 31 + node_modules/tailwindcss/resolveConfig.js | 2 + node_modules/tailwindcss/screens.css | 1 + .../tailwindcss/scripts/create-plugin-list.js | 10 + .../tailwindcss/scripts/generate-types.js | 104 + .../tailwindcss/scripts/release-channel.js | 18 + .../tailwindcss/scripts/release-notes.js | 21 + .../tailwindcss/scripts/type-utils.js | 27 + .../tailwindcss/src/cli-peer-dependencies.js | 15 + node_modules/tailwindcss/src/cli.js | 3 + .../tailwindcss/src/cli/build/deps.js | 56 + .../tailwindcss/src/cli/build/index.js | 49 + .../tailwindcss/src/cli/build/plugin.js | 437 + .../tailwindcss/src/cli/build/utils.js | 76 + .../tailwindcss/src/cli/build/watching.js | 229 + .../tailwindcss/src/cli/help/index.js | 70 + node_modules/tailwindcss/src/cli/index.js | 216 + .../tailwindcss/src/cli/init/index.js | 79 + .../tailwindcss/src/corePluginList.js | 1 + node_modules/tailwindcss/src/corePlugins.js | 2990 + node_modules/tailwindcss/src/css/LICENSE | 25 + .../tailwindcss/src/css/preflight.css | 386 + node_modules/tailwindcss/src/featureFlags.js | 62 + node_modules/tailwindcss/src/index.js | 1 + .../tailwindcss/src/lib/cacheInvalidation.js | 52 + .../src/lib/collapseAdjacentRules.js | 58 + .../src/lib/collapseDuplicateDeclarations.js | 93 + node_modules/tailwindcss/src/lib/content.js | 208 + .../tailwindcss/src/lib/defaultExtractor.js | 230 + .../src/lib/evaluateTailwindFunctions.js | 272 + .../tailwindcss/src/lib/expandApplyAtRules.js | 637 + .../src/lib/expandTailwindAtRules.js | 282 + .../tailwindcss/src/lib/findAtConfigPath.js | 48 + .../tailwindcss/src/lib/generateRules.js | 951 + .../src/lib/getModuleDependencies.js | 79 + .../tailwindcss/src/lib/load-config.ts | 44 + .../src/lib/normalizeTailwindDirectives.js | 84 + node_modules/tailwindcss/src/lib/offsets.js | 432 + .../src/lib/partitionApplyAtRules.js | 52 + node_modules/tailwindcss/src/lib/regex.js | 74 + .../tailwindcss/src/lib/remap-bitfield.js | 82 + .../src/lib/resolveDefaultsAtRules.js | 167 + .../tailwindcss/src/lib/setupContextUtils.js | 1371 + .../src/lib/setupTrackingContext.js | 169 + .../tailwindcss/src/lib/sharedState.js | 57 + .../src/lib/substituteScreenAtRules.js | 19 + node_modules/tailwindcss/src/plugin.js | 47 + .../src/postcss-plugins/nesting/README.md | 42 + .../src/postcss-plugins/nesting/index.js | 13 + .../src/postcss-plugins/nesting/plugin.js | 80 + .../src/processTailwindFeatures.js | 56 + node_modules/tailwindcss/src/public/colors.js | 322 + .../tailwindcss/src/public/create-plugin.js | 2 + .../tailwindcss/src/public/default-config.js | 4 + .../tailwindcss/src/public/default-theme.js | 4 + .../tailwindcss/src/public/load-config.js | 2 + .../tailwindcss/src/public/resolve-config.js | 7 + .../src/util/applyImportantSelector.js | 27 + node_modules/tailwindcss/src/util/bigSign.js | 3 + .../tailwindcss/src/util/buildMediaQuery.js | 22 + .../tailwindcss/src/util/cloneDeep.js | 11 + .../tailwindcss/src/util/cloneNodes.js | 49 + node_modules/tailwindcss/src/util/color.js | 88 + .../tailwindcss/src/util/colorNames.js | 150 + .../tailwindcss/src/util/configurePlugins.js | 23 + .../tailwindcss/src/util/createPlugin.js | 27 + .../src/util/createUtilityPlugin.js | 37 + .../tailwindcss/src/util/dataTypes.js | 406 + node_modules/tailwindcss/src/util/defaults.js | 17 + .../tailwindcss/src/util/escapeClassName.js | 8 + .../tailwindcss/src/util/escapeCommas.js | 3 + .../src/util/flattenColorPalette.js | 13 + .../src/util/formatVariantSelector.js | 324 + .../tailwindcss/src/util/getAllConfigs.js | 38 + .../tailwindcss/src/util/hashConfig.js | 5 + .../tailwindcss/src/util/isKeyframeRule.js | 3 + .../tailwindcss/src/util/isPlainObject.js | 8 + .../util/isSyntacticallyValidPropertyValue.js | 61 + node_modules/tailwindcss/src/util/log.js | 29 + .../tailwindcss/src/util/nameClass.js | 30 + .../tailwindcss/src/util/negateValue.js | 24 + .../tailwindcss/src/util/normalizeConfig.js | 301 + .../tailwindcss/src/util/normalizeScreens.js | 140 + .../src/util/parseAnimationValue.js | 68 + .../src/util/parseBoxShadowValue.js | 72 + .../tailwindcss/src/util/parseDependency.js | 44 + .../tailwindcss/src/util/parseGlob.js | 24 + .../tailwindcss/src/util/parseObjectStyles.js | 19 + .../tailwindcss/src/util/pluginUtils.js | 307 + .../tailwindcss/src/util/prefixSelector.js | 33 + .../tailwindcss/src/util/pseudoElements.js | 171 + .../src/util/removeAlphaVariables.js | 24 + .../tailwindcss/src/util/resolveConfig.js | 277 + .../tailwindcss/src/util/resolveConfigPath.js | 66 + .../tailwindcss/src/util/responsive.js | 10 + .../src/util/splitAtTopLevelOnly.js | 52 + node_modules/tailwindcss/src/util/tap.js | 4 + .../tailwindcss/src/util/toColorValue.js | 3 + node_modules/tailwindcss/src/util/toPath.js | 26 + .../src/util/transformThemeValue.js | 62 + .../tailwindcss/src/util/validateConfig.js | 26 + .../src/util/validateFormalSyntax.js | 34 + .../tailwindcss/src/util/withAlphaVariable.js | 49 + .../tailwindcss/src/value-parser/LICENSE | 22 + .../tailwindcss/src/value-parser/README.md | 3 + .../tailwindcss/src/value-parser/index.d.ts | 177 + .../tailwindcss/src/value-parser/index.js | 28 + .../tailwindcss/src/value-parser/parse.js | 303 + .../tailwindcss/src/value-parser/stringify.js | 41 + .../tailwindcss/src/value-parser/unit.js | 118 + .../tailwindcss/src/value-parser/walk.js | 18 + node_modules/tailwindcss/stubs/.gitignore | 1 + .../tailwindcss/stubs/.prettierrc.json | 6 + node_modules/tailwindcss/stubs/config.full.js | 1062 + .../tailwindcss/stubs/config.simple.js | 7 + .../tailwindcss/stubs/postcss.config.cjs | 6 + .../tailwindcss/stubs/postcss.config.js | 6 + .../tailwindcss/stubs/tailwind.config.cjs | 2 + .../tailwindcss/stubs/tailwind.config.js | 2 + .../tailwindcss/stubs/tailwind.config.ts | 3 + node_modules/tailwindcss/tailwind.css | 5 + node_modules/tailwindcss/types/config.d.ts | 376 + .../tailwindcss/types/generated/.gitkeep | 0 .../tailwindcss/types/generated/colors.d.ts | 298 + .../types/generated/corePluginList.d.ts | 1 + .../types/generated/default-theme.d.ts | 397 + node_modules/tailwindcss/types/index.d.ts | 11 + node_modules/tailwindcss/utilities.css | 1 + node_modules/tailwindcss/variants.css | 1 + node_modules/thenify-all/History.md | 11 + node_modules/thenify-all/LICENSE | 22 + node_modules/thenify-all/README.md | 66 + node_modules/thenify-all/index.js | 73 + node_modules/thenify-all/package.json | 34 + node_modules/thenify/History.md | 11 + node_modules/thenify/LICENSE | 22 + node_modules/thenify/README.md | 120 + node_modules/thenify/index.js | 77 + node_modules/thenify/package.json | 31 + node_modules/to-fast-properties/index.js | 27 + node_modules/to-fast-properties/license | 10 + node_modules/to-fast-properties/package.json | 35 + node_modules/to-fast-properties/readme.md | 37 + node_modules/to-regex-range/LICENSE | 21 + node_modules/to-regex-range/README.md | 305 + node_modules/to-regex-range/index.js | 288 + node_modules/to-regex-range/package.json | 88 + node_modules/token-stream/.npmignore | 14 + node_modules/token-stream/.travis.yml | 16 + node_modules/token-stream/HISTORY.md | 5 + node_modules/token-stream/LICENSE | 19 + node_modules/token-stream/README.md | 68 + node_modules/token-stream/index.js | 30 + node_modules/token-stream/package.json | 19 + node_modules/token-stream/test/index.js | 46 + node_modules/ts-interface-checker/LICENSE | 201 + node_modules/ts-interface-checker/README.md | 185 + .../ts-interface-checker/dist/index.d.ts | 124 + .../ts-interface-checker/dist/index.js | 224 + .../ts-interface-checker/dist/types.d.ts | 181 + .../ts-interface-checker/dist/types.js | 566 + .../ts-interface-checker/dist/util.d.ts | 55 + .../ts-interface-checker/dist/util.js | 130 + .../ts-interface-checker/package.json | 60 + node_modules/uc.micro/CHANGELOG.md | 52 + node_modules/uc.micro/LICENSE.txt | 20 + node_modules/uc.micro/README.md | 14 + node_modules/uc.micro/categories/Cc/regex.js | 1 + node_modules/uc.micro/categories/Cf/regex.js | 1 + node_modules/uc.micro/categories/P/regex.js | 1 + node_modules/uc.micro/categories/Z/regex.js | 1 + node_modules/uc.micro/index.js | 7 + node_modules/uc.micro/package.json | 21 + node_modules/uc.micro/properties/Any/regex.js | 1 + node_modules/uglify-js/LICENSE | 29 + node_modules/uglify-js/README.md | 1479 + node_modules/uglify-js/bin/uglifyjs | 621 + node_modules/uglify-js/lib/ast.js | 2356 + node_modules/uglify-js/lib/compress.js | 14483 +++ node_modules/uglify-js/lib/minify.js | 277 + node_modules/uglify-js/lib/mozilla-ast.js | 1338 + node_modules/uglify-js/lib/output.js | 1959 + node_modules/uglify-js/lib/parse.js | 2589 + node_modules/uglify-js/lib/propmangle.js | 328 + node_modules/uglify-js/lib/scope.js | 883 + node_modules/uglify-js/lib/sourcemap.js | 195 + node_modules/uglify-js/lib/transform.js | 250 + node_modules/uglify-js/lib/utils.js | 300 + node_modules/uglify-js/package.json | 56 + node_modules/uglify-js/tools/domprops.html | 456 + node_modules/uglify-js/tools/domprops.json | 8327 ++ node_modules/uglify-js/tools/exports.js | 8 + node_modules/uglify-js/tools/node.js | 110 + node_modules/uglify-js/tools/tty.js | 22 + node_modules/undici-types/README.md | 6 + node_modules/undici-types/agent.d.ts | 31 + node_modules/undici-types/api.d.ts | 43 + node_modules/undici-types/balanced-pool.d.ts | 18 + node_modules/undici-types/cache.d.ts | 36 + node_modules/undici-types/client.d.ts | 97 + node_modules/undici-types/connector.d.ts | 34 + node_modules/undici-types/content-type.d.ts | 21 + node_modules/undici-types/cookies.d.ts | 28 + .../undici-types/diagnostics-channel.d.ts | 67 + node_modules/undici-types/dispatcher.d.ts | 241 + node_modules/undici-types/errors.d.ts | 128 + node_modules/undici-types/fetch.d.ts | 209 + node_modules/undici-types/file.d.ts | 39 + node_modules/undici-types/filereader.d.ts | 54 + node_modules/undici-types/formdata.d.ts | 108 + .../undici-types/global-dispatcher.d.ts | 9 + node_modules/undici-types/global-origin.d.ts | 7 + node_modules/undici-types/handlers.d.ts | 9 + node_modules/undici-types/header.d.ts | 4 + node_modules/undici-types/index.d.ts | 63 + node_modules/undici-types/interceptors.d.ts | 5 + node_modules/undici-types/mock-agent.d.ts | 50 + node_modules/undici-types/mock-client.d.ts | 25 + node_modules/undici-types/mock-errors.d.ts | 12 + .../undici-types/mock-interceptor.d.ts | 93 + node_modules/undici-types/mock-pool.d.ts | 25 + node_modules/undici-types/package.json | 55 + node_modules/undici-types/patch.d.ts | 71 + node_modules/undici-types/pool-stats.d.ts | 19 + node_modules/undici-types/pool.d.ts | 28 + node_modules/undici-types/proxy-agent.d.ts | 30 + node_modules/undici-types/readable.d.ts | 61 + node_modules/undici-types/webidl.d.ts | 220 + node_modules/undici-types/websocket.d.ts | 131 + node_modules/unpipe/HISTORY.md | 4 + node_modules/unpipe/LICENSE | 22 + node_modules/unpipe/README.md | 43 + node_modules/unpipe/index.js | 69 + node_modules/unpipe/package.json | 27 + node_modules/util-deprecate/History.md | 16 + node_modules/util-deprecate/LICENSE | 24 + node_modules/util-deprecate/README.md | 53 + node_modules/util-deprecate/browser.js | 67 + node_modules/util-deprecate/node.js | 6 + node_modules/util-deprecate/package.json | 27 + node_modules/void-elements/LICENSE | 22 + node_modules/void-elements/README.md | 27 + node_modules/void-elements/index.js | 21 + node_modules/void-elements/package.json | 34 + node_modules/which/CHANGELOG.md | 166 + node_modules/which/LICENSE | 15 + node_modules/which/README.md | 54 + node_modules/which/bin/node-which | 52 + node_modules/which/package.json | 43 + node_modules/which/which.js | 125 + node_modules/with/.babelrc | 9 + .../workflows/rollingversions-canary.yml | 40 + .../.github/workflows/rollingversions.yml | 38 + node_modules/with/.github/workflows/test.yml | 24 + node_modules/with/LICENSE | 19 + node_modules/with/README.md | 87 + node_modules/with/lib/globals.d.ts | 5 + node_modules/with/lib/globals.js | 190 + node_modules/with/lib/globals.js.map | 1 + node_modules/with/lib/index.d.ts | 8 + node_modules/with/lib/index.js | 148 + node_modules/with/lib/index.js.map | 1 + node_modules/with/lib/reference.d.ts | 2 + node_modules/with/lib/reference.js | 43 + node_modules/with/lib/reference.js.map | 1 + node_modules/with/package.json | 40 + node_modules/with/prettier.config.js | 1 + node_modules/with/src/globals.ts | 195 + node_modules/with/src/index.ts | 154 + node_modules/with/src/reference.ts | 24 + node_modules/with/tsconfig.json | 10 + node_modules/with/tslint.json | 7 + node_modules/wordwrap/LICENSE | 18 + node_modules/wordwrap/README.markdown | 70 + node_modules/wordwrap/example/center.js | 10 + node_modules/wordwrap/example/meat.js | 3 + node_modules/wordwrap/index.js | 76 + node_modules/wordwrap/package.json | 34 + node_modules/wordwrap/test/break.js | 32 + node_modules/wordwrap/test/idleness.txt | 63 + node_modules/wordwrap/test/wrap.js | 33 + node_modules/wrap-ansi-cjs/index.js | 216 + node_modules/wrap-ansi-cjs/license | 9 + .../node_modules/string-width/index.d.ts | 29 + .../node_modules/string-width/index.js | 47 + .../node_modules/string-width/license | 9 + .../node_modules/string-width/package.json | 56 + .../node_modules/string-width/readme.md | 50 + .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../node_modules/strip-ansi/readme.md | 46 + node_modules/wrap-ansi-cjs/package.json | 62 + node_modules/wrap-ansi-cjs/readme.md | 91 + node_modules/wrap-ansi/index.d.ts | 41 + node_modules/wrap-ansi/index.js | 214 + node_modules/wrap-ansi/license | 9 + .../node_modules/ansi-styles/index.d.ts | 236 + .../node_modules/ansi-styles/index.js | 223 + .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 54 + .../node_modules/ansi-styles/readme.md | 173 + node_modules/wrap-ansi/package.json | 69 + node_modules/wrap-ansi/readme.md | 91 + node_modules/wrappy/LICENSE | 15 + node_modules/wrappy/README.md | 36 + node_modules/wrappy/package.json | 29 + node_modules/wrappy/wrappy.js | 33 + node_modules/ws/LICENSE | 20 + node_modules/ws/README.md | 548 + node_modules/ws/browser.js | 8 + node_modules/ws/index.js | 13 + node_modules/ws/lib/buffer-util.js | 131 + node_modules/ws/lib/constants.js | 18 + node_modules/ws/lib/event-target.js | 292 + node_modules/ws/lib/extension.js | 203 + node_modules/ws/lib/limiter.js | 55 + node_modules/ws/lib/permessage-deflate.js | 514 + node_modules/ws/lib/receiver.js | 706 + node_modules/ws/lib/sender.js | 602 + node_modules/ws/lib/stream.js | 159 + node_modules/ws/lib/subprotocol.js | 62 + node_modules/ws/lib/validation.js | 152 + node_modules/ws/lib/websocket-server.js | 540 + node_modules/ws/lib/websocket.js | 1388 + node_modules/ws/package.json | 69 + node_modules/ws/wrapper.mjs | 8 + node_modules/yallist/LICENSE | 15 + node_modules/yallist/README.md | 204 + node_modules/yallist/iterator.js | 8 + node_modules/yallist/package.json | 29 + node_modules/yallist/yallist.js | 426 + node_modules/yaml/LICENSE | 13 + node_modules/yaml/README.md | 155 + node_modules/yaml/bin.mjs | 11 + .../dist/compose/compose-collection.js | 76 + .../yaml/browser/dist/compose/compose-doc.js | 42 + .../yaml/browser/dist/compose/compose-node.js | 92 + .../browser/dist/compose/compose-scalar.js | 80 + .../yaml/browser/dist/compose/composer.js | 217 + .../browser/dist/compose/resolve-block-map.js | 113 + .../dist/compose/resolve-block-scalar.js | 198 + .../browser/dist/compose/resolve-block-seq.js | 47 + .../yaml/browser/dist/compose/resolve-end.js | 37 + .../dist/compose/resolve-flow-collection.js | 201 + .../dist/compose/resolve-flow-scalar.js | 223 + .../browser/dist/compose/resolve-props.js | 148 + .../dist/compose/util-contains-newline.js | 34 + .../compose/util-empty-scalar-position.js | 27 + .../dist/compose/util-flow-indent-check.js | 15 + .../browser/dist/compose/util-map-includes.js | 17 + .../yaml/browser/dist/doc/Document.js | 334 + node_modules/yaml/browser/dist/doc/anchors.js | 72 + .../yaml/browser/dist/doc/applyReviver.js | 54 + .../yaml/browser/dist/doc/createNode.js | 89 + .../yaml/browser/dist/doc/directives.js | 176 + node_modules/yaml/browser/dist/errors.js | 57 + node_modules/yaml/browser/dist/index.js | 17 + node_modules/yaml/browser/dist/log.js | 16 + .../dist/node_modules/tslib/tslib.es6.js | 21 + node_modules/yaml/browser/dist/nodes/Alias.js | 101 + .../yaml/browser/dist/nodes/Collection.js | 148 + node_modules/yaml/browser/dist/nodes/Node.js | 38 + node_modules/yaml/browser/dist/nodes/Pair.js | 36 + .../yaml/browser/dist/nodes/Scalar.js | 24 + .../yaml/browser/dist/nodes/YAMLMap.js | 144 + .../yaml/browser/dist/nodes/YAMLSeq.js | 113 + .../yaml/browser/dist/nodes/addPairToJSMap.js | 104 + .../yaml/browser/dist/nodes/identity.js | 36 + node_modules/yaml/browser/dist/nodes/toJS.js | 37 + .../yaml/browser/dist/parse/cst-scalar.js | 214 + .../yaml/browser/dist/parse/cst-stringify.js | 61 + .../yaml/browser/dist/parse/cst-visit.js | 97 + node_modules/yaml/browser/dist/parse/cst.js | 98 + node_modules/yaml/browser/dist/parse/lexer.js | 721 + .../yaml/browser/dist/parse/line-counter.js | 39 + .../yaml/browser/dist/parse/parser.js | 952 + node_modules/yaml/browser/dist/public-api.js | 99 + .../yaml/browser/dist/schema/Schema.js | 38 + .../yaml/browser/dist/schema/common/map.js | 17 + .../yaml/browser/dist/schema/common/null.js | 15 + .../yaml/browser/dist/schema/common/seq.js | 17 + .../yaml/browser/dist/schema/common/string.js | 14 + .../yaml/browser/dist/schema/core/bool.js | 19 + .../yaml/browser/dist/schema/core/float.js | 43 + .../yaml/browser/dist/schema/core/int.js | 38 + .../yaml/browser/dist/schema/core/schema.js | 23 + .../yaml/browser/dist/schema/json/schema.js | 62 + node_modules/yaml/browser/dist/schema/tags.js | 83 + .../browser/dist/schema/yaml-1.1/binary.js | 66 + .../yaml/browser/dist/schema/yaml-1.1/bool.js | 26 + .../browser/dist/schema/yaml-1.1/float.js | 46 + .../yaml/browser/dist/schema/yaml-1.1/int.js | 71 + .../yaml/browser/dist/schema/yaml-1.1/omap.js | 74 + .../browser/dist/schema/yaml-1.1/pairs.js | 78 + .../browser/dist/schema/yaml-1.1/schema.js | 37 + .../yaml/browser/dist/schema/yaml-1.1/set.js | 93 + .../browser/dist/schema/yaml-1.1/timestamp.js | 101 + .../browser/dist/stringify/foldFlowLines.js | 144 + .../yaml/browser/dist/stringify/stringify.js | 124 + .../dist/stringify/stringifyCollection.js | 143 + .../dist/stringify/stringifyComment.js | 20 + .../dist/stringify/stringifyDocument.js | 85 + .../browser/dist/stringify/stringifyNumber.js | 24 + .../browser/dist/stringify/stringifyPair.js | 150 + .../browser/dist/stringify/stringifyString.js | 328 + node_modules/yaml/browser/dist/util.js | 11 + node_modules/yaml/browser/dist/visit.js | 233 + node_modules/yaml/browser/index.js | 5 + node_modules/yaml/browser/package.json | 3 + node_modules/yaml/dist/cli.d.ts | 9 + node_modules/yaml/dist/cli.mjs | 195 + .../yaml/dist/compose/compose-collection.d.ts | 5 + .../yaml/dist/compose/compose-collection.js | 78 + .../yaml/dist/compose/compose-doc.d.ts | 7 + node_modules/yaml/dist/compose/compose-doc.js | 44 + .../yaml/dist/compose/compose-node.d.ts | 27 + .../yaml/dist/compose/compose-node.js | 95 + .../yaml/dist/compose/compose-scalar.d.ts | 5 + .../yaml/dist/compose/compose-scalar.js | 82 + node_modules/yaml/dist/compose/composer.d.ts | 62 + node_modules/yaml/dist/compose/composer.js | 221 + .../yaml/dist/compose/resolve-block-map.d.ts | 7 + .../yaml/dist/compose/resolve-block-map.js | 115 + .../dist/compose/resolve-block-scalar.d.ts | 11 + .../yaml/dist/compose/resolve-block-scalar.js | 200 + .../yaml/dist/compose/resolve-block-seq.d.ts | 6 + .../yaml/dist/compose/resolve-block-seq.js | 49 + .../yaml/dist/compose/resolve-end.d.ts | 6 + node_modules/yaml/dist/compose/resolve-end.js | 39 + .../dist/compose/resolve-flow-collection.d.ts | 7 + .../dist/compose/resolve-flow-collection.js | 203 + .../dist/compose/resolve-flow-scalar.d.ts | 10 + .../yaml/dist/compose/resolve-flow-scalar.js | 225 + .../yaml/dist/compose/resolve-props.d.ts | 23 + .../yaml/dist/compose/resolve-props.js | 150 + .../dist/compose/util-contains-newline.d.ts | 2 + .../dist/compose/util-contains-newline.js | 36 + .../compose/util-empty-scalar-position.d.ts | 2 + .../compose/util-empty-scalar-position.js | 29 + .../dist/compose/util-flow-indent-check.d.ts | 3 + .../dist/compose/util-flow-indent-check.js | 17 + .../yaml/dist/compose/util-map-includes.d.ts | 4 + .../yaml/dist/compose/util-map-includes.js | 19 + node_modules/yaml/dist/doc/Document.d.ts | 141 + node_modules/yaml/dist/doc/Document.js | 336 + node_modules/yaml/dist/doc/anchors.d.ts | 24 + node_modules/yaml/dist/doc/anchors.js | 77 + node_modules/yaml/dist/doc/applyReviver.d.ts | 9 + node_modules/yaml/dist/doc/applyReviver.js | 56 + node_modules/yaml/dist/doc/createNode.d.ts | 17 + node_modules/yaml/dist/doc/createNode.js | 91 + node_modules/yaml/dist/doc/directives.d.ts | 49 + node_modules/yaml/dist/doc/directives.js | 178 + node_modules/yaml/dist/errors.d.ts | 21 + node_modules/yaml/dist/errors.js | 62 + node_modules/yaml/dist/index.d.ts | 22 + node_modules/yaml/dist/index.js | 50 + node_modules/yaml/dist/log.d.ts | 3 + node_modules/yaml/dist/log.js | 19 + node_modules/yaml/dist/nodes/Alias.d.ts | 28 + node_modules/yaml/dist/nodes/Alias.js | 103 + node_modules/yaml/dist/nodes/Collection.d.ts | 74 + node_modules/yaml/dist/nodes/Collection.js | 152 + node_modules/yaml/dist/nodes/Node.d.ts | 46 + node_modules/yaml/dist/nodes/Node.js | 40 + node_modules/yaml/dist/nodes/Pair.d.ts | 21 + node_modules/yaml/dist/nodes/Pair.js | 39 + node_modules/yaml/dist/nodes/Scalar.d.ts | 42 + node_modules/yaml/dist/nodes/Scalar.js | 27 + node_modules/yaml/dist/nodes/YAMLMap.d.ts | 53 + node_modules/yaml/dist/nodes/YAMLMap.js | 147 + node_modules/yaml/dist/nodes/YAMLSeq.d.ts | 60 + node_modules/yaml/dist/nodes/YAMLSeq.js | 115 + .../yaml/dist/nodes/addPairToJSMap.d.ts | 4 + .../yaml/dist/nodes/addPairToJSMap.js | 106 + node_modules/yaml/dist/nodes/identity.d.ts | 23 + node_modules/yaml/dist/nodes/identity.js | 53 + node_modules/yaml/dist/nodes/toJS.d.ts | 27 + node_modules/yaml/dist/nodes/toJS.js | 39 + node_modules/yaml/dist/options.d.ts | 338 + node_modules/yaml/dist/parse/cst-scalar.d.ts | 64 + node_modules/yaml/dist/parse/cst-scalar.js | 218 + .../yaml/dist/parse/cst-stringify.d.ts | 8 + node_modules/yaml/dist/parse/cst-stringify.js | 63 + node_modules/yaml/dist/parse/cst-visit.d.ts | 39 + node_modules/yaml/dist/parse/cst-visit.js | 99 + node_modules/yaml/dist/parse/cst.d.ts | 108 + node_modules/yaml/dist/parse/cst.js | 112 + node_modules/yaml/dist/parse/lexer.d.ts | 87 + node_modules/yaml/dist/parse/lexer.js | 723 + .../yaml/dist/parse/line-counter.d.ts | 22 + node_modules/yaml/dist/parse/line-counter.js | 41 + node_modules/yaml/dist/parse/parser.d.ts | 84 + node_modules/yaml/dist/parse/parser.js | 956 + node_modules/yaml/dist/public-api.d.ts | 43 + node_modules/yaml/dist/public-api.js | 104 + node_modules/yaml/dist/schema/Schema.d.ts | 18 + node_modules/yaml/dist/schema/Schema.js | 40 + node_modules/yaml/dist/schema/common/map.d.ts | 2 + node_modules/yaml/dist/schema/common/map.js | 19 + .../yaml/dist/schema/common/null.d.ts | 4 + node_modules/yaml/dist/schema/common/null.js | 17 + node_modules/yaml/dist/schema/common/seq.d.ts | 2 + node_modules/yaml/dist/schema/common/seq.js | 19 + .../yaml/dist/schema/common/string.d.ts | 2 + .../yaml/dist/schema/common/string.js | 16 + node_modules/yaml/dist/schema/core/bool.d.ts | 4 + node_modules/yaml/dist/schema/core/bool.js | 21 + node_modules/yaml/dist/schema/core/float.d.ts | 4 + node_modules/yaml/dist/schema/core/float.js | 47 + node_modules/yaml/dist/schema/core/int.d.ts | 4 + node_modules/yaml/dist/schema/core/int.js | 42 + .../yaml/dist/schema/core/schema.d.ts | 1 + node_modules/yaml/dist/schema/core/schema.js | 25 + .../yaml/dist/schema/json-schema.d.ts | 69 + .../yaml/dist/schema/json/schema.d.ts | 2 + node_modules/yaml/dist/schema/json/schema.js | 64 + node_modules/yaml/dist/schema/tags.d.ts | 40 + node_modules/yaml/dist/schema/tags.js | 86 + node_modules/yaml/dist/schema/types.d.ts | 90 + .../yaml/dist/schema/yaml-1.1/binary.d.ts | 2 + .../yaml/dist/schema/yaml-1.1/binary.js | 68 + .../yaml/dist/schema/yaml-1.1/bool.d.ts | 7 + .../yaml/dist/schema/yaml-1.1/bool.js | 29 + .../yaml/dist/schema/yaml-1.1/float.d.ts | 4 + .../yaml/dist/schema/yaml-1.1/float.js | 50 + .../yaml/dist/schema/yaml-1.1/int.d.ts | 5 + node_modules/yaml/dist/schema/yaml-1.1/int.js | 76 + .../yaml/dist/schema/yaml-1.1/omap.d.ts | 28 + .../yaml/dist/schema/yaml-1.1/omap.js | 77 + .../yaml/dist/schema/yaml-1.1/pairs.d.ts | 10 + .../yaml/dist/schema/yaml-1.1/pairs.js | 82 + .../yaml/dist/schema/yaml-1.1/schema.d.ts | 1 + .../yaml/dist/schema/yaml-1.1/schema.js | 39 + .../yaml/dist/schema/yaml-1.1/set.d.ts | 28 + node_modules/yaml/dist/schema/yaml-1.1/set.js | 96 + .../yaml/dist/schema/yaml-1.1/timestamp.d.ts | 6 + .../yaml/dist/schema/yaml-1.1/timestamp.js | 105 + .../yaml/dist/stringify/foldFlowLines.d.ts | 34 + .../yaml/dist/stringify/foldFlowLines.js | 149 + .../yaml/dist/stringify/stringify.d.ts | 21 + node_modules/yaml/dist/stringify/stringify.js | 127 + .../dist/stringify/stringifyCollection.d.ts | 17 + .../dist/stringify/stringifyCollection.js | 145 + .../yaml/dist/stringify/stringifyComment.d.ts | 10 + .../yaml/dist/stringify/stringifyComment.js | 24 + .../dist/stringify/stringifyDocument.d.ts | 4 + .../yaml/dist/stringify/stringifyDocument.js | 87 + .../yaml/dist/stringify/stringifyNumber.d.ts | 2 + .../yaml/dist/stringify/stringifyNumber.js | 26 + .../yaml/dist/stringify/stringifyPair.d.ts | 3 + .../yaml/dist/stringify/stringifyPair.js | 152 + .../yaml/dist/stringify/stringifyString.d.ts | 9 + .../yaml/dist/stringify/stringifyString.js | 330 + node_modules/yaml/dist/test-events.d.ts | 4 + node_modules/yaml/dist/test-events.js | 134 + node_modules/yaml/dist/util.d.ts | 12 + node_modules/yaml/dist/util.js | 28 + node_modules/yaml/dist/visit.d.ts | 102 + node_modules/yaml/dist/visit.js | 236 + node_modules/yaml/package.json | 98 + node_modules/yaml/util.js | 2 + package.json | 10 + src/index.html | 18 + src/style/base.css | 3 + tailwind.config.js | 10 + yarn.lock | 411 +- 4559 files changed, 785618 insertions(+), 12 deletions(-) create mode 100644 .yarnrc.yml delete mode 100644 _site/README/index.html delete mode 100644 _site/index.html create mode 100644 eleventy.config.js delete mode 100644 index.html create mode 120000 node_modules/.bin/acorn create mode 120000 node_modules/.bin/cssesc create mode 120000 node_modules/.bin/dev-ip create mode 120000 node_modules/.bin/ejs create mode 120000 node_modules/.bin/eleventy create mode 120000 node_modules/.bin/eleventy-dev-server create mode 120000 node_modules/.bin/errno create mode 120000 node_modules/.bin/esparse create mode 120000 node_modules/.bin/esvalidate create mode 120000 node_modules/.bin/handlebars create mode 120000 node_modules/.bin/jake create mode 120000 node_modules/.bin/jiti create mode 120000 node_modules/.bin/js-yaml create mode 120000 node_modules/.bin/liquid create mode 120000 node_modules/.bin/liquidjs create mode 120000 node_modules/.bin/markdown-it create mode 120000 node_modules/.bin/mime create mode 120000 node_modules/.bin/mkdirp create mode 120000 node_modules/.bin/mustache create mode 120000 node_modules/.bin/nanoid create mode 120000 node_modules/.bin/node-which create mode 120000 node_modules/.bin/nunjucks-precompile create mode 120000 node_modules/.bin/parser create mode 120000 node_modules/.bin/resolve create mode 120000 node_modules/.bin/rimraf create mode 120000 node_modules/.bin/semver create mode 120000 node_modules/.bin/sucrase create mode 120000 node_modules/.bin/sucrase-node create mode 120000 node_modules/.bin/tailwind create mode 120000 node_modules/.bin/tailwindcss create mode 120000 node_modules/.bin/uglifyjs create mode 120000 node_modules/.bin/yaml create mode 100644 node_modules/.yarn-state.yml create mode 100644 node_modules/@11ty/dependency-tree/LICENSE create mode 100644 node_modules/@11ty/dependency-tree/README.md create mode 100644 node_modules/@11ty/dependency-tree/main.js create mode 100644 node_modules/@11ty/dependency-tree/package.json create mode 100644 node_modules/@11ty/dependency-tree/test/mainTest.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/circular/circle-a.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/circular/circle-b.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/circular/circle-c.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-a.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-b.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-c.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/dotdot/dotdot.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/parent/child1.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/parent/child2.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/parent/grandchild.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/parent/greatgrandchild.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/parent/parent.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/simple.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/simple2.js create mode 100644 node_modules/@11ty/dependency-tree/test/stubs/uses_node_modules.js create mode 100644 node_modules/@11ty/eleventy-dev-server/README.md create mode 100644 node_modules/@11ty/eleventy-dev-server/cli.js create mode 100644 node_modules/@11ty/eleventy-dev-server/client/reload-client.js create mode 100755 node_modules/@11ty/eleventy-dev-server/cmd.js create mode 100644 node_modules/@11ty/eleventy-dev-server/package.json create mode 100644 node_modules/@11ty/eleventy-dev-server/server.js create mode 100644 node_modules/@11ty/eleventy-dev-server/server/wrapResponse.js create mode 100644 node_modules/@11ty/eleventy-utils/LICENSE create mode 100644 node_modules/@11ty/eleventy-utils/README.md create mode 100644 node_modules/@11ty/eleventy-utils/index.js create mode 100644 node_modules/@11ty/eleventy-utils/package.json create mode 100644 node_modules/@11ty/eleventy-utils/src/IsPlainObject.js create mode 100644 node_modules/@11ty/eleventy-utils/src/Merge.js create mode 100644 node_modules/@11ty/eleventy-utils/src/TemplatePath.js create mode 100644 node_modules/@11ty/eleventy/CODE_OF_CONDUCT.md create mode 100644 node_modules/@11ty/eleventy/LICENSE create mode 100644 node_modules/@11ty/eleventy/README.md create mode 100644 node_modules/@11ty/eleventy/SECURITY.md create mode 100755 node_modules/@11ty/eleventy/cmd.js create mode 100755 node_modules/@11ty/eleventy/package.json create mode 100644 node_modules/@11ty/eleventy/src/Benchmark.js create mode 100644 node_modules/@11ty/eleventy/src/BenchmarkGroup.js create mode 100644 node_modules/@11ty/eleventy/src/BenchmarkManager.js create mode 100644 node_modules/@11ty/eleventy/src/ComputedData.js create mode 100644 node_modules/@11ty/eleventy/src/ComputedDataProxy.js create mode 100644 node_modules/@11ty/eleventy/src/ComputedDataQueue.js create mode 100644 node_modules/@11ty/eleventy/src/ComputedDataTemplateString.js create mode 100644 node_modules/@11ty/eleventy/src/Eleventy.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyBaseError.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyCommandCheckError.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyErrorHandler.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyErrorUtil.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyExtensionMap.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyFiles.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyServe.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyShortcodeError.js create mode 100755 node_modules/@11ty/eleventy/src/EleventyWatch.js create mode 100644 node_modules/@11ty/eleventy/src/EleventyWatchTargets.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Custom.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Ejs.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Haml.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Handlebars.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Html.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/JavaScript.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Liquid.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Markdown.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Mustache.js create mode 100755 node_modules/@11ty/eleventy/src/Engines/Nunjucks.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/Pug.js create mode 100644 node_modules/@11ty/eleventy/src/Engines/TemplateEngine.js create mode 100644 node_modules/@11ty/eleventy/src/Errors/TemplateContentPrematureUseError.js create mode 100644 node_modules/@11ty/eleventy/src/Errors/TemplateContentUnrenderedTemplateError.js create mode 100644 node_modules/@11ty/eleventy/src/Errors/UsingCircularTemplateContentReferenceError.js create mode 100644 node_modules/@11ty/eleventy/src/EventBus.js create mode 100644 node_modules/@11ty/eleventy/src/FileSystemSearch.js create mode 100644 node_modules/@11ty/eleventy/src/Filters/GetCollectionItem.js create mode 100644 node_modules/@11ty/eleventy/src/Filters/GetCollectionItemIndex.js create mode 100644 node_modules/@11ty/eleventy/src/Filters/GetLocaleCollectionItem.js create mode 100644 node_modules/@11ty/eleventy/src/Filters/ServerlessUrl.js create mode 100644 node_modules/@11ty/eleventy/src/Filters/Slug.js create mode 100644 node_modules/@11ty/eleventy/src/Filters/Slugify.js create mode 100644 node_modules/@11ty/eleventy/src/Filters/Url.js create mode 100644 node_modules/@11ty/eleventy/src/GlobalDependencyMap.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/DefaultEdgeFunctionContent.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/DefaultServerlessFunctionContent.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/Edge/EdgeTemplateDataID.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/Edge/LiquidEdge.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/Edge/NunjucksEdge.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/Edge/PrecompiledNunjucks.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/EdgePlugin.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/HtmlBasePlugin.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/I18nPlugin.js create mode 100755 node_modules/@11ty/eleventy/src/Plugins/Pagination.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/RenderPlugin.d.ts create mode 100644 node_modules/@11ty/eleventy/src/Plugins/RenderPlugin.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/Serverless/NetlifyRedirects.js create mode 100644 node_modules/@11ty/eleventy/src/Plugins/ServerlessBundlerPlugin.js create mode 100644 node_modules/@11ty/eleventy/src/Serverless.js create mode 100755 node_modules/@11ty/eleventy/src/Template.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateBehavior.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateCache.js create mode 100755 node_modules/@11ty/eleventy/src/TemplateCollection.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateConfig.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateContent.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateData.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateDataInitialGlobalData.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateEngineManager.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateFileSlug.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateGlob.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateLayout.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateLayoutPathResolver.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateMap.js create mode 100644 node_modules/@11ty/eleventy/src/TemplatePassthrough.js create mode 100644 node_modules/@11ty/eleventy/src/TemplatePassthroughManager.js create mode 100644 node_modules/@11ty/eleventy/src/TemplatePermalink.js create mode 100644 node_modules/@11ty/eleventy/src/TemplateRender.js create mode 100755 node_modules/@11ty/eleventy/src/TemplateWriter.js create mode 100644 node_modules/@11ty/eleventy/src/UserConfig.js create mode 100644 node_modules/@11ty/eleventy/src/Util/AsyncEventEmitter.js create mode 100644 node_modules/@11ty/eleventy/src/Util/Compatibility.js create mode 100644 node_modules/@11ty/eleventy/src/Util/ConsoleLogger.js create mode 100644 node_modules/@11ty/eleventy/src/Util/DateGitFirstAdded.js create mode 100644 node_modules/@11ty/eleventy/src/Util/DateGitLastUpdated.js create mode 100644 node_modules/@11ty/eleventy/src/Util/DeleteRequireCache.js create mode 100644 node_modules/@11ty/eleventy/src/Util/DirContains.js create mode 100644 node_modules/@11ty/eleventy/src/Util/EventBusUtil.js create mode 100644 node_modules/@11ty/eleventy/src/Util/GetJavaScriptData.js create mode 100644 node_modules/@11ty/eleventy/src/Util/JavaScriptDependencies.js create mode 100644 node_modules/@11ty/eleventy/src/Util/Merge.js create mode 100644 node_modules/@11ty/eleventy/src/Util/NormalizeServerlessUrl.js create mode 100644 node_modules/@11ty/eleventy/src/Util/PassthroughCopyBehaviorCheck.js create mode 100644 node_modules/@11ty/eleventy/src/Util/PathNormalizer.js create mode 100644 node_modules/@11ty/eleventy/src/Util/PathPrefixer.js create mode 100644 node_modules/@11ty/eleventy/src/Util/Pluralize.js create mode 100644 node_modules/@11ty/eleventy/src/Util/ProxyWrap.js create mode 100644 node_modules/@11ty/eleventy/src/Util/Require.js create mode 100644 node_modules/@11ty/eleventy/src/Util/Sortable.js create mode 100644 node_modules/@11ty/eleventy/src/Util/Unique.js create mode 100644 node_modules/@11ty/eleventy/src/defaultConfig.js create mode 100644 node_modules/@11ty/eleventy/src/index.d.ts create mode 100644 node_modules/@11ty/lodash-custom/README.md create mode 100644 node_modules/@11ty/lodash-custom/lodash.custom.js create mode 100644 node_modules/@11ty/lodash-custom/package.json create mode 100644 node_modules/@alloc/quick-lru/index.d.ts create mode 100644 node_modules/@alloc/quick-lru/index.js create mode 100644 node_modules/@alloc/quick-lru/license create mode 100644 node_modules/@alloc/quick-lru/package.json create mode 100644 node_modules/@alloc/quick-lru/readme.md create mode 100644 node_modules/@babel/helper-string-parser/LICENSE create mode 100644 node_modules/@babel/helper-string-parser/README.md create mode 100644 node_modules/@babel/helper-string-parser/lib/index.js create mode 100644 node_modules/@babel/helper-string-parser/lib/index.js.map create mode 100644 node_modules/@babel/helper-string-parser/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/LICENSE create mode 100644 node_modules/@babel/helper-validator-identifier/README.md create mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js create mode 100644 node_modules/@babel/parser/CHANGELOG.md create mode 100644 node_modules/@babel/parser/LICENSE create mode 100644 node_modules/@babel/parser/README.md create mode 100755 node_modules/@babel/parser/bin/babel-parser.js create mode 100644 node_modules/@babel/parser/index.cjs create mode 100644 node_modules/@babel/parser/lib/index.js create mode 100644 node_modules/@babel/parser/lib/index.js.map create mode 100644 node_modules/@babel/parser/package.json create mode 100644 node_modules/@babel/parser/typings/babel-parser.d.ts create mode 100644 node_modules/@babel/types/LICENSE create mode 100644 node_modules/@babel/types/README.md create mode 100644 node_modules/@babel/types/lib/asserts/assertNode.js create mode 100644 node_modules/@babel/types/lib/asserts/assertNode.js.map create mode 100644 node_modules/@babel/types/lib/asserts/generated/index.js create mode 100644 node_modules/@babel/types/lib/asserts/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/ast-types/generated/index.js create mode 100644 node_modules/@babel/types/lib/ast-types/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js create mode 100644 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map create mode 100644 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js create mode 100644 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map create mode 100644 node_modules/@babel/types/lib/builders/generated/index.js create mode 100644 node_modules/@babel/types/lib/builders/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/builders/generated/uppercase.js create mode 100644 node_modules/@babel/types/lib/builders/generated/uppercase.js.map create mode 100644 node_modules/@babel/types/lib/builders/productions.js create mode 100644 node_modules/@babel/types/lib/builders/productions.js.map create mode 100644 node_modules/@babel/types/lib/builders/react/buildChildren.js create mode 100644 node_modules/@babel/types/lib/builders/react/buildChildren.js.map create mode 100644 node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js create mode 100644 node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map create mode 100644 node_modules/@babel/types/lib/builders/validateNode.js create mode 100644 node_modules/@babel/types/lib/builders/validateNode.js.map create mode 100644 node_modules/@babel/types/lib/clone/clone.js create mode 100644 node_modules/@babel/types/lib/clone/clone.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneDeep.js create mode 100644 node_modules/@babel/types/lib/clone/cloneDeep.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js create mode 100644 node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneNode.js create mode 100644 node_modules/@babel/types/lib/clone/cloneNode.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneWithoutLoc.js create mode 100644 node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map create mode 100644 node_modules/@babel/types/lib/comments/addComment.js create mode 100644 node_modules/@babel/types/lib/comments/addComment.js.map create mode 100644 node_modules/@babel/types/lib/comments/addComments.js create mode 100644 node_modules/@babel/types/lib/comments/addComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritInnerComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritInnerComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritLeadingComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritTrailingComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritsComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritsComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/removeComments.js create mode 100644 node_modules/@babel/types/lib/comments/removeComments.js.map create mode 100644 node_modules/@babel/types/lib/constants/generated/index.js create mode 100644 node_modules/@babel/types/lib/constants/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/constants/index.js create mode 100644 node_modules/@babel/types/lib/constants/index.js.map create mode 100644 node_modules/@babel/types/lib/converters/ensureBlock.js create mode 100644 node_modules/@babel/types/lib/converters/ensureBlock.js.map create mode 100644 node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js create mode 100644 node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map create mode 100644 node_modules/@babel/types/lib/converters/toBindingIdentifierName.js create mode 100644 node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map create mode 100644 node_modules/@babel/types/lib/converters/toBlock.js create mode 100644 node_modules/@babel/types/lib/converters/toBlock.js.map create mode 100644 node_modules/@babel/types/lib/converters/toComputedKey.js create mode 100644 node_modules/@babel/types/lib/converters/toComputedKey.js.map create mode 100644 node_modules/@babel/types/lib/converters/toExpression.js create mode 100644 node_modules/@babel/types/lib/converters/toExpression.js.map create mode 100644 node_modules/@babel/types/lib/converters/toIdentifier.js create mode 100644 node_modules/@babel/types/lib/converters/toIdentifier.js.map create mode 100644 node_modules/@babel/types/lib/converters/toKeyAlias.js create mode 100644 node_modules/@babel/types/lib/converters/toKeyAlias.js.map create mode 100644 node_modules/@babel/types/lib/converters/toSequenceExpression.js create mode 100644 node_modules/@babel/types/lib/converters/toSequenceExpression.js.map create mode 100644 node_modules/@babel/types/lib/converters/toStatement.js create mode 100644 node_modules/@babel/types/lib/converters/toStatement.js.map create mode 100644 node_modules/@babel/types/lib/converters/valueToNode.js create mode 100644 node_modules/@babel/types/lib/converters/valueToNode.js.map create mode 100644 node_modules/@babel/types/lib/definitions/core.js create mode 100644 node_modules/@babel/types/lib/definitions/core.js.map create mode 100644 node_modules/@babel/types/lib/definitions/deprecated-aliases.js create mode 100644 node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map create mode 100644 node_modules/@babel/types/lib/definitions/experimental.js create mode 100644 node_modules/@babel/types/lib/definitions/experimental.js.map create mode 100644 node_modules/@babel/types/lib/definitions/flow.js create mode 100644 node_modules/@babel/types/lib/definitions/flow.js.map create mode 100644 node_modules/@babel/types/lib/definitions/index.js create mode 100644 node_modules/@babel/types/lib/definitions/index.js.map create mode 100644 node_modules/@babel/types/lib/definitions/jsx.js create mode 100644 node_modules/@babel/types/lib/definitions/jsx.js.map create mode 100644 node_modules/@babel/types/lib/definitions/misc.js create mode 100644 node_modules/@babel/types/lib/definitions/misc.js.map create mode 100644 node_modules/@babel/types/lib/definitions/placeholders.js create mode 100644 node_modules/@babel/types/lib/definitions/placeholders.js.map create mode 100644 node_modules/@babel/types/lib/definitions/typescript.js create mode 100644 node_modules/@babel/types/lib/definitions/typescript.js.map create mode 100644 node_modules/@babel/types/lib/definitions/utils.js create mode 100644 node_modules/@babel/types/lib/definitions/utils.js.map create mode 100644 node_modules/@babel/types/lib/index-legacy.d.ts create mode 100644 node_modules/@babel/types/lib/index.d.ts create mode 100644 node_modules/@babel/types/lib/index.js create mode 100644 node_modules/@babel/types/lib/index.js.flow create mode 100644 node_modules/@babel/types/lib/index.js.map create mode 100644 node_modules/@babel/types/lib/modifications/appendToMemberExpression.js create mode 100644 node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map create mode 100644 node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js create mode 100644 node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map create mode 100644 node_modules/@babel/types/lib/modifications/inherits.js create mode 100644 node_modules/@babel/types/lib/modifications/inherits.js.map create mode 100644 node_modules/@babel/types/lib/modifications/prependToMemberExpression.js create mode 100644 node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map create mode 100644 node_modules/@babel/types/lib/modifications/removeProperties.js create mode 100644 node_modules/@babel/types/lib/modifications/removeProperties.js.map create mode 100644 node_modules/@babel/types/lib/modifications/removePropertiesDeep.js create mode 100644 node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map create mode 100644 node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js create mode 100644 node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map create mode 100644 node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js create mode 100644 node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map create mode 100644 node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js create mode 100644 node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map create mode 100644 node_modules/@babel/types/lib/traverse/traverse.js create mode 100644 node_modules/@babel/types/lib/traverse/traverse.js.map create mode 100644 node_modules/@babel/types/lib/traverse/traverseFast.js create mode 100644 node_modules/@babel/types/lib/traverse/traverseFast.js.map create mode 100644 node_modules/@babel/types/lib/utils/deprecationWarning.js create mode 100644 node_modules/@babel/types/lib/utils/deprecationWarning.js.map create mode 100644 node_modules/@babel/types/lib/utils/inherit.js create mode 100644 node_modules/@babel/types/lib/utils/inherit.js.map create mode 100644 node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js create mode 100644 node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map create mode 100644 node_modules/@babel/types/lib/utils/shallowEqual.js create mode 100644 node_modules/@babel/types/lib/utils/shallowEqual.js.map create mode 100644 node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js create mode 100644 node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map create mode 100644 node_modules/@babel/types/lib/validators/generated/index.js create mode 100644 node_modules/@babel/types/lib/validators/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/validators/is.js create mode 100644 node_modules/@babel/types/lib/validators/is.js.map create mode 100644 node_modules/@babel/types/lib/validators/isBinding.js create mode 100644 node_modules/@babel/types/lib/validators/isBinding.js.map create mode 100644 node_modules/@babel/types/lib/validators/isBlockScoped.js create mode 100644 node_modules/@babel/types/lib/validators/isBlockScoped.js.map create mode 100644 node_modules/@babel/types/lib/validators/isImmutable.js create mode 100644 node_modules/@babel/types/lib/validators/isImmutable.js.map create mode 100644 node_modules/@babel/types/lib/validators/isLet.js create mode 100644 node_modules/@babel/types/lib/validators/isLet.js.map create mode 100644 node_modules/@babel/types/lib/validators/isNode.js create mode 100644 node_modules/@babel/types/lib/validators/isNode.js.map create mode 100644 node_modules/@babel/types/lib/validators/isNodesEquivalent.js create mode 100644 node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map create mode 100644 node_modules/@babel/types/lib/validators/isPlaceholderType.js create mode 100644 node_modules/@babel/types/lib/validators/isPlaceholderType.js.map create mode 100644 node_modules/@babel/types/lib/validators/isReferenced.js create mode 100644 node_modules/@babel/types/lib/validators/isReferenced.js.map create mode 100644 node_modules/@babel/types/lib/validators/isScope.js create mode 100644 node_modules/@babel/types/lib/validators/isScope.js.map create mode 100644 node_modules/@babel/types/lib/validators/isSpecifierDefault.js create mode 100644 node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map create mode 100644 node_modules/@babel/types/lib/validators/isType.js create mode 100644 node_modules/@babel/types/lib/validators/isType.js.map create mode 100644 node_modules/@babel/types/lib/validators/isValidES3Identifier.js create mode 100644 node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map create mode 100644 node_modules/@babel/types/lib/validators/isValidIdentifier.js create mode 100644 node_modules/@babel/types/lib/validators/isValidIdentifier.js.map create mode 100644 node_modules/@babel/types/lib/validators/isVar.js create mode 100644 node_modules/@babel/types/lib/validators/isVar.js.map create mode 100644 node_modules/@babel/types/lib/validators/matchesPattern.js create mode 100644 node_modules/@babel/types/lib/validators/matchesPattern.js.map create mode 100644 node_modules/@babel/types/lib/validators/react/isCompatTag.js create mode 100644 node_modules/@babel/types/lib/validators/react/isCompatTag.js.map create mode 100644 node_modules/@babel/types/lib/validators/react/isReactComponent.js create mode 100644 node_modules/@babel/types/lib/validators/react/isReactComponent.js.map create mode 100644 node_modules/@babel/types/lib/validators/validate.js create mode 100644 node_modules/@babel/types/lib/validators/validate.js.map create mode 100644 node_modules/@babel/types/package.json create mode 100644 node_modules/@catppuccin/tailwindcss/LICENSE create mode 100644 node_modules/@catppuccin/tailwindcss/README.md create mode 100644 node_modules/@catppuccin/tailwindcss/dist/index.d.ts create mode 100644 node_modules/@catppuccin/tailwindcss/dist/index.js create mode 100644 node_modules/@catppuccin/tailwindcss/package.json create mode 100755 node_modules/@iarna/toml/CHANGELOG.md create mode 100755 node_modules/@iarna/toml/LICENSE create mode 100755 node_modules/@iarna/toml/README.md create mode 100755 node_modules/@iarna/toml/index.d.ts create mode 100755 node_modules/@iarna/toml/lib/create-date.js create mode 100755 node_modules/@iarna/toml/lib/create-datetime-float.js create mode 100755 node_modules/@iarna/toml/lib/create-datetime.js create mode 100755 node_modules/@iarna/toml/lib/create-time.js create mode 100755 node_modules/@iarna/toml/lib/format-num.js create mode 100755 node_modules/@iarna/toml/lib/parser-debug.js create mode 100755 node_modules/@iarna/toml/lib/parser.js create mode 100755 node_modules/@iarna/toml/lib/toml-parser.js create mode 100755 node_modules/@iarna/toml/package.json create mode 100755 node_modules/@iarna/toml/parse-async.js create mode 100755 node_modules/@iarna/toml/parse-pretty-error.js create mode 100755 node_modules/@iarna/toml/parse-stream.js create mode 100755 node_modules/@iarna/toml/parse-string.js create mode 100755 node_modules/@iarna/toml/parse.js create mode 100755 node_modules/@iarna/toml/stringify.js create mode 100755 node_modules/@iarna/toml/toml.js create mode 100644 node_modules/@isaacs/cliui/LICENSE.txt create mode 100644 node_modules/@isaacs/cliui/README.md create mode 100644 node_modules/@isaacs/cliui/build/index.cjs create mode 100644 node_modules/@isaacs/cliui/build/index.d.cts create mode 100644 node_modules/@isaacs/cliui/build/lib/index.js create mode 100644 node_modules/@isaacs/cliui/index.mjs create mode 100644 node_modules/@isaacs/cliui/package.json create mode 100644 node_modules/@jridgewell/gen-mapping/LICENSE create mode 100644 node_modules/@jridgewell/gen-mapping/README.md create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/package.json create mode 100644 node_modules/@jridgewell/resolve-uri/LICENSE create mode 100644 node_modules/@jridgewell/resolve-uri/README.md create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map create mode 100644 node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts create mode 100644 node_modules/@jridgewell/resolve-uri/package.json create mode 100644 node_modules/@jridgewell/set-array/LICENSE create mode 100644 node_modules/@jridgewell/set-array/README.md create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs.map create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js.map create mode 100644 node_modules/@jridgewell/set-array/dist/types/set-array.d.ts create mode 100644 node_modules/@jridgewell/set-array/package.json create mode 100644 node_modules/@jridgewell/sourcemap-codec/LICENSE create mode 100644 node_modules/@jridgewell/sourcemap-codec/README.md create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts create mode 100644 node_modules/@jridgewell/sourcemap-codec/package.json create mode 100644 node_modules/@jridgewell/trace-mapping/LICENSE create mode 100644 node_modules/@jridgewell/trace-mapping/README.md create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/package.json create mode 100644 node_modules/@nodelib/fs.scandir/LICENSE create mode 100644 node_modules/@nodelib/fs.scandir/README.md create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.js create mode 100644 node_modules/@nodelib/fs.scandir/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.js create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.js create mode 100644 node_modules/@nodelib/fs.scandir/package.json create mode 100644 node_modules/@nodelib/fs.stat/LICENSE create mode 100644 node_modules/@nodelib/fs.stat/README.md create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.stat/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/index.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.stat/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/settings.js create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.js create mode 100644 node_modules/@nodelib/fs.stat/package.json create mode 100644 node_modules/@nodelib/fs.walk/LICENSE create mode 100644 node_modules/@nodelib/fs.walk/README.md create mode 100644 node_modules/@nodelib/fs.walk/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/settings.js create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.js create mode 100644 node_modules/@nodelib/fs.walk/package.json create mode 100644 node_modules/@pkgjs/parseargs/.editorconfig create mode 100644 node_modules/@pkgjs/parseargs/CHANGELOG.md create mode 100644 node_modules/@pkgjs/parseargs/LICENSE create mode 100644 node_modules/@pkgjs/parseargs/README.md create mode 100644 node_modules/@pkgjs/parseargs/examples/is-default-value.js create mode 100644 node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js create mode 100644 node_modules/@pkgjs/parseargs/examples/negate.js create mode 100644 node_modules/@pkgjs/parseargs/examples/no-repeated-options.js create mode 100644 node_modules/@pkgjs/parseargs/examples/ordered-options.mjs create mode 100644 node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js create mode 100644 node_modules/@pkgjs/parseargs/index.js create mode 100644 node_modules/@pkgjs/parseargs/internal/errors.js create mode 100644 node_modules/@pkgjs/parseargs/internal/primordials.js create mode 100644 node_modules/@pkgjs/parseargs/internal/util.js create mode 100644 node_modules/@pkgjs/parseargs/internal/validators.js create mode 100644 node_modules/@pkgjs/parseargs/package.json create mode 100644 node_modules/@pkgjs/parseargs/utils.js create mode 100644 node_modules/@sindresorhus/slugify/index.d.ts create mode 100644 node_modules/@sindresorhus/slugify/index.js create mode 100644 node_modules/@sindresorhus/slugify/license create mode 100644 node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp/index.d.ts create mode 100644 node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp/index.js create mode 100644 node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp/license create mode 100644 node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp/package.json create mode 100644 node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/@sindresorhus/slugify/overridable-replacements.js create mode 100644 node_modules/@sindresorhus/slugify/package.json create mode 100644 node_modules/@sindresorhus/slugify/readme.md create mode 100644 node_modules/@sindresorhus/transliterate/index.d.ts create mode 100644 node_modules/@sindresorhus/transliterate/index.js create mode 100644 node_modules/@sindresorhus/transliterate/license create mode 100644 node_modules/@sindresorhus/transliterate/package.json create mode 100644 node_modules/@sindresorhus/transliterate/readme.md create mode 100644 node_modules/@sindresorhus/transliterate/replacements.js create mode 100755 node_modules/@types/minimatch/LICENSE create mode 100755 node_modules/@types/minimatch/README.md create mode 100755 node_modules/@types/minimatch/index.d.ts create mode 100755 node_modules/@types/minimatch/package.json create mode 100644 node_modules/@types/node/LICENSE create mode 100644 node_modules/@types/node/README.md create mode 100644 node_modules/@types/node/assert.d.ts create mode 100644 node_modules/@types/node/assert/strict.d.ts create mode 100644 node_modules/@types/node/async_hooks.d.ts create mode 100644 node_modules/@types/node/buffer.d.ts create mode 100644 node_modules/@types/node/child_process.d.ts create mode 100644 node_modules/@types/node/cluster.d.ts create mode 100644 node_modules/@types/node/console.d.ts create mode 100644 node_modules/@types/node/constants.d.ts create mode 100644 node_modules/@types/node/crypto.d.ts create mode 100644 node_modules/@types/node/dgram.d.ts create mode 100644 node_modules/@types/node/diagnostics_channel.d.ts create mode 100644 node_modules/@types/node/dns.d.ts create mode 100644 node_modules/@types/node/dns/promises.d.ts create mode 100644 node_modules/@types/node/dom-events.d.ts create mode 100644 node_modules/@types/node/domain.d.ts create mode 100644 node_modules/@types/node/events.d.ts create mode 100644 node_modules/@types/node/fs.d.ts create mode 100644 node_modules/@types/node/fs/promises.d.ts create mode 100644 node_modules/@types/node/globals.d.ts create mode 100644 node_modules/@types/node/globals.global.d.ts create mode 100644 node_modules/@types/node/http.d.ts create mode 100644 node_modules/@types/node/http2.d.ts create mode 100644 node_modules/@types/node/https.d.ts create mode 100644 node_modules/@types/node/index.d.ts create mode 100644 node_modules/@types/node/inspector.d.ts create mode 100644 node_modules/@types/node/module.d.ts create mode 100644 node_modules/@types/node/net.d.ts create mode 100644 node_modules/@types/node/os.d.ts create mode 100644 node_modules/@types/node/package.json create mode 100644 node_modules/@types/node/path.d.ts create mode 100644 node_modules/@types/node/perf_hooks.d.ts create mode 100644 node_modules/@types/node/process.d.ts create mode 100644 node_modules/@types/node/punycode.d.ts create mode 100644 node_modules/@types/node/querystring.d.ts create mode 100644 node_modules/@types/node/readline.d.ts create mode 100644 node_modules/@types/node/readline/promises.d.ts create mode 100644 node_modules/@types/node/repl.d.ts create mode 100644 node_modules/@types/node/sea.d.ts create mode 100644 node_modules/@types/node/stream.d.ts create mode 100644 node_modules/@types/node/stream/consumers.d.ts create mode 100644 node_modules/@types/node/stream/promises.d.ts create mode 100644 node_modules/@types/node/stream/web.d.ts create mode 100644 node_modules/@types/node/string_decoder.d.ts create mode 100644 node_modules/@types/node/test.d.ts create mode 100644 node_modules/@types/node/timers.d.ts create mode 100644 node_modules/@types/node/timers/promises.d.ts create mode 100644 node_modules/@types/node/tls.d.ts create mode 100644 node_modules/@types/node/trace_events.d.ts create mode 100644 node_modules/@types/node/tty.d.ts create mode 100644 node_modules/@types/node/url.d.ts create mode 100644 node_modules/@types/node/util.d.ts create mode 100644 node_modules/@types/node/v8.d.ts create mode 100644 node_modules/@types/node/vm.d.ts create mode 100644 node_modules/@types/node/wasi.d.ts create mode 100644 node_modules/@types/node/worker_threads.d.ts create mode 100644 node_modules/@types/node/zlib.d.ts create mode 100644 node_modules/a-sync-waterfall/LICENSE create mode 100644 node_modules/a-sync-waterfall/README.md create mode 100644 node_modules/a-sync-waterfall/index.js create mode 100644 node_modules/a-sync-waterfall/package.json create mode 100644 node_modules/a-sync-waterfall/test.js create mode 100644 node_modules/acorn/CHANGELOG.md create mode 100644 node_modules/acorn/LICENSE create mode 100644 node_modules/acorn/README.md create mode 100755 node_modules/acorn/bin/acorn create mode 100644 node_modules/acorn/dist/acorn.d.ts create mode 100644 node_modules/acorn/dist/acorn.js create mode 100644 node_modules/acorn/dist/acorn.js.map create mode 100644 node_modules/acorn/dist/acorn.mjs create mode 100644 node_modules/acorn/dist/acorn.mjs.d.ts create mode 100644 node_modules/acorn/dist/acorn.mjs.map create mode 100644 node_modules/acorn/dist/bin.js create mode 100644 node_modules/acorn/package.json create mode 100644 node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/license create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/any-promise/.jshintrc create mode 100644 node_modules/any-promise/.npmignore create mode 100644 node_modules/any-promise/LICENSE create mode 100644 node_modules/any-promise/README.md create mode 100644 node_modules/any-promise/implementation.d.ts create mode 100644 node_modules/any-promise/implementation.js create mode 100644 node_modules/any-promise/index.d.ts create mode 100644 node_modules/any-promise/index.js create mode 100644 node_modules/any-promise/loader.js create mode 100644 node_modules/any-promise/optional.js create mode 100644 node_modules/any-promise/package.json create mode 100644 node_modules/any-promise/register-shim.js create mode 100644 node_modules/any-promise/register.d.ts create mode 100644 node_modules/any-promise/register.js create mode 100644 node_modules/any-promise/register/bluebird.d.ts create mode 100644 node_modules/any-promise/register/bluebird.js create mode 100644 node_modules/any-promise/register/es6-promise.d.ts create mode 100644 node_modules/any-promise/register/es6-promise.js create mode 100644 node_modules/any-promise/register/lie.d.ts create mode 100644 node_modules/any-promise/register/lie.js create mode 100644 node_modules/any-promise/register/native-promise-only.d.ts create mode 100644 node_modules/any-promise/register/native-promise-only.js create mode 100644 node_modules/any-promise/register/pinkie.d.ts create mode 100644 node_modules/any-promise/register/pinkie.js create mode 100644 node_modules/any-promise/register/promise.d.ts create mode 100644 node_modules/any-promise/register/promise.js create mode 100644 node_modules/any-promise/register/q.d.ts create mode 100644 node_modules/any-promise/register/q.js create mode 100644 node_modules/any-promise/register/rsvp.d.ts create mode 100644 node_modules/any-promise/register/rsvp.js create mode 100644 node_modules/any-promise/register/vow.d.ts create mode 100644 node_modules/any-promise/register/vow.js create mode 100644 node_modules/any-promise/register/when.d.ts create mode 100644 node_modules/any-promise/register/when.js create mode 100644 node_modules/anymatch/LICENSE create mode 100644 node_modules/anymatch/README.md create mode 100644 node_modules/anymatch/index.d.ts create mode 100644 node_modules/anymatch/index.js create mode 100644 node_modules/anymatch/package.json create mode 100644 node_modules/arg/LICENSE.md create mode 100644 node_modules/arg/README.md create mode 100644 node_modules/arg/index.d.ts create mode 100644 node_modules/arg/index.js create mode 100644 node_modules/arg/package.json create mode 100644 node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/argparse/LICENSE create mode 100644 node_modules/argparse/README.md create mode 100644 node_modules/argparse/index.js create mode 100644 node_modules/argparse/lib/action.js create mode 100644 node_modules/argparse/lib/action/append.js create mode 100644 node_modules/argparse/lib/action/append/constant.js create mode 100644 node_modules/argparse/lib/action/count.js create mode 100644 node_modules/argparse/lib/action/help.js create mode 100644 node_modules/argparse/lib/action/store.js create mode 100644 node_modules/argparse/lib/action/store/constant.js create mode 100644 node_modules/argparse/lib/action/store/false.js create mode 100644 node_modules/argparse/lib/action/store/true.js create mode 100644 node_modules/argparse/lib/action/subparsers.js create mode 100644 node_modules/argparse/lib/action/version.js create mode 100644 node_modules/argparse/lib/action_container.js create mode 100644 node_modules/argparse/lib/argparse.js create mode 100644 node_modules/argparse/lib/argument/error.js create mode 100644 node_modules/argparse/lib/argument/exclusive.js create mode 100644 node_modules/argparse/lib/argument/group.js create mode 100644 node_modules/argparse/lib/argument_parser.js create mode 100644 node_modules/argparse/lib/const.js create mode 100644 node_modules/argparse/lib/help/added_formatters.js create mode 100644 node_modules/argparse/lib/help/formatter.js create mode 100644 node_modules/argparse/lib/namespace.js create mode 100644 node_modules/argparse/lib/utils.js create mode 100644 node_modules/argparse/package.json create mode 100644 node_modules/array-differ/index.d.ts create mode 100644 node_modules/array-differ/index.js create mode 100644 node_modules/array-differ/license create mode 100644 node_modules/array-differ/package.json create mode 100644 node_modules/array-differ/readme.md create mode 100644 node_modules/array-union/index.d.ts create mode 100644 node_modules/array-union/index.js create mode 100644 node_modules/array-union/license create mode 100644 node_modules/array-union/package.json create mode 100644 node_modules/array-union/readme.md create mode 100644 node_modules/array-uniq/index.js create mode 100644 node_modules/array-uniq/license create mode 100644 node_modules/array-uniq/package.json create mode 100644 node_modules/array-uniq/readme.md create mode 100644 node_modules/arrify/index.d.ts create mode 100644 node_modules/arrify/index.js create mode 100644 node_modules/arrify/license create mode 100644 node_modules/arrify/package.json create mode 100644 node_modules/arrify/readme.md create mode 100644 node_modules/asap/CHANGES.md create mode 100644 node_modules/asap/LICENSE.md create mode 100644 node_modules/asap/README.md create mode 100644 node_modules/asap/asap.js create mode 100644 node_modules/asap/browser-asap.js create mode 100644 node_modules/asap/browser-raw.js create mode 100644 node_modules/asap/package.json create mode 100644 node_modules/asap/raw.js create mode 100644 node_modules/assert-never/README.md create mode 100644 node_modules/assert-never/index.d.ts create mode 100644 node_modules/assert-never/index.js create mode 100644 node_modules/assert-never/index.ts create mode 100644 node_modules/assert-never/package.json create mode 100644 node_modules/async/CHANGELOG.md create mode 100644 node_modules/async/LICENSE create mode 100644 node_modules/async/README.md create mode 100644 node_modules/async/all.js create mode 100644 node_modules/async/allLimit.js create mode 100644 node_modules/async/allSeries.js create mode 100644 node_modules/async/any.js create mode 100644 node_modules/async/anyLimit.js create mode 100644 node_modules/async/anySeries.js create mode 100644 node_modules/async/apply.js create mode 100644 node_modules/async/applyEach.js create mode 100644 node_modules/async/applyEachSeries.js create mode 100644 node_modules/async/asyncify.js create mode 100644 node_modules/async/auto.js create mode 100644 node_modules/async/autoInject.js create mode 100644 node_modules/async/bower.json create mode 100644 node_modules/async/cargo.js create mode 100644 node_modules/async/cargoQueue.js create mode 100644 node_modules/async/compose.js create mode 100644 node_modules/async/concat.js create mode 100644 node_modules/async/concatLimit.js create mode 100644 node_modules/async/concatSeries.js create mode 100644 node_modules/async/constant.js create mode 100644 node_modules/async/detect.js create mode 100644 node_modules/async/detectLimit.js create mode 100644 node_modules/async/detectSeries.js create mode 100644 node_modules/async/dir.js create mode 100644 node_modules/async/dist/async.js create mode 100644 node_modules/async/dist/async.min.js create mode 100644 node_modules/async/dist/async.mjs create mode 100644 node_modules/async/doDuring.js create mode 100644 node_modules/async/doUntil.js create mode 100644 node_modules/async/doWhilst.js create mode 100644 node_modules/async/during.js create mode 100644 node_modules/async/each.js create mode 100644 node_modules/async/eachLimit.js create mode 100644 node_modules/async/eachOf.js create mode 100644 node_modules/async/eachOfLimit.js create mode 100644 node_modules/async/eachOfSeries.js create mode 100644 node_modules/async/eachSeries.js create mode 100644 node_modules/async/ensureAsync.js create mode 100644 node_modules/async/every.js create mode 100644 node_modules/async/everyLimit.js create mode 100644 node_modules/async/everySeries.js create mode 100644 node_modules/async/filter.js create mode 100644 node_modules/async/filterLimit.js create mode 100644 node_modules/async/filterSeries.js create mode 100644 node_modules/async/find.js create mode 100644 node_modules/async/findLimit.js create mode 100644 node_modules/async/findSeries.js create mode 100644 node_modules/async/flatMap.js create mode 100644 node_modules/async/flatMapLimit.js create mode 100644 node_modules/async/flatMapSeries.js create mode 100644 node_modules/async/foldl.js create mode 100644 node_modules/async/foldr.js create mode 100644 node_modules/async/forEach.js create mode 100644 node_modules/async/forEachLimit.js create mode 100644 node_modules/async/forEachOf.js create mode 100644 node_modules/async/forEachOfLimit.js create mode 100644 node_modules/async/forEachOfSeries.js create mode 100644 node_modules/async/forEachSeries.js create mode 100644 node_modules/async/forever.js create mode 100644 node_modules/async/groupBy.js create mode 100644 node_modules/async/groupByLimit.js create mode 100644 node_modules/async/groupBySeries.js create mode 100644 node_modules/async/index.js create mode 100644 node_modules/async/inject.js create mode 100644 node_modules/async/internal/DoublyLinkedList.js create mode 100644 node_modules/async/internal/Heap.js create mode 100644 node_modules/async/internal/applyEach.js create mode 100644 node_modules/async/internal/asyncEachOfLimit.js create mode 100644 node_modules/async/internal/awaitify.js create mode 100644 node_modules/async/internal/breakLoop.js create mode 100644 node_modules/async/internal/consoleFunc.js create mode 100644 node_modules/async/internal/createTester.js create mode 100644 node_modules/async/internal/eachOfLimit.js create mode 100644 node_modules/async/internal/filter.js create mode 100644 node_modules/async/internal/getIterator.js create mode 100644 node_modules/async/internal/initialParams.js create mode 100644 node_modules/async/internal/isArrayLike.js create mode 100644 node_modules/async/internal/iterator.js create mode 100644 node_modules/async/internal/map.js create mode 100644 node_modules/async/internal/once.js create mode 100644 node_modules/async/internal/onlyOnce.js create mode 100644 node_modules/async/internal/parallel.js create mode 100644 node_modules/async/internal/promiseCallback.js create mode 100644 node_modules/async/internal/queue.js create mode 100644 node_modules/async/internal/range.js create mode 100644 node_modules/async/internal/reject.js create mode 100644 node_modules/async/internal/setImmediate.js create mode 100644 node_modules/async/internal/withoutIndex.js create mode 100644 node_modules/async/internal/wrapAsync.js create mode 100644 node_modules/async/log.js create mode 100644 node_modules/async/map.js create mode 100644 node_modules/async/mapLimit.js create mode 100644 node_modules/async/mapSeries.js create mode 100644 node_modules/async/mapValues.js create mode 100644 node_modules/async/mapValuesLimit.js create mode 100644 node_modules/async/mapValuesSeries.js create mode 100644 node_modules/async/memoize.js create mode 100644 node_modules/async/nextTick.js create mode 100644 node_modules/async/package.json create mode 100644 node_modules/async/parallel.js create mode 100644 node_modules/async/parallelLimit.js create mode 100644 node_modules/async/priorityQueue.js create mode 100644 node_modules/async/queue.js create mode 100644 node_modules/async/race.js create mode 100644 node_modules/async/reduce.js create mode 100644 node_modules/async/reduceRight.js create mode 100644 node_modules/async/reflect.js create mode 100644 node_modules/async/reflectAll.js create mode 100644 node_modules/async/reject.js create mode 100644 node_modules/async/rejectLimit.js create mode 100644 node_modules/async/rejectSeries.js create mode 100644 node_modules/async/retry.js create mode 100644 node_modules/async/retryable.js create mode 100644 node_modules/async/select.js create mode 100644 node_modules/async/selectLimit.js create mode 100644 node_modules/async/selectSeries.js create mode 100644 node_modules/async/seq.js create mode 100644 node_modules/async/series.js create mode 100644 node_modules/async/setImmediate.js create mode 100644 node_modules/async/some.js create mode 100644 node_modules/async/someLimit.js create mode 100644 node_modules/async/someSeries.js create mode 100644 node_modules/async/sortBy.js create mode 100644 node_modules/async/timeout.js create mode 100644 node_modules/async/times.js create mode 100644 node_modules/async/timesLimit.js create mode 100644 node_modules/async/timesSeries.js create mode 100644 node_modules/async/transform.js create mode 100644 node_modules/async/tryEach.js create mode 100644 node_modules/async/unmemoize.js create mode 100644 node_modules/async/until.js create mode 100644 node_modules/async/waterfall.js create mode 100644 node_modules/async/whilst.js create mode 100644 node_modules/async/wrapSync.js create mode 100644 node_modules/babel-walk/LICENSE.md create mode 100644 node_modules/babel-walk/README.md create mode 100644 node_modules/babel-walk/lib/.tsbuildinfo create mode 100644 node_modules/babel-walk/lib/explode.d.ts create mode 100644 node_modules/babel-walk/lib/explode.js create mode 100644 node_modules/babel-walk/lib/explode.js.map create mode 100644 node_modules/babel-walk/lib/index.d.ts create mode 100644 node_modules/babel-walk/lib/index.js create mode 100644 node_modules/babel-walk/lib/index.js.map create mode 100644 node_modules/babel-walk/lib/test.d.ts create mode 100644 node_modules/babel-walk/lib/test.js create mode 100644 node_modules/babel-walk/lib/test.js.map create mode 100644 node_modules/babel-walk/package.json create mode 100644 node_modules/balanced-match/.github/FUNDING.yml create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/bcp-47-match/index.js create mode 100644 node_modules/bcp-47-match/license create mode 100644 node_modules/bcp-47-match/package.json create mode 100644 node_modules/bcp-47-match/readme.md create mode 100644 node_modules/bcp-47-normalize/index.js create mode 100644 node_modules/bcp-47-normalize/lib/defaults.json create mode 100644 node_modules/bcp-47-normalize/lib/fields.json create mode 100644 node_modules/bcp-47-normalize/lib/index.js create mode 100644 node_modules/bcp-47-normalize/lib/many.json create mode 100644 node_modules/bcp-47-normalize/lib/matches.json create mode 100644 node_modules/bcp-47-normalize/license create mode 100644 node_modules/bcp-47-normalize/package.json create mode 100644 node_modules/bcp-47-normalize/readme.md create mode 100644 node_modules/bcp-47/index.js create mode 100644 node_modules/bcp-47/lib/normalize.json create mode 100644 node_modules/bcp-47/lib/parse.js create mode 100644 node_modules/bcp-47/lib/regular.json create mode 100644 node_modules/bcp-47/lib/stringify.js create mode 100644 node_modules/bcp-47/license create mode 100644 node_modules/bcp-47/package.json create mode 100644 node_modules/bcp-47/readme.md create mode 100644 node_modules/binary-extensions/binary-extensions.json create mode 100644 node_modules/binary-extensions/binary-extensions.json.d.ts create mode 100644 node_modules/binary-extensions/index.d.ts create mode 100644 node_modules/binary-extensions/index.js create mode 100644 node_modules/binary-extensions/license create mode 100644 node_modules/binary-extensions/package.json create mode 100644 node_modules/binary-extensions/readme.md create mode 100644 node_modules/brace-expansion/.github/FUNDING.yml create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/braces/LICENSE create mode 100644 node_modules/braces/README.md create mode 100644 node_modules/braces/index.js create mode 100644 node_modules/braces/lib/compile.js create mode 100644 node_modules/braces/lib/constants.js create mode 100644 node_modules/braces/lib/expand.js create mode 100644 node_modules/braces/lib/parse.js create mode 100644 node_modules/braces/lib/stringify.js create mode 100644 node_modules/braces/lib/utils.js create mode 100644 node_modules/braces/package.json create mode 100644 node_modules/call-bind/.eslintignore create mode 100644 node_modules/call-bind/.eslintrc create mode 100644 node_modules/call-bind/.github/FUNDING.yml create mode 100644 node_modules/call-bind/.nycrc create mode 100644 node_modules/call-bind/CHANGELOG.md create mode 100644 node_modules/call-bind/LICENSE create mode 100644 node_modules/call-bind/README.md create mode 100644 node_modules/call-bind/callBound.js create mode 100644 node_modules/call-bind/index.js create mode 100644 node_modules/call-bind/package.json create mode 100644 node_modules/call-bind/test/callBound.js create mode 100644 node_modules/call-bind/test/index.js create mode 100644 node_modules/camelcase-css/README.md create mode 100644 node_modules/camelcase-css/index-es5.js create mode 100644 node_modules/camelcase-css/index.js create mode 100644 node_modules/camelcase-css/license create mode 100644 node_modules/camelcase-css/package.json create mode 100644 node_modules/chalk/index.d.ts create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/source/index.js create mode 100644 node_modules/chalk/source/templates.js create mode 100644 node_modules/chalk/source/util.js create mode 100644 node_modules/character-parser/.npmignore create mode 100644 node_modules/character-parser/LICENSE create mode 100644 node_modules/character-parser/README.md create mode 100644 node_modules/character-parser/index.js create mode 100644 node_modules/character-parser/package.json create mode 100644 node_modules/chokidar/LICENSE create mode 100644 node_modules/chokidar/README.md create mode 100644 node_modules/chokidar/index.js create mode 100644 node_modules/chokidar/lib/constants.js create mode 100644 node_modules/chokidar/lib/fsevents-handler.js create mode 100644 node_modules/chokidar/lib/nodefs-handler.js create mode 100644 node_modules/chokidar/package.json create mode 100644 node_modules/chokidar/types/index.d.ts create mode 100644 node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/color-convert/LICENSE create mode 100644 node_modules/color-convert/README.md create mode 100644 node_modules/color-convert/conversions.js create mode 100644 node_modules/color-convert/index.js create mode 100644 node_modules/color-convert/package.json create mode 100644 node_modules/color-convert/route.js create mode 100644 node_modules/color-name/LICENSE create mode 100644 node_modules/color-name/README.md create mode 100644 node_modules/color-name/index.js create mode 100644 node_modules/color-name/package.json create mode 100644 node_modules/commander/LICENSE create mode 100644 node_modules/commander/Readme.md create mode 100644 node_modules/commander/esm.mjs create mode 100644 node_modules/commander/index.js create mode 100644 node_modules/commander/lib/argument.js create mode 100644 node_modules/commander/lib/command.js create mode 100644 node_modules/commander/lib/error.js create mode 100644 node_modules/commander/lib/help.js create mode 100644 node_modules/commander/lib/option.js create mode 100644 node_modules/commander/lib/suggestSimilar.js create mode 100644 node_modules/commander/package-support.json create mode 100644 node_modules/commander/package.json create mode 100644 node_modules/commander/typings/index.d.ts create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/constantinople/.editorconfig create mode 100644 node_modules/constantinople/.gitattributes create mode 100644 node_modules/constantinople/.prettierrc create mode 100644 node_modules/constantinople/.travis.yml create mode 100644 node_modules/constantinople/LICENSE create mode 100644 node_modules/constantinople/README.md create mode 100644 node_modules/constantinople/lib/binaryOperation.d.ts create mode 100644 node_modules/constantinople/lib/binaryOperation.js create mode 100644 node_modules/constantinople/lib/index.d.ts create mode 100644 node_modules/constantinople/lib/index.js create mode 100644 node_modules/constantinople/package.json create mode 100644 node_modules/constantinople/src/binaryOperation.ts create mode 100644 node_modules/constantinople/src/index.ts create mode 100644 node_modules/constantinople/test/index.js create mode 100644 node_modules/constantinople/tsconfig.json create mode 100644 node_modules/cross-spawn/CHANGELOG.md create mode 100644 node_modules/cross-spawn/LICENSE create mode 100644 node_modules/cross-spawn/README.md create mode 100644 node_modules/cross-spawn/index.js create mode 100644 node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/cross-spawn/package.json create mode 100644 node_modules/cssesc/LICENSE-MIT.txt create mode 100644 node_modules/cssesc/README.md create mode 100755 node_modules/cssesc/bin/cssesc create mode 100644 node_modules/cssesc/cssesc.js create mode 100644 node_modules/cssesc/man/cssesc.1 create mode 100644 node_modules/cssesc/package.json create mode 100644 node_modules/debug/LICENSE create mode 100644 node_modules/debug/README.md create mode 100644 node_modules/debug/node_modules/ms/index.js create mode 100644 node_modules/debug/node_modules/ms/license.md create mode 100644 node_modules/debug/node_modules/ms/package.json create mode 100644 node_modules/debug/node_modules/ms/readme.md create mode 100644 node_modules/debug/package.json create mode 100644 node_modules/debug/src/browser.js create mode 100644 node_modules/debug/src/common.js create mode 100644 node_modules/debug/src/index.js create mode 100644 node_modules/debug/src/node.js create mode 100644 node_modules/define-data-property/.eslintrc create mode 100644 node_modules/define-data-property/.github/FUNDING.yml create mode 100644 node_modules/define-data-property/.nycrc create mode 100644 node_modules/define-data-property/CHANGELOG.md create mode 100644 node_modules/define-data-property/LICENSE create mode 100644 node_modules/define-data-property/README.md create mode 100644 node_modules/define-data-property/index.d.ts create mode 100644 node_modules/define-data-property/index.js create mode 100644 node_modules/define-data-property/package.json create mode 100644 node_modules/define-data-property/test/index.js create mode 100644 node_modules/define-data-property/tsconfig.json create mode 100755 node_modules/dependency-graph/CHANGELOG.md create mode 100755 node_modules/dependency-graph/LICENSE create mode 100755 node_modules/dependency-graph/README.md create mode 100755 node_modules/dependency-graph/lib/dep_graph.js create mode 100755 node_modules/dependency-graph/lib/index.d.ts create mode 100755 node_modules/dependency-graph/package.json create mode 100755 node_modules/dependency-graph/specs/dep_graph_spec.js create mode 100644 node_modules/dev-ip/.jshintrc create mode 100644 node_modules/dev-ip/.npmignore create mode 100644 node_modules/dev-ip/.travis.yml create mode 100644 node_modules/dev-ip/LICENSE-MIT create mode 100644 node_modules/dev-ip/README.md create mode 100644 node_modules/dev-ip/example.js create mode 100755 node_modules/dev-ip/lib/dev-ip.js create mode 100644 node_modules/dev-ip/package.json create mode 100644 node_modules/dev-ip/test/.jshintrc create mode 100644 node_modules/dev-ip/test/devip.js create mode 100644 node_modules/dev-ip/test/fixtures/resp-multiple.js create mode 100644 node_modules/dev-ip/test/fixtures/resp-none.js create mode 100644 node_modules/dev-ip/test/fixtures/resp-single.js create mode 100644 node_modules/didyoumean/LICENSE create mode 100644 node_modules/didyoumean/README.md create mode 100644 node_modules/didyoumean/didYouMean-1.2.1.js create mode 100644 node_modules/didyoumean/didYouMean-1.2.1.min.js create mode 100755 node_modules/didyoumean/package.json create mode 100644 node_modules/dlv/README.md create mode 100644 node_modules/dlv/dist/dlv.es.js create mode 100644 node_modules/dlv/dist/dlv.es.js.map create mode 100644 node_modules/dlv/dist/dlv.js create mode 100644 node_modules/dlv/dist/dlv.js.map create mode 100644 node_modules/dlv/dist/dlv.umd.js create mode 100644 node_modules/dlv/dist/dlv.umd.js.map create mode 100644 node_modules/dlv/index.js create mode 100644 node_modules/dlv/package.json create mode 100644 node_modules/doctypes/.npmignore create mode 100644 node_modules/doctypes/.travis.yml create mode 100644 node_modules/doctypes/HISTORY.md create mode 100644 node_modules/doctypes/LICENSE create mode 100644 node_modules/doctypes/README.md create mode 100644 node_modules/doctypes/index.js create mode 100644 node_modules/doctypes/package.json create mode 100644 node_modules/doctypes/test.js create mode 100644 node_modules/dom-serializer/LICENSE create mode 100644 node_modules/dom-serializer/README.md create mode 100644 node_modules/dom-serializer/lib/esm/foreignNames.d.ts create mode 100644 node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map create mode 100644 node_modules/dom-serializer/lib/esm/foreignNames.js create mode 100644 node_modules/dom-serializer/lib/esm/index.d.ts create mode 100644 node_modules/dom-serializer/lib/esm/index.d.ts.map create mode 100644 node_modules/dom-serializer/lib/esm/index.js create mode 100644 node_modules/dom-serializer/lib/esm/package.json create mode 100644 node_modules/dom-serializer/lib/foreignNames.d.ts create mode 100644 node_modules/dom-serializer/lib/foreignNames.d.ts.map create mode 100644 node_modules/dom-serializer/lib/foreignNames.js create mode 100644 node_modules/dom-serializer/lib/index.d.ts create mode 100644 node_modules/dom-serializer/lib/index.d.ts.map create mode 100644 node_modules/dom-serializer/lib/index.js create mode 100644 node_modules/dom-serializer/node_modules/entities/LICENSE create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/decode.js create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/encode.js create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/index.d.ts create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/index.js create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json create mode 100644 node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json create mode 100644 node_modules/dom-serializer/node_modules/entities/package.json create mode 100644 node_modules/dom-serializer/node_modules/entities/readme.md create mode 100644 node_modules/dom-serializer/package.json create mode 100644 node_modules/domelementtype/LICENSE create mode 100644 node_modules/domelementtype/lib/esm/index.d.ts create mode 100644 node_modules/domelementtype/lib/esm/index.d.ts.map create mode 100644 node_modules/domelementtype/lib/esm/index.js create mode 100644 node_modules/domelementtype/lib/esm/package.json create mode 100644 node_modules/domelementtype/lib/index.d.ts create mode 100644 node_modules/domelementtype/lib/index.d.ts.map create mode 100644 node_modules/domelementtype/lib/index.js create mode 100644 node_modules/domelementtype/package.json create mode 100644 node_modules/domelementtype/readme.md create mode 100644 node_modules/domhandler/LICENSE create mode 100644 node_modules/domhandler/lib/index.d.ts create mode 100644 node_modules/domhandler/lib/index.d.ts.map create mode 100644 node_modules/domhandler/lib/index.js create mode 100644 node_modules/domhandler/lib/node.d.ts create mode 100644 node_modules/domhandler/lib/node.d.ts.map create mode 100644 node_modules/domhandler/lib/node.js create mode 100644 node_modules/domhandler/package.json create mode 100644 node_modules/domhandler/readme.md create mode 100644 node_modules/domutils/LICENSE create mode 100644 node_modules/domutils/lib/feeds.d.ts create mode 100644 node_modules/domutils/lib/feeds.d.ts.map create mode 100644 node_modules/domutils/lib/feeds.js create mode 100644 node_modules/domutils/lib/helpers.d.ts create mode 100644 node_modules/domutils/lib/helpers.d.ts.map create mode 100644 node_modules/domutils/lib/helpers.js create mode 100644 node_modules/domutils/lib/index.d.ts create mode 100644 node_modules/domutils/lib/index.d.ts.map create mode 100644 node_modules/domutils/lib/index.js create mode 100644 node_modules/domutils/lib/legacy.d.ts create mode 100644 node_modules/domutils/lib/legacy.d.ts.map create mode 100644 node_modules/domutils/lib/legacy.js create mode 100644 node_modules/domutils/lib/manipulation.d.ts create mode 100644 node_modules/domutils/lib/manipulation.d.ts.map create mode 100644 node_modules/domutils/lib/manipulation.js create mode 100644 node_modules/domutils/lib/querying.d.ts create mode 100644 node_modules/domutils/lib/querying.d.ts.map create mode 100644 node_modules/domutils/lib/querying.js create mode 100644 node_modules/domutils/lib/stringify.d.ts create mode 100644 node_modules/domutils/lib/stringify.d.ts.map create mode 100644 node_modules/domutils/lib/stringify.js create mode 100644 node_modules/domutils/lib/traversal.d.ts create mode 100644 node_modules/domutils/lib/traversal.d.ts.map create mode 100644 node_modules/domutils/lib/traversal.js create mode 100644 node_modules/domutils/package.json create mode 100644 node_modules/domutils/readme.md create mode 100644 node_modules/eastasianwidth/README.md create mode 100644 node_modules/eastasianwidth/eastasianwidth.js create mode 100644 node_modules/eastasianwidth/package.json create mode 100644 node_modules/ee-first/LICENSE create mode 100644 node_modules/ee-first/README.md create mode 100644 node_modules/ee-first/index.js create mode 100644 node_modules/ee-first/package.json create mode 100644 node_modules/ejs/LICENSE create mode 100644 node_modules/ejs/README.md create mode 100755 node_modules/ejs/bin/cli.js create mode 100644 node_modules/ejs/ejs.js create mode 100644 node_modules/ejs/ejs.min.js create mode 100644 node_modules/ejs/jakefile.js create mode 100755 node_modules/ejs/lib/ejs.js create mode 100644 node_modules/ejs/lib/utils.js create mode 100644 node_modules/ejs/package.json create mode 100644 node_modules/ejs/usage.txt create mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/emoji-regex/README.md create mode 100644 node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/emoji-regex/index.js create mode 100644 node_modules/emoji-regex/package.json create mode 100644 node_modules/emoji-regex/text.js create mode 100644 node_modules/encodeurl/HISTORY.md create mode 100644 node_modules/encodeurl/LICENSE create mode 100644 node_modules/encodeurl/README.md create mode 100644 node_modules/encodeurl/index.js create mode 100644 node_modules/encodeurl/package.json create mode 100644 node_modules/entities/LICENSE create mode 100644 node_modules/entities/lib/decode.d.ts create mode 100644 node_modules/entities/lib/decode.d.ts.map create mode 100644 node_modules/entities/lib/decode.js create mode 100644 node_modules/entities/lib/decode_codepoint.d.ts create mode 100644 node_modules/entities/lib/decode_codepoint.d.ts.map create mode 100644 node_modules/entities/lib/decode_codepoint.js create mode 100644 node_modules/entities/lib/encode-trie.d.ts create mode 100644 node_modules/entities/lib/encode-trie.d.ts.map create mode 100644 node_modules/entities/lib/encode-trie.js create mode 100644 node_modules/entities/lib/encode.d.ts create mode 100644 node_modules/entities/lib/encode.d.ts.map create mode 100644 node_modules/entities/lib/encode.js create mode 100644 node_modules/entities/lib/generated/decode-data-html.d.ts create mode 100644 node_modules/entities/lib/generated/decode-data-html.d.ts.map create mode 100644 node_modules/entities/lib/generated/decode-data-html.js create mode 100644 node_modules/entities/lib/generated/decode-data-xml.d.ts create mode 100644 node_modules/entities/lib/generated/decode-data-xml.d.ts.map create mode 100644 node_modules/entities/lib/generated/decode-data-xml.js create mode 100644 node_modules/entities/lib/index.d.ts create mode 100644 node_modules/entities/lib/index.d.ts.map create mode 100644 node_modules/entities/lib/index.js create mode 100644 node_modules/entities/lib/maps/entities.json create mode 100644 node_modules/entities/lib/maps/legacy.json create mode 100644 node_modules/entities/lib/maps/xml.json create mode 100644 node_modules/entities/package.json create mode 100644 node_modules/entities/readme.md create mode 100644 node_modules/errno/.jshintrc create mode 100644 node_modules/errno/.travis.yml create mode 100644 node_modules/errno/README.md create mode 100755 node_modules/errno/build.js create mode 100755 node_modules/errno/cli.js create mode 100644 node_modules/errno/custom.js create mode 100644 node_modules/errno/errno.js create mode 100644 node_modules/errno/package.json create mode 100644 node_modules/errno/test.js create mode 100644 node_modules/es-define-property/.eslintrc create mode 100644 node_modules/es-define-property/.github/FUNDING.yml create mode 100644 node_modules/es-define-property/.nycrc create mode 100644 node_modules/es-define-property/CHANGELOG.md create mode 100644 node_modules/es-define-property/LICENSE create mode 100644 node_modules/es-define-property/README.md create mode 100644 node_modules/es-define-property/index.d.ts create mode 100644 node_modules/es-define-property/index.js create mode 100644 node_modules/es-define-property/package.json create mode 100644 node_modules/es-define-property/test/index.js create mode 100644 node_modules/es-define-property/tsconfig.json create mode 100644 node_modules/es-errors/.eslintrc create mode 100644 node_modules/es-errors/.github/FUNDING.yml create mode 100644 node_modules/es-errors/CHANGELOG.md create mode 100644 node_modules/es-errors/LICENSE create mode 100644 node_modules/es-errors/README.md create mode 100644 node_modules/es-errors/eval.d.ts create mode 100644 node_modules/es-errors/eval.js create mode 100644 node_modules/es-errors/index.d.ts create mode 100644 node_modules/es-errors/index.js create mode 100644 node_modules/es-errors/package.json create mode 100644 node_modules/es-errors/range.d.ts create mode 100644 node_modules/es-errors/range.js create mode 100644 node_modules/es-errors/ref.d.ts create mode 100644 node_modules/es-errors/ref.js create mode 100644 node_modules/es-errors/syntax.d.ts create mode 100644 node_modules/es-errors/syntax.js create mode 100644 node_modules/es-errors/test/index.js create mode 100644 node_modules/es-errors/tsconfig.json create mode 100644 node_modules/es-errors/type.d.ts create mode 100644 node_modules/es-errors/type.js create mode 100644 node_modules/es-errors/uri.d.ts create mode 100644 node_modules/es-errors/uri.js create mode 100644 node_modules/escape-html/LICENSE create mode 100644 node_modules/escape-html/Readme.md create mode 100644 node_modules/escape-html/index.js create mode 100644 node_modules/escape-html/package.json create mode 100644 node_modules/escape-string-regexp/index.d.ts create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/esprima/ChangeLog create mode 100644 node_modules/esprima/LICENSE.BSD create mode 100644 node_modules/esprima/README.md create mode 100755 node_modules/esprima/bin/esparse.js create mode 100755 node_modules/esprima/bin/esvalidate.js create mode 100644 node_modules/esprima/dist/esprima.js create mode 100644 node_modules/esprima/package.json create mode 100644 node_modules/extend-shallow/LICENSE create mode 100644 node_modules/extend-shallow/README.md create mode 100644 node_modules/extend-shallow/index.js create mode 100644 node_modules/extend-shallow/package.json create mode 100644 node_modules/fast-glob/LICENSE create mode 100644 node_modules/fast-glob/README.md create mode 100644 node_modules/fast-glob/out/index.d.ts create mode 100644 node_modules/fast-glob/out/index.js create mode 100644 node_modules/fast-glob/out/managers/tasks.d.ts create mode 100644 node_modules/fast-glob/out/managers/tasks.js create mode 100644 node_modules/fast-glob/out/providers/async.d.ts create mode 100644 node_modules/fast-glob/out/providers/async.js create mode 100644 node_modules/fast-glob/out/providers/filters/deep.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/deep.js create mode 100644 node_modules/fast-glob/out/providers/filters/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/entry.js create mode 100644 node_modules/fast-glob/out/providers/filters/error.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/error.js create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.js create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.js create mode 100644 node_modules/fast-glob/out/providers/provider.d.ts create mode 100644 node_modules/fast-glob/out/providers/provider.js create mode 100644 node_modules/fast-glob/out/providers/stream.d.ts create mode 100644 node_modules/fast-glob/out/providers/stream.js create mode 100644 node_modules/fast-glob/out/providers/sync.d.ts create mode 100644 node_modules/fast-glob/out/providers/sync.js create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.js create mode 100644 node_modules/fast-glob/out/readers/async.d.ts create mode 100644 node_modules/fast-glob/out/readers/async.js create mode 100644 node_modules/fast-glob/out/readers/reader.d.ts create mode 100644 node_modules/fast-glob/out/readers/reader.js create mode 100644 node_modules/fast-glob/out/readers/stream.d.ts create mode 100644 node_modules/fast-glob/out/readers/stream.js create mode 100644 node_modules/fast-glob/out/readers/sync.d.ts create mode 100644 node_modules/fast-glob/out/readers/sync.js create mode 100644 node_modules/fast-glob/out/settings.d.ts create mode 100644 node_modules/fast-glob/out/settings.js create mode 100644 node_modules/fast-glob/out/types/index.d.ts create mode 100644 node_modules/fast-glob/out/types/index.js create mode 100644 node_modules/fast-glob/out/utils/array.d.ts create mode 100644 node_modules/fast-glob/out/utils/array.js create mode 100644 node_modules/fast-glob/out/utils/errno.d.ts create mode 100644 node_modules/fast-glob/out/utils/errno.js create mode 100644 node_modules/fast-glob/out/utils/fs.d.ts create mode 100644 node_modules/fast-glob/out/utils/fs.js create mode 100644 node_modules/fast-glob/out/utils/index.d.ts create mode 100644 node_modules/fast-glob/out/utils/index.js create mode 100644 node_modules/fast-glob/out/utils/path.d.ts create mode 100644 node_modules/fast-glob/out/utils/path.js create mode 100644 node_modules/fast-glob/out/utils/pattern.d.ts create mode 100644 node_modules/fast-glob/out/utils/pattern.js create mode 100644 node_modules/fast-glob/out/utils/stream.d.ts create mode 100644 node_modules/fast-glob/out/utils/stream.js create mode 100644 node_modules/fast-glob/out/utils/string.d.ts create mode 100644 node_modules/fast-glob/out/utils/string.js create mode 100644 node_modules/fast-glob/package.json create mode 100644 node_modules/fastq/.github/dependabot.yml create mode 100644 node_modules/fastq/.github/workflows/ci.yml create mode 100644 node_modules/fastq/LICENSE create mode 100644 node_modules/fastq/README.md create mode 100644 node_modules/fastq/bench.js create mode 100644 node_modules/fastq/example.js create mode 100644 node_modules/fastq/example.mjs create mode 100644 node_modules/fastq/index.d.ts create mode 100644 node_modules/fastq/package.json create mode 100644 node_modules/fastq/queue.js create mode 100644 node_modules/fastq/test/example.ts create mode 100644 node_modules/fastq/test/promise.js create mode 100644 node_modules/fastq/test/test.js create mode 100644 node_modules/fastq/test/tsconfig.json create mode 100644 node_modules/filelist/README.md create mode 100644 node_modules/filelist/index.d.ts create mode 100644 node_modules/filelist/index.js create mode 100644 node_modules/filelist/jakefile.js create mode 100644 node_modules/filelist/node_modules/minimatch/LICENSE create mode 100644 node_modules/filelist/node_modules/minimatch/README.md create mode 100644 node_modules/filelist/node_modules/minimatch/lib/path.js create mode 100644 node_modules/filelist/node_modules/minimatch/minimatch.js create mode 100644 node_modules/filelist/node_modules/minimatch/package.json create mode 100644 node_modules/filelist/package.json create mode 100644 node_modules/fill-range/LICENSE create mode 100644 node_modules/fill-range/README.md create mode 100644 node_modules/fill-range/index.js create mode 100644 node_modules/fill-range/package.json create mode 100644 node_modules/finalhandler/HISTORY.md create mode 100644 node_modules/finalhandler/LICENSE create mode 100644 node_modules/finalhandler/README.md create mode 100644 node_modules/finalhandler/SECURITY.md create mode 100644 node_modules/finalhandler/index.js create mode 100644 node_modules/finalhandler/node_modules/debug/.coveralls.yml create mode 100644 node_modules/finalhandler/node_modules/debug/.eslintrc create mode 100644 node_modules/finalhandler/node_modules/debug/.npmignore create mode 100644 node_modules/finalhandler/node_modules/debug/.travis.yml create mode 100644 node_modules/finalhandler/node_modules/debug/CHANGELOG.md create mode 100644 node_modules/finalhandler/node_modules/debug/LICENSE create mode 100644 node_modules/finalhandler/node_modules/debug/Makefile create mode 100644 node_modules/finalhandler/node_modules/debug/README.md create mode 100644 node_modules/finalhandler/node_modules/debug/component.json create mode 100644 node_modules/finalhandler/node_modules/debug/karma.conf.js create mode 100644 node_modules/finalhandler/node_modules/debug/node.js create mode 100644 node_modules/finalhandler/node_modules/debug/package.json create mode 100644 node_modules/finalhandler/node_modules/debug/src/browser.js create mode 100644 node_modules/finalhandler/node_modules/debug/src/debug.js create mode 100644 node_modules/finalhandler/node_modules/debug/src/index.js create mode 100644 node_modules/finalhandler/node_modules/debug/src/inspector-log.js create mode 100644 node_modules/finalhandler/node_modules/debug/src/node.js create mode 100644 node_modules/finalhandler/package.json create mode 100644 node_modules/foreground-child/LICENSE create mode 100644 node_modules/foreground-child/README.md create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.js create mode 100644 node_modules/foreground-child/dist/commonjs/all-signals.js.map create mode 100644 node_modules/foreground-child/dist/commonjs/index.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/index.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/index.js create mode 100644 node_modules/foreground-child/dist/commonjs/index.js.map create mode 100644 node_modules/foreground-child/dist/commonjs/package.json create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.js create mode 100644 node_modules/foreground-child/dist/commonjs/proxy-signals.js.map create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.d.ts create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.js create mode 100644 node_modules/foreground-child/dist/commonjs/watchdog.js.map create mode 100644 node_modules/foreground-child/dist/esm/all-signals.d.ts create mode 100644 node_modules/foreground-child/dist/esm/all-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/all-signals.js create mode 100644 node_modules/foreground-child/dist/esm/all-signals.js.map create mode 100644 node_modules/foreground-child/dist/esm/index.d.ts create mode 100644 node_modules/foreground-child/dist/esm/index.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/index.js create mode 100644 node_modules/foreground-child/dist/esm/index.js.map create mode 100644 node_modules/foreground-child/dist/esm/package.json create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.d.ts create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.js create mode 100644 node_modules/foreground-child/dist/esm/proxy-signals.js.map create mode 100644 node_modules/foreground-child/dist/esm/watchdog.d.ts create mode 100644 node_modules/foreground-child/dist/esm/watchdog.d.ts.map create mode 100644 node_modules/foreground-child/dist/esm/watchdog.js create mode 100644 node_modules/foreground-child/dist/esm/watchdog.js.map create mode 100644 node_modules/foreground-child/package.json create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/function-bind/.eslintrc create mode 100644 node_modules/function-bind/.github/FUNDING.yml create mode 100644 node_modules/function-bind/.github/SECURITY.md create mode 100644 node_modules/function-bind/.nycrc create mode 100644 node_modules/function-bind/CHANGELOG.md create mode 100644 node_modules/function-bind/LICENSE create mode 100644 node_modules/function-bind/README.md create mode 100644 node_modules/function-bind/implementation.js create mode 100644 node_modules/function-bind/index.js create mode 100644 node_modules/function-bind/package.json create mode 100644 node_modules/function-bind/test/.eslintrc create mode 100644 node_modules/function-bind/test/index.js create mode 100644 node_modules/get-intrinsic/.eslintrc create mode 100644 node_modules/get-intrinsic/.github/FUNDING.yml create mode 100644 node_modules/get-intrinsic/.nycrc create mode 100644 node_modules/get-intrinsic/CHANGELOG.md create mode 100644 node_modules/get-intrinsic/LICENSE create mode 100644 node_modules/get-intrinsic/README.md create mode 100644 node_modules/get-intrinsic/index.js create mode 100644 node_modules/get-intrinsic/package.json create mode 100644 node_modules/get-intrinsic/test/GetIntrinsic.js create mode 100644 node_modules/glob-parent/CHANGELOG.md create mode 100644 node_modules/glob-parent/LICENSE create mode 100644 node_modules/glob-parent/README.md create mode 100644 node_modules/glob-parent/index.js create mode 100644 node_modules/glob-parent/package.json create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/gopd/.eslintrc create mode 100644 node_modules/gopd/.github/FUNDING.yml create mode 100644 node_modules/gopd/CHANGELOG.md create mode 100644 node_modules/gopd/LICENSE create mode 100644 node_modules/gopd/README.md create mode 100644 node_modules/gopd/index.js create mode 100644 node_modules/gopd/package.json create mode 100644 node_modules/gopd/test/index.js create mode 100644 node_modules/graceful-fs/LICENSE create mode 100644 node_modules/graceful-fs/README.md create mode 100644 node_modules/graceful-fs/clone.js create mode 100644 node_modules/graceful-fs/graceful-fs.js create mode 100644 node_modules/graceful-fs/legacy-streams.js create mode 100644 node_modules/graceful-fs/package.json create mode 100644 node_modules/graceful-fs/polyfills.js create mode 100644 node_modules/gray-matter/CHANGELOG.md create mode 100644 node_modules/gray-matter/LICENSE create mode 100644 node_modules/gray-matter/README.md create mode 100644 node_modules/gray-matter/gray-matter.d.ts create mode 100644 node_modules/gray-matter/index.js create mode 100644 node_modules/gray-matter/lib/defaults.js create mode 100644 node_modules/gray-matter/lib/engine.js create mode 100644 node_modules/gray-matter/lib/engines.js create mode 100644 node_modules/gray-matter/lib/excerpt.js create mode 100644 node_modules/gray-matter/lib/parse.js create mode 100644 node_modules/gray-matter/lib/stringify.js create mode 100644 node_modules/gray-matter/lib/to-file.js create mode 100644 node_modules/gray-matter/lib/utils.js create mode 100644 node_modules/gray-matter/package.json create mode 100644 node_modules/hamljs/.bower.json create mode 100644 node_modules/hamljs/.gitmodules create mode 100644 node_modules/hamljs/.ignore create mode 100644 node_modules/hamljs/.npmignore create mode 100644 node_modules/hamljs/.travis.yml create mode 100644 node_modules/hamljs/Gruntfile.js create mode 100644 node_modules/hamljs/History.md create mode 100644 node_modules/hamljs/Makefile create mode 100644 node_modules/hamljs/Readme.md create mode 100644 node_modules/hamljs/haml.js create mode 100644 node_modules/hamljs/lib/haml.js create mode 100644 node_modules/hamljs/package.json create mode 100644 node_modules/hamljs/test/fixtures/class.haml create mode 100644 node_modules/hamljs/test/fixtures/class.html create mode 100644 node_modules/hamljs/test/fixtures/classes.haml create mode 100644 node_modules/hamljs/test/fixtures/classes.html create mode 100644 node_modules/hamljs/test/fixtures/code.each.haml create mode 100644 node_modules/hamljs/test/fixtures/code.each.html create mode 100644 node_modules/hamljs/test/fixtures/code.each.index.haml create mode 100644 node_modules/hamljs/test/fixtures/code.each.index.html create mode 100644 node_modules/hamljs/test/fixtures/code.each.non-enumerable.haml create mode 100644 node_modules/hamljs/test/fixtures/code.each.non-enumerable.html create mode 100644 node_modules/hamljs/test/fixtures/code.escape.haml create mode 100644 node_modules/hamljs/test/fixtures/code.escape.html create mode 100644 node_modules/hamljs/test/fixtures/code.haml create mode 100644 node_modules/hamljs/test/fixtures/code.html create mode 100644 node_modules/hamljs/test/fixtures/code.if.else.haml create mode 100644 node_modules/hamljs/test/fixtures/code.if.else.html create mode 100644 node_modules/hamljs/test/fixtures/code.if.haml create mode 100644 node_modules/hamljs/test/fixtures/code.if.html create mode 100644 node_modules/hamljs/test/fixtures/code.nested.haml create mode 100644 node_modules/hamljs/test/fixtures/code.nested.html create mode 100644 node_modules/hamljs/test/fixtures/comment.block.conditional.haml create mode 100644 node_modules/hamljs/test/fixtures/comment.block.conditional.html create mode 100644 node_modules/hamljs/test/fixtures/comment.block.haml create mode 100644 node_modules/hamljs/test/fixtures/comment.block.html create mode 100644 node_modules/hamljs/test/fixtures/comment.haml create mode 100644 node_modules/hamljs/test/fixtures/comment.html create mode 100644 node_modules/hamljs/test/fixtures/comment.tag.haml create mode 100644 node_modules/hamljs/test/fixtures/comment.tag.html create mode 100644 node_modules/hamljs/test/fixtures/comment.text.complex.haml create mode 100644 node_modules/hamljs/test/fixtures/comment.text.complex.html create mode 100644 node_modules/hamljs/test/fixtures/comment.text.haml create mode 100644 node_modules/hamljs/test/fixtures/comment.text.html create mode 100644 node_modules/hamljs/test/fixtures/context.haml create mode 100644 node_modules/hamljs/test/fixtures/context.html create mode 100644 node_modules/hamljs/test/fixtures/cr.haml create mode 100644 node_modules/hamljs/test/fixtures/cr.html create mode 100644 node_modules/hamljs/test/fixtures/crlf.haml create mode 100644 node_modules/hamljs/test/fixtures/crlf.html create mode 100644 node_modules/hamljs/test/fixtures/doctype.haml create mode 100644 node_modules/hamljs/test/fixtures/doctype.html create mode 100644 node_modules/hamljs/test/fixtures/doctype.xml.case.haml create mode 100644 node_modules/hamljs/test/fixtures/doctype.xml.case.html create mode 100644 node_modules/hamljs/test/fixtures/doctype.xml.haml create mode 100644 node_modules/hamljs/test/fixtures/doctype.xml.html create mode 100644 node_modules/hamljs/test/fixtures/error.haml create mode 100644 node_modules/hamljs/test/fixtures/escape.haml create mode 100644 node_modules/hamljs/test/fixtures/escape.html create mode 100644 node_modules/hamljs/test/fixtures/feed.haml create mode 100644 node_modules/hamljs/test/fixtures/feed.xml create mode 100644 node_modules/hamljs/test/fixtures/filter.cdata.haml create mode 100644 node_modules/hamljs/test/fixtures/filter.cdata.html create mode 100644 node_modules/hamljs/test/fixtures/filter.cdata.whitespace.haml create mode 100644 node_modules/hamljs/test/fixtures/filter.cdata.whitespace.html create mode 100644 node_modules/hamljs/test/fixtures/filter.javascript.haml create mode 100644 node_modules/hamljs/test/fixtures/filter.javascript.html create mode 100644 node_modules/hamljs/test/fixtures/filter.plain.haml create mode 100644 node_modules/hamljs/test/fixtures/filter.plain.html create mode 100644 node_modules/hamljs/test/fixtures/html.haml create mode 100644 node_modules/hamljs/test/fixtures/html.html create mode 100644 node_modules/hamljs/test/fixtures/id.haml create mode 100644 node_modules/hamljs/test/fixtures/id.html create mode 100644 node_modules/hamljs/test/fixtures/issue.#10.haml create mode 100644 node_modules/hamljs/test/fixtures/issue.#10.html create mode 100644 node_modules/hamljs/test/fixtures/issue.#8.haml create mode 100644 node_modules/hamljs/test/fixtures/issue.#8.html create mode 100644 node_modules/hamljs/test/fixtures/literals.haml create mode 100644 node_modules/hamljs/test/fixtures/literals.html create mode 100644 node_modules/hamljs/test/fixtures/namespace.haml create mode 100644 node_modules/hamljs/test/fixtures/namespace.tag.haml create mode 100644 node_modules/hamljs/test/fixtures/namespace.tag.html create mode 100644 node_modules/hamljs/test/fixtures/namespace.xml create mode 100644 node_modules/hamljs/test/fixtures/nesting.complex.haml create mode 100644 node_modules/hamljs/test/fixtures/nesting.complex.html create mode 100644 node_modules/hamljs/test/fixtures/nesting.simple.haml create mode 100644 node_modules/hamljs/test/fixtures/nesting.simple.html create mode 100644 node_modules/hamljs/test/fixtures/newlines.haml create mode 100644 node_modules/hamljs/test/fixtures/newlines.html create mode 100644 node_modules/hamljs/test/fixtures/newlines.within-tags.haml create mode 100644 node_modules/hamljs/test/fixtures/newlines.within-tags.html create mode 100644 node_modules/hamljs/test/fixtures/string.complex-interpolation.haml create mode 100644 node_modules/hamljs/test/fixtures/string.complex-interpolation.html create mode 100644 node_modules/hamljs/test/fixtures/string.interpolation.haml create mode 100644 node_modules/hamljs/test/fixtures/string.interpolation.html create mode 100644 node_modules/hamljs/test/fixtures/tag.attrs.bools.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.attrs.bools.html create mode 100644 node_modules/hamljs/test/fixtures/tag.attrs.escape.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.attrs.escape.html create mode 100644 node_modules/hamljs/test/fixtures/tag.attrs.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.attrs.html create mode 100644 node_modules/hamljs/test/fixtures/tag.class.attribute.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.class.attribute.html create mode 100644 node_modules/hamljs/test/fixtures/tag.class.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.class.html create mode 100644 node_modules/hamljs/test/fixtures/tag.classes.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.classes.html create mode 100644 node_modules/hamljs/test/fixtures/tag.code.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.code.html create mode 100644 node_modules/hamljs/test/fixtures/tag.code.no-escape.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.code.no-escape.html create mode 100644 node_modules/hamljs/test/fixtures/tag.complex.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.complex.html create mode 100644 node_modules/hamljs/test/fixtures/tag.empty.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.empty.html create mode 100644 node_modules/hamljs/test/fixtures/tag.escape.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.escape.html create mode 100644 node_modules/hamljs/test/fixtures/tag.self-close.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.self-close.html create mode 100644 node_modules/hamljs/test/fixtures/tag.simple.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.simple.html create mode 100644 node_modules/hamljs/test/fixtures/tag.text.block.complex.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.text.block.complex.html create mode 100644 node_modules/hamljs/test/fixtures/tag.text.block.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.text.block.html create mode 100644 node_modules/hamljs/test/fixtures/tag.text.haml create mode 100644 node_modules/hamljs/test/fixtures/tag.text.html create mode 100644 node_modules/hamljs/test/fixtures/trailing-indent.haml create mode 100644 node_modules/hamljs/test/fixtures/trailing-indent.html create mode 100644 node_modules/hamljs/test/test.js create mode 100644 node_modules/hamljs/test/unit/spec.helper.js create mode 100644 node_modules/hamljs/test/unit/spec.js create mode 100644 node_modules/handlebars/LICENSE create mode 100644 node_modules/handlebars/README.markdown create mode 100644 node_modules/handlebars/bin/.eslintrc.js create mode 100755 node_modules/handlebars/bin/handlebars create mode 100644 node_modules/handlebars/dist/amd/handlebars.js create mode 100644 node_modules/handlebars/dist/amd/handlebars.runtime.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/base.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/ast.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/base.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/code-gen.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/compiler.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/helpers.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/javascript-compiler.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/parser.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/printer.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/visitor.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/compiler/whitespace-control.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/decorators.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/decorators/inline.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/exception.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers/block-helper-missing.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers/each.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers/helper-missing.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers/if.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers/log.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers/lookup.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/helpers/with.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/internal/create-new-lookup-object.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/internal/proto-access.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/internal/wrapHelper.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/logger.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/no-conflict.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/runtime.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/safe-string.js create mode 100644 node_modules/handlebars/dist/amd/handlebars/utils.js create mode 100644 node_modules/handlebars/dist/amd/precompiler.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars.runtime.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/base.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/base.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/decorators.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/exception.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers/each.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers/if.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers/log.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/helpers/with.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/logger.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/no-conflict.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/runtime.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/safe-string.js create mode 100644 node_modules/handlebars/dist/cjs/handlebars/utils.js create mode 100644 node_modules/handlebars/dist/cjs/precompiler.js create mode 100644 node_modules/handlebars/dist/handlebars.amd.js create mode 100644 node_modules/handlebars/dist/handlebars.amd.min.js create mode 100644 node_modules/handlebars/dist/handlebars.js create mode 100644 node_modules/handlebars/dist/handlebars.min.js create mode 100644 node_modules/handlebars/dist/handlebars.runtime.amd.js create mode 100644 node_modules/handlebars/dist/handlebars.runtime.amd.min.js create mode 100644 node_modules/handlebars/dist/handlebars.runtime.js create mode 100644 node_modules/handlebars/dist/handlebars.runtime.min.js create mode 100644 node_modules/handlebars/lib/.eslintrc.js create mode 100644 node_modules/handlebars/lib/handlebars.js create mode 100644 node_modules/handlebars/lib/handlebars.runtime.js create mode 100644 node_modules/handlebars/lib/handlebars/base.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/ast.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/base.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/code-gen.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/compiler.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/helpers.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/parser.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/printer.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/visitor.js create mode 100644 node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js create mode 100644 node_modules/handlebars/lib/handlebars/decorators.js create mode 100644 node_modules/handlebars/lib/handlebars/decorators/inline.js create mode 100644 node_modules/handlebars/lib/handlebars/exception.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers/block-helper-missing.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers/each.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers/helper-missing.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers/if.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers/log.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers/lookup.js create mode 100644 node_modules/handlebars/lib/handlebars/helpers/with.js create mode 100644 node_modules/handlebars/lib/handlebars/internal/create-new-lookup-object.js create mode 100644 node_modules/handlebars/lib/handlebars/internal/proto-access.js create mode 100644 node_modules/handlebars/lib/handlebars/internal/wrapHelper.js create mode 100644 node_modules/handlebars/lib/handlebars/logger.js create mode 100644 node_modules/handlebars/lib/handlebars/no-conflict.js create mode 100644 node_modules/handlebars/lib/handlebars/runtime.js create mode 100644 node_modules/handlebars/lib/handlebars/safe-string.js create mode 100644 node_modules/handlebars/lib/handlebars/utils.js create mode 100644 node_modules/handlebars/lib/index.js create mode 100644 node_modules/handlebars/lib/precompiler.js create mode 100644 node_modules/handlebars/package.json create mode 100644 node_modules/handlebars/release-notes.md create mode 100644 node_modules/handlebars/runtime.d.ts create mode 100644 node_modules/handlebars/runtime.js create mode 100644 node_modules/handlebars/types/index.d.ts create mode 100644 node_modules/has-flag/index.d.ts create mode 100644 node_modules/has-flag/index.js create mode 100644 node_modules/has-flag/license create mode 100644 node_modules/has-flag/package.json create mode 100644 node_modules/has-flag/readme.md create mode 100644 node_modules/has-property-descriptors/.eslintrc create mode 100644 node_modules/has-property-descriptors/.github/FUNDING.yml create mode 100644 node_modules/has-property-descriptors/.nycrc create mode 100644 node_modules/has-property-descriptors/CHANGELOG.md create mode 100644 node_modules/has-property-descriptors/LICENSE create mode 100644 node_modules/has-property-descriptors/README.md create mode 100644 node_modules/has-property-descriptors/index.js create mode 100644 node_modules/has-property-descriptors/package.json create mode 100644 node_modules/has-property-descriptors/test/index.js create mode 100644 node_modules/has-proto/.eslintrc create mode 100644 node_modules/has-proto/.github/FUNDING.yml create mode 100644 node_modules/has-proto/CHANGELOG.md create mode 100644 node_modules/has-proto/LICENSE create mode 100644 node_modules/has-proto/README.md create mode 100644 node_modules/has-proto/index.d.ts create mode 100644 node_modules/has-proto/index.js create mode 100644 node_modules/has-proto/package.json create mode 100644 node_modules/has-proto/test/index.js create mode 100644 node_modules/has-proto/tsconfig.json create mode 100644 node_modules/has-symbols/.eslintrc create mode 100644 node_modules/has-symbols/.github/FUNDING.yml create mode 100644 node_modules/has-symbols/.nycrc create mode 100644 node_modules/has-symbols/CHANGELOG.md create mode 100644 node_modules/has-symbols/LICENSE create mode 100644 node_modules/has-symbols/README.md create mode 100644 node_modules/has-symbols/index.js create mode 100644 node_modules/has-symbols/package.json create mode 100644 node_modules/has-symbols/shams.js create mode 100644 node_modules/has-symbols/test/index.js create mode 100644 node_modules/has-symbols/test/shams/core-js.js create mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 node_modules/has-symbols/test/tests.js create mode 100644 node_modules/has-tostringtag/.eslintrc create mode 100644 node_modules/has-tostringtag/.github/FUNDING.yml create mode 100644 node_modules/has-tostringtag/.nycrc create mode 100644 node_modules/has-tostringtag/CHANGELOG.md create mode 100644 node_modules/has-tostringtag/LICENSE create mode 100644 node_modules/has-tostringtag/README.md create mode 100644 node_modules/has-tostringtag/index.d.ts create mode 100644 node_modules/has-tostringtag/index.js create mode 100644 node_modules/has-tostringtag/package.json create mode 100644 node_modules/has-tostringtag/shams.d.ts create mode 100644 node_modules/has-tostringtag/shams.js create mode 100644 node_modules/has-tostringtag/test/index.js create mode 100644 node_modules/has-tostringtag/test/shams/core-js.js create mode 100644 node_modules/has-tostringtag/test/shams/get-own-property-symbols.js create mode 100644 node_modules/has-tostringtag/test/tests.js create mode 100644 node_modules/has-tostringtag/tsconfig.json create mode 100644 node_modules/hasown/.eslintrc create mode 100644 node_modules/hasown/.github/FUNDING.yml create mode 100644 node_modules/hasown/.nycrc create mode 100644 node_modules/hasown/CHANGELOG.md create mode 100644 node_modules/hasown/LICENSE create mode 100644 node_modules/hasown/README.md create mode 100644 node_modules/hasown/index.d.ts create mode 100644 node_modules/hasown/index.js create mode 100644 node_modules/hasown/package.json create mode 100644 node_modules/hasown/tsconfig.json create mode 100644 node_modules/htmlparser2/LICENSE create mode 100644 node_modules/htmlparser2/README.md create mode 100644 node_modules/htmlparser2/lib/FeedHandler.d.ts create mode 100644 node_modules/htmlparser2/lib/FeedHandler.d.ts.map create mode 100644 node_modules/htmlparser2/lib/FeedHandler.js create mode 100644 node_modules/htmlparser2/lib/Parser.d.ts create mode 100644 node_modules/htmlparser2/lib/Parser.d.ts.map create mode 100644 node_modules/htmlparser2/lib/Parser.js create mode 100644 node_modules/htmlparser2/lib/Tokenizer.d.ts create mode 100644 node_modules/htmlparser2/lib/Tokenizer.d.ts.map create mode 100644 node_modules/htmlparser2/lib/Tokenizer.js create mode 100644 node_modules/htmlparser2/lib/WritableStream.d.ts create mode 100644 node_modules/htmlparser2/lib/WritableStream.d.ts.map create mode 100644 node_modules/htmlparser2/lib/WritableStream.js create mode 100644 node_modules/htmlparser2/lib/index.d.ts create mode 100644 node_modules/htmlparser2/lib/index.d.ts.map create mode 100644 node_modules/htmlparser2/lib/index.js create mode 100644 node_modules/htmlparser2/package.json create mode 100644 node_modules/http-equiv-refresh/README.md create mode 100644 node_modules/http-equiv-refresh/index.js create mode 100644 node_modules/http-equiv-refresh/license create mode 100644 node_modules/http-equiv-refresh/package.json create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/is-alphabetical/index.js create mode 100644 node_modules/is-alphabetical/license create mode 100644 node_modules/is-alphabetical/package.json create mode 100644 node_modules/is-alphabetical/readme.md create mode 100644 node_modules/is-alphanumerical/index.js create mode 100644 node_modules/is-alphanumerical/license create mode 100644 node_modules/is-alphanumerical/package.json create mode 100644 node_modules/is-alphanumerical/readme.md create mode 100644 node_modules/is-binary-path/index.d.ts create mode 100644 node_modules/is-binary-path/index.js create mode 100644 node_modules/is-binary-path/license create mode 100644 node_modules/is-binary-path/package.json create mode 100644 node_modules/is-binary-path/readme.md create mode 100644 node_modules/is-core-module/.eslintrc create mode 100644 node_modules/is-core-module/.nycrc create mode 100644 node_modules/is-core-module/CHANGELOG.md create mode 100644 node_modules/is-core-module/LICENSE create mode 100644 node_modules/is-core-module/README.md create mode 100644 node_modules/is-core-module/core.json create mode 100644 node_modules/is-core-module/index.js create mode 100644 node_modules/is-core-module/package.json create mode 100644 node_modules/is-core-module/test/index.js create mode 100644 node_modules/is-decimal/index.js create mode 100644 node_modules/is-decimal/license create mode 100644 node_modules/is-decimal/package.json create mode 100644 node_modules/is-decimal/readme.md create mode 100644 node_modules/is-expression/CHANGELOG.md create mode 100644 node_modules/is-expression/LICENSE.md create mode 100644 node_modules/is-expression/README.md create mode 100644 node_modules/is-expression/index.js create mode 100644 node_modules/is-expression/package.json create mode 100644 node_modules/is-extendable/LICENSE create mode 100644 node_modules/is-extendable/README.md create mode 100644 node_modules/is-extendable/index.js create mode 100644 node_modules/is-extendable/package.json create mode 100644 node_modules/is-extglob/LICENSE create mode 100644 node_modules/is-extglob/README.md create mode 100644 node_modules/is-extglob/index.js create mode 100644 node_modules/is-extglob/package.json create mode 100644 node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/is-glob/LICENSE create mode 100644 node_modules/is-glob/README.md create mode 100644 node_modules/is-glob/index.js create mode 100644 node_modules/is-glob/package.json create mode 100644 node_modules/is-json/.npmignore create mode 100644 node_modules/is-json/.travis.yml create mode 100644 node_modules/is-json/LICENSE create mode 100644 node_modules/is-json/README.md create mode 100644 node_modules/is-json/index.js create mode 100644 node_modules/is-json/package.json create mode 100644 node_modules/is-json/test/index.js create mode 100644 node_modules/is-number/LICENSE create mode 100644 node_modules/is-number/README.md create mode 100644 node_modules/is-number/index.js create mode 100644 node_modules/is-number/package.json create mode 100644 node_modules/is-promise/LICENSE create mode 100644 node_modules/is-promise/index.js create mode 100644 node_modules/is-promise/index.mjs create mode 100644 node_modules/is-promise/package.json create mode 100644 node_modules/is-promise/readme.md create mode 100644 node_modules/is-regex/.editorconfig create mode 100644 node_modules/is-regex/.eslintignore create mode 100644 node_modules/is-regex/.eslintrc create mode 100644 node_modules/is-regex/.nycrc create mode 100644 node_modules/is-regex/CHANGELOG.md create mode 100644 node_modules/is-regex/LICENSE create mode 100644 node_modules/is-regex/README.md create mode 100644 node_modules/is-regex/index.js create mode 100644 node_modules/is-regex/package.json create mode 100644 node_modules/is-regex/test/index.js create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/iso-639-1/.eslintrc create mode 100644 node_modules/iso-639-1/.nvmrc create mode 100644 node_modules/iso-639-1/.prettierrc create mode 100644 node_modules/iso-639-1/.travis.yml create mode 100644 node_modules/iso-639-1/.vscode/settings.json create mode 100644 node_modules/iso-639-1/CHANGELOG.md create mode 100644 node_modules/iso-639-1/LICENSE create mode 100644 node_modules/iso-639-1/build/index.js create mode 100644 node_modules/iso-639-1/build/index.js.map create mode 100644 node_modules/iso-639-1/index.d.ts create mode 100644 node_modules/iso-639-1/package.json create mode 100644 node_modules/iso-639-1/readme.md create mode 100644 node_modules/iso-639-1/src/data.js create mode 100644 node_modules/iso-639-1/src/index.js create mode 100644 node_modules/iso-639-1/test/test.js create mode 100644 node_modules/iso-639-1/webpack.config.js create mode 100644 node_modules/jackspeak/LICENSE.md create mode 100644 node_modules/jackspeak/README.md create mode 100644 node_modules/jackspeak/dist/commonjs/index.d.ts create mode 100644 node_modules/jackspeak/dist/commonjs/index.d.ts.map create mode 100644 node_modules/jackspeak/dist/commonjs/index.js create mode 100644 node_modules/jackspeak/dist/commonjs/index.js.map create mode 100644 node_modules/jackspeak/dist/commonjs/package.json create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args-cjs.cjs.map create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args-cjs.d.cts.map create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args.d.ts create mode 100644 node_modules/jackspeak/dist/commonjs/parse-args.js create mode 100644 node_modules/jackspeak/dist/esm/index.d.ts create mode 100644 node_modules/jackspeak/dist/esm/index.d.ts.map create mode 100644 node_modules/jackspeak/dist/esm/index.js create mode 100644 node_modules/jackspeak/dist/esm/index.js.map create mode 100644 node_modules/jackspeak/dist/esm/package.json create mode 100644 node_modules/jackspeak/dist/esm/parse-args.d.ts create mode 100644 node_modules/jackspeak/dist/esm/parse-args.d.ts.map create mode 100644 node_modules/jackspeak/dist/esm/parse-args.js create mode 100644 node_modules/jackspeak/dist/esm/parse-args.js.map create mode 100644 node_modules/jackspeak/package.json create mode 100644 node_modules/jake/Makefile create mode 100644 node_modules/jake/README.md create mode 100755 node_modules/jake/bin/bash_completion.sh create mode 100755 node_modules/jake/bin/cli.js create mode 100644 node_modules/jake/jakefile.js create mode 100644 node_modules/jake/lib/api.js create mode 100644 node_modules/jake/lib/jake.js create mode 100644 node_modules/jake/lib/loader.js create mode 100644 node_modules/jake/lib/namespace.js create mode 100644 node_modules/jake/lib/package_task.js create mode 100644 node_modules/jake/lib/parseargs.js create mode 100644 node_modules/jake/lib/program.js create mode 100644 node_modules/jake/lib/publish_task.js create mode 100644 node_modules/jake/lib/rule.js create mode 100644 node_modules/jake/lib/task/directory_task.js create mode 100644 node_modules/jake/lib/task/file_task.js create mode 100644 node_modules/jake/lib/task/index.js create mode 100644 node_modules/jake/lib/task/task.js create mode 100644 node_modules/jake/lib/test_task.js create mode 100644 node_modules/jake/lib/utils/file.js create mode 100644 node_modules/jake/lib/utils/index.js create mode 100644 node_modules/jake/lib/utils/logger.js create mode 100644 node_modules/jake/package.json create mode 100644 node_modules/jake/test/integration/concurrent.js create mode 100644 node_modules/jake/test/integration/file.js create mode 100644 node_modules/jake/test/integration/file_task.js create mode 100644 node_modules/jake/test/integration/helpers.js create mode 100644 node_modules/jake/test/integration/jakefile.js create mode 100644 node_modules/jake/test/integration/jakelib/concurrent.jake.js create mode 100644 node_modules/jake/test/integration/jakelib/publish.jake.js create mode 100644 node_modules/jake/test/integration/jakelib/required_module.jake.js create mode 100644 node_modules/jake/test/integration/jakelib/rule.jake.js create mode 100644 node_modules/jake/test/integration/list_tasks.js create mode 100644 node_modules/jake/test/integration/publish_task.js create mode 100644 node_modules/jake/test/integration/rule.js create mode 100644 node_modules/jake/test/integration/selfdep.js create mode 100644 node_modules/jake/test/integration/task_base.js create mode 100644 node_modules/jake/test/unit/jakefile.js create mode 100644 node_modules/jake/test/unit/namespace.js create mode 100644 node_modules/jake/test/unit/parseargs.js create mode 100644 node_modules/jake/usage.txt create mode 100644 node_modules/jiti/LICENSE create mode 100644 node_modules/jiti/README.md create mode 100755 node_modules/jiti/bin/jiti.js create mode 100644 node_modules/jiti/dist/babel.d.ts create mode 100644 node_modules/jiti/dist/babel.js create mode 100644 node_modules/jiti/dist/jiti.d.ts create mode 100644 node_modules/jiti/dist/jiti.js create mode 100644 node_modules/jiti/dist/plugins/babel-plugin-transform-import-meta.d.ts create mode 100644 node_modules/jiti/dist/plugins/import-meta-env.d.ts create mode 100644 node_modules/jiti/dist/types.d.ts create mode 100644 node_modules/jiti/dist/utils.d.ts create mode 100644 node_modules/jiti/lib/index.js create mode 100644 node_modules/jiti/package.json create mode 100644 node_modules/jiti/register.js create mode 100644 node_modules/js-stringify/.npmignore create mode 100644 node_modules/js-stringify/.travis.yml create mode 100644 node_modules/js-stringify/LICENSE create mode 100644 node_modules/js-stringify/README.md create mode 100644 node_modules/js-stringify/index.js create mode 100644 node_modules/js-stringify/package.json create mode 100644 node_modules/js-stringify/test/index.js create mode 100644 node_modules/js-yaml/CHANGELOG.md create mode 100644 node_modules/js-yaml/LICENSE create mode 100644 node_modules/js-yaml/README.md create mode 100755 node_modules/js-yaml/bin/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 node_modules/js-yaml/index.js create mode 100644 node_modules/js-yaml/lib/js-yaml.js create mode 100644 node_modules/js-yaml/lib/js-yaml/common.js create mode 100644 node_modules/js-yaml/lib/js-yaml/dumper.js create mode 100644 node_modules/js-yaml/lib/js-yaml/exception.js create mode 100644 node_modules/js-yaml/lib/js-yaml/loader.js create mode 100644 node_modules/js-yaml/lib/js-yaml/mark.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/core.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_full.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_safe.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/failsafe.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/json.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/binary.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/bool.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/float.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/int.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/function.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/regexp.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/undefined.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/map.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/merge.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/null.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/omap.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/pairs.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/seq.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/set.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/str.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/timestamp.js create mode 100644 node_modules/js-yaml/package.json create mode 100644 node_modules/jstransformer/CHANGELOG.md create mode 100644 node_modules/jstransformer/LICENSE.md create mode 100644 node_modules/jstransformer/README.md create mode 100644 node_modules/jstransformer/index.js create mode 100644 node_modules/jstransformer/package.json create mode 100644 node_modules/junk/index.js create mode 100644 node_modules/junk/license create mode 100644 node_modules/junk/package.json create mode 100644 node_modules/junk/readme.md create mode 100644 node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/kind-of/LICENSE create mode 100644 node_modules/kind-of/README.md create mode 100644 node_modules/kind-of/index.js create mode 100644 node_modules/kind-of/package.json create mode 100644 node_modules/kleur/colors.d.ts create mode 100644 node_modules/kleur/colors.js create mode 100644 node_modules/kleur/colors.mjs create mode 100644 node_modules/kleur/index.d.ts create mode 100644 node_modules/kleur/index.js create mode 100644 node_modules/kleur/index.mjs create mode 100644 node_modules/kleur/license create mode 100644 node_modules/kleur/package.json create mode 100644 node_modules/kleur/readme.md create mode 100644 node_modules/lilconfig/LICENSE create mode 100644 node_modules/lilconfig/dist/index.d.ts create mode 100644 node_modules/lilconfig/dist/index.js create mode 100644 node_modules/lilconfig/package.json create mode 100644 node_modules/lilconfig/readme.md create mode 100644 node_modules/lines-and-columns/LICENSE create mode 100644 node_modules/lines-and-columns/README.md create mode 100644 node_modules/lines-and-columns/build/index.d.ts create mode 100644 node_modules/lines-and-columns/build/index.js create mode 100644 node_modules/lines-and-columns/package.json create mode 100644 node_modules/linkify-it/LICENSE create mode 100644 node_modules/linkify-it/README.md create mode 100644 node_modules/linkify-it/index.js create mode 100644 node_modules/linkify-it/lib/re.js create mode 100644 node_modules/linkify-it/package.json create mode 100644 node_modules/liquidjs/LICENSE create mode 100644 node_modules/liquidjs/README.md create mode 100755 node_modules/liquidjs/bin/liquid.js create mode 100644 node_modules/liquidjs/dist/build/fs-impl-browser.d.ts create mode 100644 node_modules/liquidjs/dist/build/fs-impl-browser.spec.d.ts create mode 100644 node_modules/liquidjs/dist/build/streamed-emitter-browser.d.ts create mode 100644 node_modules/liquidjs/dist/build/streamed-emitter-browser.spec.d.ts create mode 100644 node_modules/liquidjs/dist/cache/cache.d.ts create mode 100644 node_modules/liquidjs/dist/cache/index.d.ts create mode 100644 node_modules/liquidjs/dist/cache/lru.d.ts create mode 100644 node_modules/liquidjs/dist/cache/lru.spec.d.ts create mode 100644 node_modules/liquidjs/dist/context/block-mode.d.ts create mode 100644 node_modules/liquidjs/dist/context/context.d.ts create mode 100644 node_modules/liquidjs/dist/context/context.spec.d.ts create mode 100644 node_modules/liquidjs/dist/context/index.d.ts create mode 100644 node_modules/liquidjs/dist/context/scope.d.ts create mode 100644 node_modules/liquidjs/dist/drop/blank-drop.d.ts create mode 100644 node_modules/liquidjs/dist/drop/block-drop.d.ts create mode 100644 node_modules/liquidjs/dist/drop/comparable.d.ts create mode 100644 node_modules/liquidjs/dist/drop/drop.d.ts create mode 100644 node_modules/liquidjs/dist/drop/empty-drop.d.ts create mode 100644 node_modules/liquidjs/dist/drop/forloop-drop.d.ts create mode 100644 node_modules/liquidjs/dist/drop/index.d.ts create mode 100644 node_modules/liquidjs/dist/drop/null-drop.d.ts create mode 100644 node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts create mode 100644 node_modules/liquidjs/dist/emitters/emitter.d.ts create mode 100644 node_modules/liquidjs/dist/emitters/index.d.ts create mode 100644 node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts create mode 100644 node_modules/liquidjs/dist/emitters/simple-emitter.d.ts create mode 100644 node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts create mode 100644 node_modules/liquidjs/dist/filters/array.d.ts create mode 100644 node_modules/liquidjs/dist/filters/date.d.ts create mode 100644 node_modules/liquidjs/dist/filters/html.d.ts create mode 100644 node_modules/liquidjs/dist/filters/index.d.ts create mode 100644 node_modules/liquidjs/dist/filters/math.d.ts create mode 100644 node_modules/liquidjs/dist/filters/misc.d.ts create mode 100644 node_modules/liquidjs/dist/filters/string.d.ts create mode 100644 node_modules/liquidjs/dist/filters/url.d.ts create mode 100644 node_modules/liquidjs/dist/fs/fs-impl.d.ts create mode 100644 node_modules/liquidjs/dist/fs/fs-impl.spec.d.ts create mode 100644 node_modules/liquidjs/dist/fs/fs.d.ts create mode 100644 node_modules/liquidjs/dist/fs/index.d.ts create mode 100644 node_modules/liquidjs/dist/fs/loader.d.ts create mode 100644 node_modules/liquidjs/dist/fs/loader.spec.d.ts create mode 100644 node_modules/liquidjs/dist/fs/node-require.d.ts create mode 100644 node_modules/liquidjs/dist/index.d.ts create mode 100644 node_modules/liquidjs/dist/liquid-options.d.ts create mode 100644 node_modules/liquidjs/dist/liquid-options.spec.d.ts create mode 100644 node_modules/liquidjs/dist/liquid.browser.esm.js create mode 100644 node_modules/liquidjs/dist/liquid.browser.min.js create mode 100644 node_modules/liquidjs/dist/liquid.browser.min.js.map create mode 100644 node_modules/liquidjs/dist/liquid.browser.umd.js create mode 100644 node_modules/liquidjs/dist/liquid.browser.umd.js.map create mode 100644 node_modules/liquidjs/dist/liquid.d.ts create mode 100644 node_modules/liquidjs/dist/liquid.node.cjs.js create mode 100644 node_modules/liquidjs/dist/liquid.node.esm.js create mode 100644 node_modules/liquidjs/dist/parser/filter-arg.d.ts create mode 100644 node_modules/liquidjs/dist/parser/index.d.ts create mode 100644 node_modules/liquidjs/dist/parser/parse-stream.d.ts create mode 100644 node_modules/liquidjs/dist/parser/parse-stream.spec.d.ts create mode 100644 node_modules/liquidjs/dist/parser/parser.d.ts create mode 100644 node_modules/liquidjs/dist/parser/token-kind.d.ts create mode 100644 node_modules/liquidjs/dist/parser/tokenizer.d.ts create mode 100644 node_modules/liquidjs/dist/parser/tokenizer.spec.d.ts create mode 100644 node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts create mode 100644 node_modules/liquidjs/dist/render/boolean.d.ts create mode 100644 node_modules/liquidjs/dist/render/boolean.spec.d.ts create mode 100644 node_modules/liquidjs/dist/render/expression.d.ts create mode 100644 node_modules/liquidjs/dist/render/expression.spec.d.ts create mode 100644 node_modules/liquidjs/dist/render/index.d.ts create mode 100644 node_modules/liquidjs/dist/render/operator.d.ts create mode 100644 node_modules/liquidjs/dist/render/render.d.ts create mode 100644 node_modules/liquidjs/dist/render/render.spec.d.ts create mode 100644 node_modules/liquidjs/dist/render/string.d.ts create mode 100644 node_modules/liquidjs/dist/render/string.spec.d.ts create mode 100644 node_modules/liquidjs/dist/tags/assign.d.ts create mode 100644 node_modules/liquidjs/dist/tags/block.d.ts create mode 100644 node_modules/liquidjs/dist/tags/break.d.ts create mode 100644 node_modules/liquidjs/dist/tags/capture.d.ts create mode 100644 node_modules/liquidjs/dist/tags/case.d.ts create mode 100644 node_modules/liquidjs/dist/tags/comment.d.ts create mode 100644 node_modules/liquidjs/dist/tags/continue.d.ts create mode 100644 node_modules/liquidjs/dist/tags/cycle.d.ts create mode 100644 node_modules/liquidjs/dist/tags/decrement.d.ts create mode 100644 node_modules/liquidjs/dist/tags/echo.d.ts create mode 100644 node_modules/liquidjs/dist/tags/for.d.ts create mode 100644 node_modules/liquidjs/dist/tags/if.d.ts create mode 100644 node_modules/liquidjs/dist/tags/include.d.ts create mode 100644 node_modules/liquidjs/dist/tags/increment.d.ts create mode 100644 node_modules/liquidjs/dist/tags/index.d.ts create mode 100644 node_modules/liquidjs/dist/tags/inline-comment.d.ts create mode 100644 node_modules/liquidjs/dist/tags/layout.d.ts create mode 100644 node_modules/liquidjs/dist/tags/liquid.d.ts create mode 100644 node_modules/liquidjs/dist/tags/raw.d.ts create mode 100644 node_modules/liquidjs/dist/tags/render.d.ts create mode 100644 node_modules/liquidjs/dist/tags/tablerow.d.ts create mode 100644 node_modules/liquidjs/dist/tags/unless.d.ts create mode 100644 node_modules/liquidjs/dist/template/filter-impl-options.d.ts create mode 100644 node_modules/liquidjs/dist/template/filter.d.ts create mode 100644 node_modules/liquidjs/dist/template/filter.spec.d.ts create mode 100644 node_modules/liquidjs/dist/template/hash.d.ts create mode 100644 node_modules/liquidjs/dist/template/hash.spec.d.ts create mode 100644 node_modules/liquidjs/dist/template/html.d.ts create mode 100644 node_modules/liquidjs/dist/template/index.d.ts create mode 100644 node_modules/liquidjs/dist/template/output.d.ts create mode 100644 node_modules/liquidjs/dist/template/output.spec.d.ts create mode 100644 node_modules/liquidjs/dist/template/tag-options-adapter.d.ts create mode 100644 node_modules/liquidjs/dist/template/tag.d.ts create mode 100644 node_modules/liquidjs/dist/template/template-impl.d.ts create mode 100644 node_modules/liquidjs/dist/template/template.d.ts create mode 100644 node_modules/liquidjs/dist/template/value.d.ts create mode 100644 node_modules/liquidjs/dist/template/value.spec.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/delimited-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/filter-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/filtered-value-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/hash-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/html-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/identifier-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/index.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/literal-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/number-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/operator-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/output-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/property-access-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/quoted-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/range-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/tag-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/top-level-token.d.ts create mode 100644 node_modules/liquidjs/dist/tokens/value-token.d.ts create mode 100644 node_modules/liquidjs/dist/util/assert.d.ts create mode 100644 node_modules/liquidjs/dist/util/assert.spec.d.ts create mode 100644 node_modules/liquidjs/dist/util/async.d.ts create mode 100644 node_modules/liquidjs/dist/util/async.spec.d.ts create mode 100644 node_modules/liquidjs/dist/util/character.d.ts create mode 100644 node_modules/liquidjs/dist/util/error.d.ts create mode 100644 node_modules/liquidjs/dist/util/index.d.ts create mode 100644 node_modules/liquidjs/dist/util/liquid-date.d.ts create mode 100644 node_modules/liquidjs/dist/util/literal.d.ts create mode 100644 node_modules/liquidjs/dist/util/operator-trie.d.ts create mode 100644 node_modules/liquidjs/dist/util/strftime.d.ts create mode 100644 node_modules/liquidjs/dist/util/strftime.spec.d.ts create mode 100644 node_modules/liquidjs/dist/util/timezone-date.d.ts create mode 100644 node_modules/liquidjs/dist/util/timezone-date.spec.d.ts create mode 100644 node_modules/liquidjs/dist/util/type-guards.d.ts create mode 100644 node_modules/liquidjs/dist/util/underscore.d.ts create mode 100644 node_modules/liquidjs/dist/util/underscore.spec.d.ts create mode 100644 node_modules/liquidjs/package.json create mode 100644 node_modules/list-to-array/.npmignore create mode 100644 node_modules/list-to-array/LICENSE create mode 100644 node_modules/list-to-array/README.md create mode 100644 node_modules/list-to-array/index.js create mode 100644 node_modules/list-to-array/package.json create mode 100644 node_modules/list-to-array/tests.js create mode 100644 node_modules/lodash.deburr/LICENSE create mode 100644 node_modules/lodash.deburr/README.md create mode 100644 node_modules/lodash.deburr/index.js create mode 100644 node_modules/lodash.deburr/package.json create mode 100644 node_modules/lru-cache/LICENSE create mode 100644 node_modules/lru-cache/README.md create mode 100644 node_modules/lru-cache/dist/commonjs/index.d.ts create mode 100644 node_modules/lru-cache/dist/commonjs/index.d.ts.map create mode 100644 node_modules/lru-cache/dist/commonjs/index.js create mode 100644 node_modules/lru-cache/dist/commonjs/index.js.map create mode 100644 node_modules/lru-cache/dist/commonjs/index.min.js create mode 100644 node_modules/lru-cache/dist/commonjs/index.min.js.map create mode 100644 node_modules/lru-cache/dist/commonjs/package.json create mode 100644 node_modules/lru-cache/dist/esm/index.d.ts create mode 100644 node_modules/lru-cache/dist/esm/index.d.ts.map create mode 100644 node_modules/lru-cache/dist/esm/index.js create mode 100644 node_modules/lru-cache/dist/esm/index.js.map create mode 100644 node_modules/lru-cache/dist/esm/index.min.js create mode 100644 node_modules/lru-cache/dist/esm/index.min.js.map create mode 100644 node_modules/lru-cache/dist/esm/package.json create mode 100644 node_modules/lru-cache/package.json create mode 100644 node_modules/luxon/LICENSE.md create mode 100644 node_modules/luxon/README.md create mode 100644 node_modules/luxon/build/amd/luxon.js create mode 100644 node_modules/luxon/build/amd/luxon.js.map create mode 100644 node_modules/luxon/build/cjs-browser/luxon.js create mode 100644 node_modules/luxon/build/cjs-browser/luxon.js.map create mode 100644 node_modules/luxon/build/es6/luxon.js create mode 100644 node_modules/luxon/build/es6/luxon.js.map create mode 100644 node_modules/luxon/build/global/luxon.js create mode 100644 node_modules/luxon/build/global/luxon.js.map create mode 100644 node_modules/luxon/build/global/luxon.min.js create mode 100644 node_modules/luxon/build/global/luxon.min.js.map create mode 100644 node_modules/luxon/build/node/luxon.js create mode 100644 node_modules/luxon/build/node/luxon.js.map create mode 100644 node_modules/luxon/package.json create mode 100644 node_modules/luxon/src/datetime.js create mode 100644 node_modules/luxon/src/duration.js create mode 100644 node_modules/luxon/src/errors.js create mode 100644 node_modules/luxon/src/impl/conversions.js create mode 100644 node_modules/luxon/src/impl/diff.js create mode 100644 node_modules/luxon/src/impl/digits.js create mode 100644 node_modules/luxon/src/impl/english.js create mode 100644 node_modules/luxon/src/impl/formats.js create mode 100644 node_modules/luxon/src/impl/formatter.js create mode 100644 node_modules/luxon/src/impl/invalid.js create mode 100644 node_modules/luxon/src/impl/locale.js create mode 100644 node_modules/luxon/src/impl/regexParser.js create mode 100644 node_modules/luxon/src/impl/tokenParser.js create mode 100644 node_modules/luxon/src/impl/util.js create mode 100644 node_modules/luxon/src/impl/zoneUtil.js create mode 100644 node_modules/luxon/src/info.js create mode 100644 node_modules/luxon/src/interval.js create mode 100644 node_modules/luxon/src/luxon.js create mode 100644 node_modules/luxon/src/package.json create mode 100644 node_modules/luxon/src/settings.js create mode 100644 node_modules/luxon/src/zone.js create mode 100644 node_modules/luxon/src/zones/IANAZone.js create mode 100644 node_modules/luxon/src/zones/fixedOffsetZone.js create mode 100644 node_modules/luxon/src/zones/invalidZone.js create mode 100644 node_modules/luxon/src/zones/systemZone.js create mode 100644 node_modules/markdown-it/LICENSE create mode 100644 node_modules/markdown-it/README.md create mode 100755 node_modules/markdown-it/bin/markdown-it.js create mode 100644 node_modules/markdown-it/dist/markdown-it.js create mode 100644 node_modules/markdown-it/dist/markdown-it.min.js create mode 100644 node_modules/markdown-it/index.js create mode 100644 node_modules/markdown-it/lib/common/entities.js create mode 100644 node_modules/markdown-it/lib/common/html_blocks.js create mode 100644 node_modules/markdown-it/lib/common/html_re.js create mode 100644 node_modules/markdown-it/lib/common/utils.js create mode 100644 node_modules/markdown-it/lib/helpers/index.js create mode 100644 node_modules/markdown-it/lib/helpers/parse_link_destination.js create mode 100644 node_modules/markdown-it/lib/helpers/parse_link_label.js create mode 100644 node_modules/markdown-it/lib/helpers/parse_link_title.js create mode 100644 node_modules/markdown-it/lib/index.js create mode 100644 node_modules/markdown-it/lib/parser_block.js create mode 100644 node_modules/markdown-it/lib/parser_core.js create mode 100644 node_modules/markdown-it/lib/parser_inline.js create mode 100644 node_modules/markdown-it/lib/presets/commonmark.js create mode 100644 node_modules/markdown-it/lib/presets/default.js create mode 100644 node_modules/markdown-it/lib/presets/zero.js create mode 100644 node_modules/markdown-it/lib/renderer.js create mode 100644 node_modules/markdown-it/lib/ruler.js create mode 100644 node_modules/markdown-it/lib/rules_block/blockquote.js create mode 100644 node_modules/markdown-it/lib/rules_block/code.js create mode 100644 node_modules/markdown-it/lib/rules_block/fence.js create mode 100644 node_modules/markdown-it/lib/rules_block/heading.js create mode 100644 node_modules/markdown-it/lib/rules_block/hr.js create mode 100644 node_modules/markdown-it/lib/rules_block/html_block.js create mode 100644 node_modules/markdown-it/lib/rules_block/lheading.js create mode 100644 node_modules/markdown-it/lib/rules_block/list.js create mode 100644 node_modules/markdown-it/lib/rules_block/paragraph.js create mode 100644 node_modules/markdown-it/lib/rules_block/reference.js create mode 100644 node_modules/markdown-it/lib/rules_block/state_block.js create mode 100644 node_modules/markdown-it/lib/rules_block/table.js create mode 100644 node_modules/markdown-it/lib/rules_core/block.js create mode 100644 node_modules/markdown-it/lib/rules_core/inline.js create mode 100644 node_modules/markdown-it/lib/rules_core/linkify.js create mode 100644 node_modules/markdown-it/lib/rules_core/normalize.js create mode 100644 node_modules/markdown-it/lib/rules_core/replacements.js create mode 100644 node_modules/markdown-it/lib/rules_core/smartquotes.js create mode 100644 node_modules/markdown-it/lib/rules_core/state_core.js create mode 100644 node_modules/markdown-it/lib/rules_core/text_join.js create mode 100644 node_modules/markdown-it/lib/rules_inline/autolink.js create mode 100644 node_modules/markdown-it/lib/rules_inline/backticks.js create mode 100644 node_modules/markdown-it/lib/rules_inline/balance_pairs.js create mode 100644 node_modules/markdown-it/lib/rules_inline/emphasis.js create mode 100644 node_modules/markdown-it/lib/rules_inline/entity.js create mode 100644 node_modules/markdown-it/lib/rules_inline/escape.js create mode 100644 node_modules/markdown-it/lib/rules_inline/fragments_join.js create mode 100644 node_modules/markdown-it/lib/rules_inline/html_inline.js create mode 100644 node_modules/markdown-it/lib/rules_inline/image.js create mode 100644 node_modules/markdown-it/lib/rules_inline/link.js create mode 100644 node_modules/markdown-it/lib/rules_inline/linkify.js create mode 100644 node_modules/markdown-it/lib/rules_inline/newline.js create mode 100644 node_modules/markdown-it/lib/rules_inline/state_inline.js create mode 100644 node_modules/markdown-it/lib/rules_inline/strikethrough.js create mode 100644 node_modules/markdown-it/lib/rules_inline/text.js create mode 100644 node_modules/markdown-it/lib/token.js create mode 100644 node_modules/markdown-it/node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/markdown-it/node_modules/argparse/LICENSE create mode 100644 node_modules/markdown-it/node_modules/argparse/README.md create mode 100644 node_modules/markdown-it/node_modules/argparse/argparse.js create mode 100644 node_modules/markdown-it/node_modules/argparse/lib/sub.js create mode 100644 node_modules/markdown-it/node_modules/argparse/lib/textwrap.js create mode 100644 node_modules/markdown-it/node_modules/argparse/package.json create mode 100644 node_modules/markdown-it/package.json create mode 100644 node_modules/maximatch/index.js create mode 100644 node_modules/maximatch/license create mode 100644 node_modules/maximatch/node_modules/array-differ/index.js create mode 100644 node_modules/maximatch/node_modules/array-differ/package.json create mode 100644 node_modules/maximatch/node_modules/array-differ/readme.md create mode 100644 node_modules/maximatch/node_modules/array-union/index.js create mode 100644 node_modules/maximatch/node_modules/array-union/license create mode 100644 node_modules/maximatch/node_modules/array-union/package.json create mode 100644 node_modules/maximatch/node_modules/array-union/readme.md create mode 100644 node_modules/maximatch/node_modules/arrify/index.js create mode 100644 node_modules/maximatch/node_modules/arrify/license create mode 100644 node_modules/maximatch/node_modules/arrify/package.json create mode 100644 node_modules/maximatch/node_modules/arrify/readme.md create mode 100644 node_modules/maximatch/package.json create mode 100644 node_modules/maximatch/readme.md create mode 100644 node_modules/mdurl/CHANGELOG.md create mode 100644 node_modules/mdurl/LICENSE create mode 100644 node_modules/mdurl/README.md create mode 100644 node_modules/mdurl/decode.js create mode 100644 node_modules/mdurl/encode.js create mode 100644 node_modules/mdurl/format.js create mode 100644 node_modules/mdurl/index.js create mode 100644 node_modules/mdurl/package.json create mode 100644 node_modules/mdurl/parse.js create mode 100644 node_modules/merge2/LICENSE create mode 100644 node_modules/merge2/README.md create mode 100644 node_modules/merge2/index.js create mode 100644 node_modules/merge2/package.json create mode 100755 node_modules/micromatch/LICENSE create mode 100644 node_modules/micromatch/README.md create mode 100644 node_modules/micromatch/index.js create mode 100644 node_modules/micromatch/package.json create mode 100644 node_modules/mime/CHANGELOG.md create mode 100644 node_modules/mime/LICENSE create mode 100644 node_modules/mime/Mime.js create mode 100644 node_modules/mime/README.md create mode 100755 node_modules/mime/cli.js create mode 100644 node_modules/mime/index.js create mode 100644 node_modules/mime/lite.js create mode 100644 node_modules/mime/package.json create mode 100644 node_modules/mime/types/other.js create mode 100644 node_modules/mime/types/standard.js create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/node_modules/brace-expansion/LICENSE create mode 100644 node_modules/minimatch/node_modules/brace-expansion/README.md create mode 100644 node_modules/minimatch/node_modules/brace-expansion/index.js create mode 100644 node_modules/minimatch/node_modules/brace-expansion/package.json create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/minimist/.eslintrc create mode 100644 node_modules/minimist/.github/FUNDING.yml create mode 100644 node_modules/minimist/.nycrc create mode 100644 node_modules/minimist/CHANGELOG.md create mode 100644 node_modules/minimist/LICENSE create mode 100644 node_modules/minimist/README.md create mode 100644 node_modules/minimist/example/parse.js create mode 100644 node_modules/minimist/index.js create mode 100644 node_modules/minimist/package.json create mode 100644 node_modules/minimist/test/all_bool.js create mode 100644 node_modules/minimist/test/bool.js create mode 100644 node_modules/minimist/test/dash.js create mode 100644 node_modules/minimist/test/default_bool.js create mode 100644 node_modules/minimist/test/dotted.js create mode 100644 node_modules/minimist/test/kv_short.js create mode 100644 node_modules/minimist/test/long.js create mode 100644 node_modules/minimist/test/num.js create mode 100644 node_modules/minimist/test/parse.js create mode 100644 node_modules/minimist/test/parse_modified.js create mode 100644 node_modules/minimist/test/proto.js create mode 100644 node_modules/minimist/test/short.js create mode 100644 node_modules/minimist/test/stop_early.js create mode 100644 node_modules/minimist/test/unknown.js create mode 100644 node_modules/minimist/test/whitespace.js create mode 100644 node_modules/minipass/LICENSE create mode 100644 node_modules/minipass/README.md create mode 100644 node_modules/minipass/dist/commonjs/index.d.ts create mode 100644 node_modules/minipass/dist/commonjs/index.d.ts.map create mode 100644 node_modules/minipass/dist/commonjs/index.js create mode 100644 node_modules/minipass/dist/commonjs/index.js.map create mode 100644 node_modules/minipass/dist/commonjs/package.json create mode 100644 node_modules/minipass/dist/esm/index.d.ts create mode 100644 node_modules/minipass/dist/esm/index.d.ts.map create mode 100644 node_modules/minipass/dist/esm/index.js create mode 100644 node_modules/minipass/dist/esm/index.js.map create mode 100644 node_modules/minipass/dist/esm/package.json create mode 100644 node_modules/minipass/package.json create mode 100644 node_modules/mkdirp/LICENSE create mode 100755 node_modules/mkdirp/bin/cmd.js create mode 100644 node_modules/mkdirp/bin/usage.txt create mode 100644 node_modules/mkdirp/index.js create mode 100644 node_modules/mkdirp/package.json create mode 100644 node_modules/mkdirp/readme.markdown create mode 100644 node_modules/moo/LICENSE create mode 100644 node_modules/moo/README.md create mode 100644 node_modules/moo/moo.js create mode 100644 node_modules/moo/package.json create mode 100644 node_modules/morphdom/CHANGELOG.md create mode 100644 node_modules/morphdom/LICENSE create mode 100644 node_modules/morphdom/README.md create mode 100644 node_modules/morphdom/dist/morphdom-esm.js create mode 100644 node_modules/morphdom/dist/morphdom-factory.js create mode 100644 node_modules/morphdom/dist/morphdom-umd.js create mode 100644 node_modules/morphdom/dist/morphdom-umd.min.js create mode 100644 node_modules/morphdom/dist/morphdom.js create mode 100644 node_modules/morphdom/docs/old-benchmark.md create mode 100644 node_modules/morphdom/docs/virtual-dom.md create mode 100644 node_modules/morphdom/factory.js create mode 100644 node_modules/morphdom/index.d.ts create mode 100644 node_modules/morphdom/package.json create mode 100644 node_modules/morphdom/src/index.js create mode 100644 node_modules/morphdom/src/morphAttrs.js create mode 100644 node_modules/morphdom/src/morphdom.js create mode 100644 node_modules/morphdom/src/specialElHandlers.js create mode 100644 node_modules/morphdom/src/util.js create mode 100644 node_modules/ms/index.js create mode 100644 node_modules/ms/license.md create mode 100644 node_modules/ms/package.json create mode 100644 node_modules/ms/readme.md create mode 100644 node_modules/multimatch/index.d.ts create mode 100644 node_modules/multimatch/index.js create mode 100644 node_modules/multimatch/license create mode 100644 node_modules/multimatch/package.json create mode 100644 node_modules/multimatch/readme.md create mode 100644 node_modules/mustache/CHANGELOG.md create mode 100644 node_modules/mustache/LICENSE create mode 100644 node_modules/mustache/README.md create mode 100755 node_modules/mustache/bin/mustache create mode 100644 node_modules/mustache/mustache.js create mode 100644 node_modules/mustache/mustache.min.js create mode 100644 node_modules/mustache/mustache.mjs create mode 100644 node_modules/mustache/package.json create mode 100644 node_modules/mustache/wrappers/dojo/mustache.js.post create mode 100644 node_modules/mustache/wrappers/dojo/mustache.js.pre create mode 100644 node_modules/mustache/wrappers/jquery/mustache.js.post create mode 100644 node_modules/mustache/wrappers/jquery/mustache.js.pre create mode 100644 node_modules/mustache/wrappers/mootools/mustache.js.post create mode 100644 node_modules/mustache/wrappers/mootools/mustache.js.pre create mode 100644 node_modules/mustache/wrappers/qooxdoo/mustache.js.post create mode 100644 node_modules/mustache/wrappers/qooxdoo/mustache.js.pre create mode 100644 node_modules/mustache/wrappers/yui3/mustache.js.post create mode 100644 node_modules/mustache/wrappers/yui3/mustache.js.pre create mode 100644 node_modules/mz/HISTORY.md create mode 100644 node_modules/mz/LICENSE create mode 100644 node_modules/mz/README.md create mode 100644 node_modules/mz/child_process.js create mode 100644 node_modules/mz/crypto.js create mode 100644 node_modules/mz/dns.js create mode 100644 node_modules/mz/fs.js create mode 100644 node_modules/mz/index.js create mode 100644 node_modules/mz/package.json create mode 100644 node_modules/mz/readline.js create mode 100644 node_modules/mz/zlib.js create mode 100644 node_modules/nanoid/LICENSE create mode 100644 node_modules/nanoid/README.md create mode 100644 node_modules/nanoid/async/index.browser.cjs create mode 100644 node_modules/nanoid/async/index.browser.js create mode 100644 node_modules/nanoid/async/index.cjs create mode 100644 node_modules/nanoid/async/index.d.ts create mode 100644 node_modules/nanoid/async/index.js create mode 100644 node_modules/nanoid/async/index.native.js create mode 100644 node_modules/nanoid/async/package.json create mode 100755 node_modules/nanoid/bin/nanoid.cjs create mode 100644 node_modules/nanoid/index.browser.cjs create mode 100644 node_modules/nanoid/index.browser.js create mode 100644 node_modules/nanoid/index.cjs create mode 100644 node_modules/nanoid/index.d.cts create mode 100644 node_modules/nanoid/index.d.ts create mode 100644 node_modules/nanoid/index.js create mode 100644 node_modules/nanoid/nanoid.js create mode 100644 node_modules/nanoid/non-secure/index.cjs create mode 100644 node_modules/nanoid/non-secure/index.d.ts create mode 100644 node_modules/nanoid/non-secure/index.js create mode 100644 node_modules/nanoid/non-secure/package.json create mode 100644 node_modules/nanoid/package.json create mode 100644 node_modules/nanoid/url-alphabet/index.cjs create mode 100644 node_modules/nanoid/url-alphabet/index.js create mode 100644 node_modules/nanoid/url-alphabet/package.json create mode 100644 node_modules/neo-async/LICENSE create mode 100644 node_modules/neo-async/README.md create mode 100644 node_modules/neo-async/all.js create mode 100644 node_modules/neo-async/allLimit.js create mode 100644 node_modules/neo-async/allSeries.js create mode 100644 node_modules/neo-async/angelFall.js create mode 100644 node_modules/neo-async/any.js create mode 100644 node_modules/neo-async/anyLimit.js create mode 100644 node_modules/neo-async/anySeries.js create mode 100644 node_modules/neo-async/apply.js create mode 100644 node_modules/neo-async/applyEach.js create mode 100644 node_modules/neo-async/applyEachSeries.js create mode 100644 node_modules/neo-async/async.js create mode 100644 node_modules/neo-async/async.min.js create mode 100644 node_modules/neo-async/asyncify.js create mode 100644 node_modules/neo-async/auto.js create mode 100644 node_modules/neo-async/autoInject.js create mode 100644 node_modules/neo-async/cargo.js create mode 100644 node_modules/neo-async/compose.js create mode 100644 node_modules/neo-async/concat.js create mode 100644 node_modules/neo-async/concatLimit.js create mode 100644 node_modules/neo-async/concatSeries.js create mode 100644 node_modules/neo-async/constant.js create mode 100644 node_modules/neo-async/createLogger.js create mode 100644 node_modules/neo-async/detect.js create mode 100644 node_modules/neo-async/detectLimit.js create mode 100644 node_modules/neo-async/detectSeries.js create mode 100644 node_modules/neo-async/dir.js create mode 100644 node_modules/neo-async/doDuring.js create mode 100644 node_modules/neo-async/doUntil.js create mode 100644 node_modules/neo-async/doWhilst.js create mode 100644 node_modules/neo-async/during.js create mode 100644 node_modules/neo-async/each.js create mode 100644 node_modules/neo-async/eachLimit.js create mode 100644 node_modules/neo-async/eachOf.js create mode 100644 node_modules/neo-async/eachOfLimit.js create mode 100644 node_modules/neo-async/eachOfSeries.js create mode 100644 node_modules/neo-async/eachSeries.js create mode 100644 node_modules/neo-async/ensureAsync.js create mode 100644 node_modules/neo-async/every.js create mode 100644 node_modules/neo-async/everyLimit.js create mode 100644 node_modules/neo-async/everySeries.js create mode 100644 node_modules/neo-async/fast.js create mode 100644 node_modules/neo-async/filter.js create mode 100644 node_modules/neo-async/filterLimit.js create mode 100644 node_modules/neo-async/filterSeries.js create mode 100644 node_modules/neo-async/find.js create mode 100644 node_modules/neo-async/findLimit.js create mode 100644 node_modules/neo-async/findSeries.js create mode 100644 node_modules/neo-async/foldl.js create mode 100644 node_modules/neo-async/foldr.js create mode 100644 node_modules/neo-async/forEach.js create mode 100644 node_modules/neo-async/forEachLimit.js create mode 100644 node_modules/neo-async/forEachOf.js create mode 100644 node_modules/neo-async/forEachOfLimit.js create mode 100644 node_modules/neo-async/forEachOfSeries.js create mode 100644 node_modules/neo-async/forEachSeries.js create mode 100644 node_modules/neo-async/forever.js create mode 100644 node_modules/neo-async/groupBy.js create mode 100644 node_modules/neo-async/groupByLimit.js create mode 100644 node_modules/neo-async/groupBySeries.js create mode 100644 node_modules/neo-async/inject.js create mode 100644 node_modules/neo-async/iterator.js create mode 100644 node_modules/neo-async/log.js create mode 100644 node_modules/neo-async/map.js create mode 100644 node_modules/neo-async/mapLimit.js create mode 100644 node_modules/neo-async/mapSeries.js create mode 100644 node_modules/neo-async/mapValues.js create mode 100644 node_modules/neo-async/mapValuesLimit.js create mode 100644 node_modules/neo-async/mapValuesSeries.js create mode 100644 node_modules/neo-async/memoize.js create mode 100644 node_modules/neo-async/nextTick.js create mode 100644 node_modules/neo-async/omit.js create mode 100644 node_modules/neo-async/omitLimit.js create mode 100644 node_modules/neo-async/omitSeries.js create mode 100644 node_modules/neo-async/package.json create mode 100644 node_modules/neo-async/parallel.js create mode 100644 node_modules/neo-async/parallelLimit.js create mode 100644 node_modules/neo-async/pick.js create mode 100644 node_modules/neo-async/pickLimit.js create mode 100644 node_modules/neo-async/pickSeries.js create mode 100644 node_modules/neo-async/priorityQueue.js create mode 100644 node_modules/neo-async/queue.js create mode 100644 node_modules/neo-async/race.js create mode 100644 node_modules/neo-async/reduce.js create mode 100644 node_modules/neo-async/reduceRight.js create mode 100644 node_modules/neo-async/reflect.js create mode 100644 node_modules/neo-async/reflectAll.js create mode 100644 node_modules/neo-async/reject.js create mode 100644 node_modules/neo-async/rejectLimit.js create mode 100644 node_modules/neo-async/rejectSeries.js create mode 100644 node_modules/neo-async/retry.js create mode 100644 node_modules/neo-async/retryable.js create mode 100644 node_modules/neo-async/safe.js create mode 100644 node_modules/neo-async/select.js create mode 100644 node_modules/neo-async/selectLimit.js create mode 100644 node_modules/neo-async/selectSeries.js create mode 100644 node_modules/neo-async/seq.js create mode 100644 node_modules/neo-async/series.js create mode 100644 node_modules/neo-async/setImmediate.js create mode 100644 node_modules/neo-async/some.js create mode 100644 node_modules/neo-async/someLimit.js create mode 100644 node_modules/neo-async/someSeries.js create mode 100644 node_modules/neo-async/sortBy.js create mode 100644 node_modules/neo-async/sortByLimit.js create mode 100644 node_modules/neo-async/sortBySeries.js create mode 100644 node_modules/neo-async/timeout.js create mode 100644 node_modules/neo-async/times.js create mode 100644 node_modules/neo-async/timesLimit.js create mode 100644 node_modules/neo-async/timesSeries.js create mode 100644 node_modules/neo-async/transform.js create mode 100644 node_modules/neo-async/transformLimit.js create mode 100644 node_modules/neo-async/transformSeries.js create mode 100644 node_modules/neo-async/tryEach.js create mode 100644 node_modules/neo-async/unmemoize.js create mode 100644 node_modules/neo-async/until.js create mode 100644 node_modules/neo-async/waterfall.js create mode 100644 node_modules/neo-async/whilst.js create mode 100644 node_modules/neo-async/wrapSync.js create mode 100644 node_modules/normalize-path/LICENSE create mode 100644 node_modules/normalize-path/README.md create mode 100644 node_modules/normalize-path/index.js create mode 100644 node_modules/normalize-path/package.json create mode 100644 node_modules/nunjucks/LICENSE create mode 100644 node_modules/nunjucks/README.md create mode 100755 node_modules/nunjucks/bin/precompile create mode 100644 node_modules/nunjucks/bin/precompile.cmd create mode 100644 node_modules/nunjucks/browser/nunjucks-slim.js create mode 100644 node_modules/nunjucks/browser/nunjucks-slim.js.map create mode 100644 node_modules/nunjucks/browser/nunjucks-slim.min.js create mode 100644 node_modules/nunjucks/browser/nunjucks-slim.min.js.map create mode 100644 node_modules/nunjucks/browser/nunjucks.js create mode 100644 node_modules/nunjucks/browser/nunjucks.js.map create mode 100644 node_modules/nunjucks/browser/nunjucks.min.js create mode 100644 node_modules/nunjucks/browser/nunjucks.min.js.map create mode 100644 node_modules/nunjucks/index.js create mode 100644 node_modules/nunjucks/node_modules/commander/CHANGELOG.md create mode 100644 node_modules/nunjucks/node_modules/commander/LICENSE create mode 100644 node_modules/nunjucks/node_modules/commander/Readme.md create mode 100644 node_modules/nunjucks/node_modules/commander/index.js create mode 100644 node_modules/nunjucks/node_modules/commander/package.json create mode 100644 node_modules/nunjucks/node_modules/commander/typings/index.d.ts create mode 100644 node_modules/nunjucks/package.json create mode 100644 node_modules/nunjucks/src/compiler.js create mode 100644 node_modules/nunjucks/src/environment.js create mode 100644 node_modules/nunjucks/src/express-app.js create mode 100644 node_modules/nunjucks/src/filters.js create mode 100644 node_modules/nunjucks/src/globals.js create mode 100644 node_modules/nunjucks/src/jinja-compat.js create mode 100644 node_modules/nunjucks/src/lexer.js create mode 100644 node_modules/nunjucks/src/lib.js create mode 100644 node_modules/nunjucks/src/loader.js create mode 100644 node_modules/nunjucks/src/loaders.js create mode 100644 node_modules/nunjucks/src/node-loaders.js create mode 100644 node_modules/nunjucks/src/nodes.js create mode 100644 node_modules/nunjucks/src/object.js create mode 100644 node_modules/nunjucks/src/parser.js create mode 100644 node_modules/nunjucks/src/precompile-global.js create mode 100644 node_modules/nunjucks/src/precompile.js create mode 100644 node_modules/nunjucks/src/precompiled-loader.js create mode 100644 node_modules/nunjucks/src/runtime.js create mode 100644 node_modules/nunjucks/src/tests.js create mode 100644 node_modules/nunjucks/src/transformer.js create mode 100644 node_modules/nunjucks/src/web-loaders.js create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/object-hash/LICENSE create mode 100644 node_modules/object-hash/dist/object_hash.js create mode 100644 node_modules/object-hash/index.js create mode 100644 node_modules/object-hash/package.json create mode 100644 node_modules/object-hash/readme.markdown create mode 100644 node_modules/on-finished/HISTORY.md create mode 100644 node_modules/on-finished/LICENSE create mode 100644 node_modules/on-finished/README.md create mode 100644 node_modules/on-finished/index.js create mode 100644 node_modules/on-finished/package.json create mode 100644 node_modules/once/LICENSE create mode 100644 node_modules/once/README.md create mode 100644 node_modules/once/once.js create mode 100644 node_modules/once/package.json create mode 100644 node_modules/package-json-from-dist/LICENSE.md create mode 100644 node_modules/package-json-from-dist/README.md create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.d.ts create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.js create mode 100644 node_modules/package-json-from-dist/dist/commonjs/index.js.map create mode 100644 node_modules/package-json-from-dist/dist/commonjs/package.json create mode 100644 node_modules/package-json-from-dist/dist/esm/index.d.ts create mode 100644 node_modules/package-json-from-dist/dist/esm/index.d.ts.map create mode 100644 node_modules/package-json-from-dist/dist/esm/index.js create mode 100644 node_modules/package-json-from-dist/dist/esm/index.js.map create mode 100644 node_modules/package-json-from-dist/dist/esm/package.json create mode 100644 node_modules/package-json-from-dist/package.json create mode 100644 node_modules/parse-srcset/.jscs.json create mode 100644 node_modules/parse-srcset/.jshintrc create mode 100644 node_modules/parse-srcset/.npmignore create mode 100644 node_modules/parse-srcset/LICENSE create mode 100644 node_modules/parse-srcset/README.md create mode 100644 node_modules/parse-srcset/package.json create mode 100644 node_modules/parse-srcset/src/parse-srcset.js create mode 100755 node_modules/parse-srcset/tests/he.js create mode 100644 node_modules/parse-srcset/tests/intern.js create mode 100644 node_modules/parse-srcset/tests/unit/ps.js create mode 100644 node_modules/parseurl/HISTORY.md create mode 100644 node_modules/parseurl/LICENSE create mode 100644 node_modules/parseurl/README.md create mode 100644 node_modules/parseurl/index.js create mode 100644 node_modules/parseurl/package.json create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-key/index.d.ts create mode 100644 node_modules/path-key/index.js create mode 100644 node_modules/path-key/license create mode 100644 node_modules/path-key/package.json create mode 100644 node_modules/path-key/readme.md create mode 100644 node_modules/path-parse/LICENSE create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/path-scurry/LICENSE.md create mode 100644 node_modules/path-scurry/README.md create mode 100644 node_modules/path-scurry/dist/commonjs/index.d.ts create mode 100644 node_modules/path-scurry/dist/commonjs/index.d.ts.map create mode 100644 node_modules/path-scurry/dist/commonjs/index.js create mode 100644 node_modules/path-scurry/dist/commonjs/index.js.map create mode 100644 node_modules/path-scurry/dist/commonjs/package.json create mode 100644 node_modules/path-scurry/dist/esm/index.d.ts create mode 100644 node_modules/path-scurry/dist/esm/index.d.ts.map create mode 100644 node_modules/path-scurry/dist/esm/index.js create mode 100644 node_modules/path-scurry/dist/esm/index.js.map create mode 100644 node_modules/path-scurry/dist/esm/package.json create mode 100644 node_modules/path-scurry/package.json create mode 100644 node_modules/path-to-regexp/LICENSE create mode 100644 node_modules/path-to-regexp/Readme.md create mode 100644 node_modules/path-to-regexp/dist.es2015/index.js create mode 100644 node_modules/path-to-regexp/dist.es2015/index.js.map create mode 100644 node_modules/path-to-regexp/dist/index.d.ts create mode 100644 node_modules/path-to-regexp/dist/index.js create mode 100644 node_modules/path-to-regexp/dist/index.js.map create mode 100644 node_modules/path-to-regexp/package.json create mode 100644 node_modules/picocolors/LICENSE create mode 100644 node_modules/picocolors/README.md create mode 100644 node_modules/picocolors/package.json create mode 100644 node_modules/picocolors/picocolors.browser.js create mode 100644 node_modules/picocolors/picocolors.d.ts create mode 100644 node_modules/picocolors/picocolors.js create mode 100644 node_modules/picocolors/types.ts create mode 100644 node_modules/picomatch/CHANGELOG.md create mode 100644 node_modules/picomatch/LICENSE create mode 100644 node_modules/picomatch/README.md create mode 100644 node_modules/picomatch/index.js create mode 100644 node_modules/picomatch/lib/constants.js create mode 100644 node_modules/picomatch/lib/parse.js create mode 100644 node_modules/picomatch/lib/picomatch.js create mode 100644 node_modules/picomatch/lib/scan.js create mode 100644 node_modules/picomatch/lib/utils.js create mode 100644 node_modules/picomatch/package.json create mode 100644 node_modules/pify/index.js create mode 100644 node_modules/pify/license create mode 100644 node_modules/pify/package.json create mode 100644 node_modules/pify/readme.md create mode 100644 node_modules/pirates/LICENSE create mode 100644 node_modules/pirates/README.md create mode 100644 node_modules/pirates/index.d.ts create mode 100644 node_modules/pirates/lib/index.js create mode 100644 node_modules/pirates/package.json create mode 100644 node_modules/please-upgrade-node/.eslintrc.js create mode 100644 node_modules/please-upgrade-node/.github/FUNDING.yml create mode 100644 node_modules/please-upgrade-node/LICENSE create mode 100644 node_modules/please-upgrade-node/README.md create mode 100644 node_modules/please-upgrade-node/index.d.ts create mode 100644 node_modules/please-upgrade-node/index.js create mode 100644 node_modules/please-upgrade-node/package.json create mode 100755 node_modules/postcss-import/LICENSE create mode 100644 node_modules/postcss-import/README.md create mode 100755 node_modules/postcss-import/index.js create mode 100644 node_modules/postcss-import/lib/assign-layer-names.js create mode 100644 node_modules/postcss-import/lib/data-url.js create mode 100644 node_modules/postcss-import/lib/join-layer.js create mode 100644 node_modules/postcss-import/lib/join-media.js create mode 100644 node_modules/postcss-import/lib/load-content.js create mode 100644 node_modules/postcss-import/lib/parse-statements.js create mode 100644 node_modules/postcss-import/lib/process-content.js create mode 100644 node_modules/postcss-import/lib/resolve-id.js create mode 100644 node_modules/postcss-import/package.json create mode 100644 node_modules/postcss-js/LICENSE create mode 100644 node_modules/postcss-js/README.md create mode 100644 node_modules/postcss-js/async.js create mode 100644 node_modules/postcss-js/index.js create mode 100644 node_modules/postcss-js/index.mjs create mode 100644 node_modules/postcss-js/objectifier.js create mode 100644 node_modules/postcss-js/package.json create mode 100644 node_modules/postcss-js/parser.js create mode 100644 node_modules/postcss-js/process-result.js create mode 100644 node_modules/postcss-js/sync.js create mode 100644 node_modules/postcss-load-config/LICENSE create mode 100644 node_modules/postcss-load-config/README.md create mode 100644 node_modules/postcss-load-config/node_modules/lilconfig/LICENSE create mode 100644 node_modules/postcss-load-config/node_modules/lilconfig/package.json create mode 100644 node_modules/postcss-load-config/node_modules/lilconfig/readme.md create mode 100644 node_modules/postcss-load-config/node_modules/lilconfig/src/index.d.ts create mode 100644 node_modules/postcss-load-config/node_modules/lilconfig/src/index.js create mode 100644 node_modules/postcss-load-config/package.json create mode 100644 node_modules/postcss-load-config/src/index.d.ts create mode 100644 node_modules/postcss-load-config/src/index.js create mode 100644 node_modules/postcss-load-config/src/options.js create mode 100644 node_modules/postcss-load-config/src/plugins.js create mode 100644 node_modules/postcss-load-config/src/req.js create mode 100644 node_modules/postcss-nested/LICENSE create mode 100644 node_modules/postcss-nested/README.md create mode 100644 node_modules/postcss-nested/index.d.ts create mode 100644 node_modules/postcss-nested/index.js create mode 100644 node_modules/postcss-nested/package.json create mode 100644 node_modules/postcss-selector-parser/API.md create mode 100644 node_modules/postcss-selector-parser/CHANGELOG.md create mode 100644 node_modules/postcss-selector-parser/LICENSE-MIT create mode 100644 node_modules/postcss-selector-parser/README.md create mode 100644 node_modules/postcss-selector-parser/dist/index.js create mode 100644 node_modules/postcss-selector-parser/dist/parser.js create mode 100644 node_modules/postcss-selector-parser/dist/processor.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/attribute.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/className.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/combinator.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/comment.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/constructors.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/container.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/guards.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/id.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/index.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/namespace.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/nesting.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/node.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/pseudo.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/root.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/selector.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/string.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/tag.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/types.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/universal.js create mode 100644 node_modules/postcss-selector-parser/dist/sortAscending.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenTypes.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenize.js create mode 100644 node_modules/postcss-selector-parser/dist/util/ensureObject.js create mode 100644 node_modules/postcss-selector-parser/dist/util/getProp.js create mode 100644 node_modules/postcss-selector-parser/dist/util/index.js create mode 100644 node_modules/postcss-selector-parser/dist/util/stripComments.js create mode 100644 node_modules/postcss-selector-parser/dist/util/unesc.js create mode 100644 node_modules/postcss-selector-parser/package.json create mode 100644 node_modules/postcss-selector-parser/postcss-selector-parser.d.ts create mode 100644 node_modules/postcss-value-parser/LICENSE create mode 100644 node_modules/postcss-value-parser/README.md create mode 100644 node_modules/postcss-value-parser/lib/index.d.ts create mode 100644 node_modules/postcss-value-parser/lib/index.js create mode 100644 node_modules/postcss-value-parser/lib/parse.js create mode 100644 node_modules/postcss-value-parser/lib/stringify.js create mode 100644 node_modules/postcss-value-parser/lib/unit.js create mode 100644 node_modules/postcss-value-parser/lib/walk.js create mode 100644 node_modules/postcss-value-parser/package.json create mode 100644 node_modules/postcss/LICENSE create mode 100644 node_modules/postcss/README.md create mode 100644 node_modules/postcss/lib/at-rule.d.ts create mode 100644 node_modules/postcss/lib/at-rule.js create mode 100644 node_modules/postcss/lib/comment.d.ts create mode 100644 node_modules/postcss/lib/comment.js create mode 100644 node_modules/postcss/lib/container.d.ts create mode 100644 node_modules/postcss/lib/container.js create mode 100644 node_modules/postcss/lib/css-syntax-error.d.ts create mode 100644 node_modules/postcss/lib/css-syntax-error.js create mode 100644 node_modules/postcss/lib/declaration.d.ts create mode 100644 node_modules/postcss/lib/declaration.js create mode 100644 node_modules/postcss/lib/document.d.ts create mode 100644 node_modules/postcss/lib/document.js create mode 100644 node_modules/postcss/lib/fromJSON.d.ts create mode 100644 node_modules/postcss/lib/fromJSON.js create mode 100644 node_modules/postcss/lib/input.d.ts create mode 100644 node_modules/postcss/lib/input.js create mode 100644 node_modules/postcss/lib/lazy-result.d.ts create mode 100644 node_modules/postcss/lib/lazy-result.js create mode 100644 node_modules/postcss/lib/list.d.ts create mode 100644 node_modules/postcss/lib/list.js create mode 100644 node_modules/postcss/lib/map-generator.js create mode 100644 node_modules/postcss/lib/no-work-result.d.ts create mode 100644 node_modules/postcss/lib/no-work-result.js create mode 100644 node_modules/postcss/lib/node.d.ts create mode 100644 node_modules/postcss/lib/node.js create mode 100644 node_modules/postcss/lib/parse.d.ts create mode 100644 node_modules/postcss/lib/parse.js create mode 100644 node_modules/postcss/lib/parser.js create mode 100644 node_modules/postcss/lib/postcss.d.mts create mode 100644 node_modules/postcss/lib/postcss.d.ts create mode 100644 node_modules/postcss/lib/postcss.js create mode 100644 node_modules/postcss/lib/postcss.mjs create mode 100644 node_modules/postcss/lib/previous-map.d.ts create mode 100644 node_modules/postcss/lib/previous-map.js create mode 100644 node_modules/postcss/lib/processor.d.ts create mode 100644 node_modules/postcss/lib/processor.js create mode 100644 node_modules/postcss/lib/result.d.ts create mode 100644 node_modules/postcss/lib/result.js create mode 100644 node_modules/postcss/lib/root.d.ts create mode 100644 node_modules/postcss/lib/root.js create mode 100644 node_modules/postcss/lib/rule.d.ts create mode 100644 node_modules/postcss/lib/rule.js create mode 100644 node_modules/postcss/lib/stringifier.d.ts create mode 100644 node_modules/postcss/lib/stringifier.js create mode 100644 node_modules/postcss/lib/stringify.d.ts create mode 100644 node_modules/postcss/lib/stringify.js create mode 100644 node_modules/postcss/lib/symbols.js create mode 100644 node_modules/postcss/lib/terminal-highlight.js create mode 100644 node_modules/postcss/lib/tokenize.js create mode 100644 node_modules/postcss/lib/warn-once.js create mode 100644 node_modules/postcss/lib/warning.d.ts create mode 100644 node_modules/postcss/lib/warning.js create mode 100755 node_modules/postcss/package.json create mode 100644 node_modules/posthtml-parser/dist/chunk.2UQLUWPH.js create mode 100644 node_modules/posthtml-parser/dist/index.d.ts create mode 100644 node_modules/posthtml-parser/dist/index.js create mode 100644 node_modules/posthtml-parser/dist/location-tracker.d.ts create mode 100644 node_modules/posthtml-parser/dist/location-tracker.js create mode 100644 node_modules/posthtml-parser/license create mode 100644 node_modules/posthtml-parser/package.json create mode 100644 node_modules/posthtml-parser/readme.md create mode 100644 node_modules/posthtml-render/changelog.md create mode 100644 node_modules/posthtml-render/dist/index.d.ts create mode 100644 node_modules/posthtml-render/dist/index.js create mode 100644 node_modules/posthtml-render/license create mode 100644 node_modules/posthtml-render/package.json create mode 100644 node_modules/posthtml-render/readme.md create mode 100644 node_modules/posthtml-urls/LICENSE create mode 100644 node_modules/posthtml-urls/README.md create mode 100644 node_modules/posthtml-urls/lib/defaultOptions.js create mode 100644 node_modules/posthtml-urls/lib/index.js create mode 100644 node_modules/posthtml-urls/package.json create mode 100644 node_modules/posthtml/lib/api.js create mode 100644 node_modules/posthtml/lib/index.js create mode 100644 node_modules/posthtml/license create mode 100644 node_modules/posthtml/package.json create mode 100644 node_modules/posthtml/readme.md create mode 100644 node_modules/posthtml/types/posthtml.d.ts create mode 100644 node_modules/promise-each/LICENSE create mode 100644 node_modules/promise-each/README.md create mode 100644 node_modules/promise-each/index.js create mode 100644 node_modules/promise-each/node_modules/any-promise/.jshintrc create mode 100644 node_modules/promise-each/node_modules/any-promise/.npmignore create mode 100644 node_modules/promise-each/node_modules/any-promise/LICENSE create mode 100644 node_modules/promise-each/node_modules/any-promise/README.md create mode 100644 node_modules/promise-each/node_modules/any-promise/any-promise-shim.js create mode 100644 node_modules/promise-each/node_modules/any-promise/any-promise.js create mode 100644 node_modules/promise-each/node_modules/any-promise/package.json create mode 100644 node_modules/promise-each/package.json create mode 100644 node_modules/promise/.jshintrc create mode 100644 node_modules/promise/.npmignore create mode 100644 node_modules/promise/LICENSE create mode 100644 node_modules/promise/Readme.md create mode 100644 node_modules/promise/build.js create mode 100644 node_modules/promise/core.js create mode 100644 node_modules/promise/domains/core.js create mode 100644 node_modules/promise/domains/done.js create mode 100644 node_modules/promise/domains/es6-extensions.js create mode 100644 node_modules/promise/domains/finally.js create mode 100644 node_modules/promise/domains/index.js create mode 100644 node_modules/promise/domains/node-extensions.js create mode 100644 node_modules/promise/domains/rejection-tracking.js create mode 100644 node_modules/promise/domains/synchronous.js create mode 100644 node_modules/promise/index.d.ts create mode 100644 node_modules/promise/index.js create mode 100644 node_modules/promise/lib/core.js create mode 100644 node_modules/promise/lib/done.js create mode 100644 node_modules/promise/lib/es6-extensions.js create mode 100644 node_modules/promise/lib/finally.js create mode 100644 node_modules/promise/lib/index.js create mode 100644 node_modules/promise/lib/node-extensions.js create mode 100644 node_modules/promise/lib/rejection-tracking.js create mode 100644 node_modules/promise/lib/synchronous.js create mode 100644 node_modules/promise/package.json create mode 100644 node_modules/promise/polyfill-done.js create mode 100644 node_modules/promise/polyfill.js create mode 100644 node_modules/promise/setimmediate/core.js create mode 100644 node_modules/promise/setimmediate/done.js create mode 100644 node_modules/promise/setimmediate/es6-extensions.js create mode 100644 node_modules/promise/setimmediate/finally.js create mode 100644 node_modules/promise/setimmediate/index.js create mode 100644 node_modules/promise/setimmediate/node-extensions.js create mode 100644 node_modules/promise/setimmediate/rejection-tracking.js create mode 100644 node_modules/promise/setimmediate/synchronous.js create mode 100644 node_modules/promise/src/core.js create mode 100644 node_modules/promise/src/done.js create mode 100644 node_modules/promise/src/es6-extensions.js create mode 100644 node_modules/promise/src/finally.js create mode 100644 node_modules/promise/src/index.js create mode 100644 node_modules/promise/src/node-extensions.js create mode 100644 node_modules/promise/src/rejection-tracking.js create mode 100644 node_modules/promise/src/synchronous.js create mode 100644 node_modules/prr/.jshintrc create mode 100644 node_modules/prr/.npmignore create mode 100644 node_modules/prr/.travis.yml create mode 100644 node_modules/prr/LICENSE.md create mode 100644 node_modules/prr/README.md create mode 100644 node_modules/prr/package.json create mode 100644 node_modules/prr/prr.js create mode 100644 node_modules/prr/test.js create mode 100644 node_modules/pug-attrs/LICENSE create mode 100644 node_modules/pug-attrs/README.md create mode 100644 node_modules/pug-attrs/index.js create mode 100644 node_modules/pug-attrs/package.json create mode 100644 node_modules/pug-code-gen/HISTORY.md create mode 100644 node_modules/pug-code-gen/LICENSE create mode 100644 node_modules/pug-code-gen/README.md create mode 100644 node_modules/pug-code-gen/index.js create mode 100644 node_modules/pug-code-gen/package.json create mode 100644 node_modules/pug-error/LICENSE create mode 100644 node_modules/pug-error/README.md create mode 100644 node_modules/pug-error/lib/index.d.ts create mode 100644 node_modules/pug-error/lib/index.js create mode 100644 node_modules/pug-error/lib/index.js.map create mode 100644 node_modules/pug-error/lib/tsconfig.tsbuildinfo create mode 100644 node_modules/pug-error/package.json create mode 100644 node_modules/pug-filters/CHANGELOG.md create mode 100644 node_modules/pug-filters/LICENSE create mode 100644 node_modules/pug-filters/README.md create mode 100644 node_modules/pug-filters/index.js create mode 100644 node_modules/pug-filters/lib/handle-filters.js create mode 100644 node_modules/pug-filters/lib/run-filter.js create mode 100644 node_modules/pug-filters/package.json create mode 100644 node_modules/pug-lexer/History.md create mode 100644 node_modules/pug-lexer/LICENSE create mode 100644 node_modules/pug-lexer/README.md create mode 100644 node_modules/pug-lexer/index.d.ts create mode 100644 node_modules/pug-lexer/index.js create mode 100644 node_modules/pug-lexer/package.json create mode 100644 node_modules/pug-linker/HISTORY.md create mode 100644 node_modules/pug-linker/LICENSE create mode 100644 node_modules/pug-linker/README.md create mode 100644 node_modules/pug-linker/index.js create mode 100644 node_modules/pug-linker/package.json create mode 100644 node_modules/pug-load/HISTORY.md create mode 100644 node_modules/pug-load/LICENSE create mode 100644 node_modules/pug-load/README.md create mode 100644 node_modules/pug-load/index.js create mode 100644 node_modules/pug-load/package.json create mode 100644 node_modules/pug-parser/HISTORY.md create mode 100644 node_modules/pug-parser/LICENSE create mode 100644 node_modules/pug-parser/README.md create mode 100644 node_modules/pug-parser/index.js create mode 100644 node_modules/pug-parser/lib/inline-tags.js create mode 100644 node_modules/pug-parser/package.json create mode 100644 node_modules/pug-runtime/CHANGELOG.md create mode 100644 node_modules/pug-runtime/LICENSE create mode 100644 node_modules/pug-runtime/README.md create mode 100644 node_modules/pug-runtime/build.js create mode 100644 node_modules/pug-runtime/index.js create mode 100644 node_modules/pug-runtime/lib/dependencies.js create mode 100644 node_modules/pug-runtime/lib/internals.js create mode 100644 node_modules/pug-runtime/lib/sources.js create mode 100644 node_modules/pug-runtime/package.json create mode 100644 node_modules/pug-runtime/wrap.js create mode 100644 node_modules/pug-strip-comments/CHANGELOG.md create mode 100644 node_modules/pug-strip-comments/LICENSE.md create mode 100644 node_modules/pug-strip-comments/README.md create mode 100644 node_modules/pug-strip-comments/index.js create mode 100644 node_modules/pug-strip-comments/package.json create mode 100644 node_modules/pug-walk/HISTORY.md create mode 100644 node_modules/pug-walk/LICENSE create mode 100644 node_modules/pug-walk/README.md create mode 100644 node_modules/pug-walk/index.js create mode 100644 node_modules/pug-walk/package.json create mode 100644 node_modules/pug/History.md create mode 100644 node_modules/pug/LICENSE create mode 100644 node_modules/pug/README.md create mode 100644 node_modules/pug/lib/index.js create mode 100644 node_modules/pug/package.json create mode 100644 node_modules/pug/register.js create mode 100755 node_modules/queue-microtask/LICENSE create mode 100644 node_modules/queue-microtask/README.md create mode 100644 node_modules/queue-microtask/index.d.ts create mode 100644 node_modules/queue-microtask/index.js create mode 100644 node_modules/queue-microtask/package.json create mode 100644 node_modules/read-cache/LICENSE create mode 100644 node_modules/read-cache/README.md create mode 100644 node_modules/read-cache/index.js create mode 100644 node_modules/read-cache/package.json create mode 100644 node_modules/readdirp/LICENSE create mode 100644 node_modules/readdirp/README.md create mode 100644 node_modules/readdirp/index.d.ts create mode 100644 node_modules/readdirp/index.js create mode 100644 node_modules/readdirp/package.json create mode 100644 node_modules/recursive-copy/README.md create mode 100644 node_modules/recursive-copy/index.d.ts create mode 100644 node_modules/recursive-copy/index.js create mode 100644 node_modules/recursive-copy/lib/copy.js create mode 100644 node_modules/recursive-copy/package.json create mode 100644 node_modules/resolve/.editorconfig create mode 100644 node_modules/resolve/.eslintrc create mode 100644 node_modules/resolve/.github/FUNDING.yml create mode 100644 node_modules/resolve/LICENSE create mode 100644 node_modules/resolve/SECURITY.md create mode 100644 node_modules/resolve/async.js create mode 100755 node_modules/resolve/bin/resolve create mode 100644 node_modules/resolve/example/async.js create mode 100644 node_modules/resolve/example/sync.js create mode 100644 node_modules/resolve/index.js create mode 100644 node_modules/resolve/lib/async.js create mode 100644 node_modules/resolve/lib/caller.js create mode 100644 node_modules/resolve/lib/core.js create mode 100644 node_modules/resolve/lib/core.json create mode 100644 node_modules/resolve/lib/homedir.js create mode 100644 node_modules/resolve/lib/is-core.js create mode 100644 node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/resolve/lib/sync.js create mode 100644 node_modules/resolve/package.json create mode 100644 node_modules/resolve/readme.markdown create mode 100644 node_modules/resolve/sync.js create mode 100644 node_modules/resolve/test/core.js create mode 100644 node_modules/resolve/test/dotdot.js create mode 100644 node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/resolve/test/filter.js create mode 100644 node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/resolve/test/home_paths.js create mode 100644 node_modules/resolve/test/home_paths_sync.js create mode 100644 node_modules/resolve/test/mock.js create mode 100644 node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/resolve/test/module_dir.js create mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/resolve/test/node_path.js create mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/resolve/test/nonstring.js create mode 100644 node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/resolve/test/precedence.js create mode 100644 node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/resolve/test/resolver.js create mode 100644 node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/resolve/test/resolver/false_main/index.js create mode 100644 node_modules/resolve/test/resolver/false_main/package.json create mode 100644 node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/resolve/test/shadowed_core.js create mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 node_modules/resolve/test/subdirs.js create mode 100644 node_modules/resolve/test/symlinks.js create mode 100644 node_modules/reusify/.coveralls.yml create mode 100644 node_modules/reusify/.travis.yml create mode 100644 node_modules/reusify/LICENSE create mode 100644 node_modules/reusify/README.md create mode 100644 node_modules/reusify/benchmarks/createNoCodeFunction.js create mode 100644 node_modules/reusify/benchmarks/fib.js create mode 100644 node_modules/reusify/benchmarks/reuseNoCodeFunction.js create mode 100644 node_modules/reusify/package.json create mode 100644 node_modules/reusify/reusify.js create mode 100644 node_modules/reusify/test.js create mode 100644 node_modules/rimraf/LICENSE create mode 100644 node_modules/rimraf/README.md create mode 100755 node_modules/rimraf/bin.js create mode 100644 node_modules/rimraf/package.json create mode 100644 node_modules/rimraf/rimraf.js create mode 100644 node_modules/run-parallel/LICENSE create mode 100644 node_modules/run-parallel/README.md create mode 100644 node_modules/run-parallel/index.js create mode 100644 node_modules/run-parallel/package.json create mode 100644 node_modules/section-matter/LICENSE create mode 100644 node_modules/section-matter/README.md create mode 100644 node_modules/section-matter/index.js create mode 100644 node_modules/section-matter/package.json create mode 100644 node_modules/semver-compare/.travis.yml create mode 100644 node_modules/semver-compare/LICENSE create mode 100644 node_modules/semver-compare/example/cmp.js create mode 100644 node_modules/semver-compare/example/lex.js create mode 100644 node_modules/semver-compare/index.js create mode 100644 node_modules/semver-compare/package.json create mode 100644 node_modules/semver-compare/readme.markdown create mode 100644 node_modules/semver-compare/test/cmp.js create mode 100644 node_modules/semver/LICENSE create mode 100644 node_modules/semver/README.md create mode 100755 node_modules/semver/bin/semver.js create mode 100644 node_modules/semver/classes/comparator.js create mode 100644 node_modules/semver/classes/index.js create mode 100644 node_modules/semver/classes/range.js create mode 100644 node_modules/semver/classes/semver.js create mode 100644 node_modules/semver/functions/clean.js create mode 100644 node_modules/semver/functions/cmp.js create mode 100644 node_modules/semver/functions/coerce.js create mode 100644 node_modules/semver/functions/compare-build.js create mode 100644 node_modules/semver/functions/compare-loose.js create mode 100644 node_modules/semver/functions/compare.js create mode 100644 node_modules/semver/functions/diff.js create mode 100644 node_modules/semver/functions/eq.js create mode 100644 node_modules/semver/functions/gt.js create mode 100644 node_modules/semver/functions/gte.js create mode 100644 node_modules/semver/functions/inc.js create mode 100644 node_modules/semver/functions/lt.js create mode 100644 node_modules/semver/functions/lte.js create mode 100644 node_modules/semver/functions/major.js create mode 100644 node_modules/semver/functions/minor.js create mode 100644 node_modules/semver/functions/neq.js create mode 100644 node_modules/semver/functions/parse.js create mode 100644 node_modules/semver/functions/patch.js create mode 100644 node_modules/semver/functions/prerelease.js create mode 100644 node_modules/semver/functions/rcompare.js create mode 100644 node_modules/semver/functions/rsort.js create mode 100644 node_modules/semver/functions/satisfies.js create mode 100644 node_modules/semver/functions/sort.js create mode 100644 node_modules/semver/functions/valid.js create mode 100644 node_modules/semver/index.js create mode 100644 node_modules/semver/internal/constants.js create mode 100644 node_modules/semver/internal/debug.js create mode 100644 node_modules/semver/internal/identifiers.js create mode 100644 node_modules/semver/internal/lrucache.js create mode 100644 node_modules/semver/internal/parse-options.js create mode 100644 node_modules/semver/internal/re.js create mode 100644 node_modules/semver/package.json create mode 100644 node_modules/semver/preload.js create mode 100644 node_modules/semver/range.bnf create mode 100644 node_modules/semver/ranges/gtr.js create mode 100644 node_modules/semver/ranges/intersects.js create mode 100644 node_modules/semver/ranges/ltr.js create mode 100644 node_modules/semver/ranges/max-satisfying.js create mode 100644 node_modules/semver/ranges/min-satisfying.js create mode 100644 node_modules/semver/ranges/min-version.js create mode 100644 node_modules/semver/ranges/outside.js create mode 100644 node_modules/semver/ranges/simplify.js create mode 100644 node_modules/semver/ranges/subset.js create mode 100644 node_modules/semver/ranges/to-comparators.js create mode 100644 node_modules/semver/ranges/valid.js create mode 100644 node_modules/set-function-length/.eslintrc create mode 100644 node_modules/set-function-length/.github/FUNDING.yml create mode 100644 node_modules/set-function-length/.nycrc create mode 100644 node_modules/set-function-length/CHANGELOG.md create mode 100644 node_modules/set-function-length/LICENSE create mode 100644 node_modules/set-function-length/README.md create mode 100644 node_modules/set-function-length/env.d.ts create mode 100644 node_modules/set-function-length/env.js create mode 100644 node_modules/set-function-length/index.d.ts create mode 100644 node_modules/set-function-length/index.js create mode 100644 node_modules/set-function-length/package.json create mode 100644 node_modules/set-function-length/tsconfig.json create mode 100644 node_modules/shebang-command/index.js create mode 100644 node_modules/shebang-command/license create mode 100644 node_modules/shebang-command/package.json create mode 100644 node_modules/shebang-command/readme.md create mode 100644 node_modules/shebang-regex/index.d.ts create mode 100644 node_modules/shebang-regex/index.js create mode 100644 node_modules/shebang-regex/license create mode 100644 node_modules/shebang-regex/package.json create mode 100644 node_modules/shebang-regex/readme.md create mode 100644 node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/signal-exit/README.md create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/browser.js create mode 100644 node_modules/signal-exit/dist/cjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/index.js create mode 100644 node_modules/signal-exit/dist/cjs/index.js.map create mode 100644 node_modules/signal-exit/dist/cjs/package.json create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/signals.js create mode 100644 node_modules/signal-exit/dist/cjs/signals.js.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.js create mode 100644 node_modules/signal-exit/dist/mjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/index.js create mode 100644 node_modules/signal-exit/dist/mjs/index.js.map create mode 100644 node_modules/signal-exit/dist/mjs/package.json create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/signals.js create mode 100644 node_modules/signal-exit/dist/mjs/signals.js.map create mode 100644 node_modules/signal-exit/package.json create mode 100644 node_modules/slash/index.js create mode 100644 node_modules/slash/package.json create mode 100644 node_modules/slash/readme.md create mode 100644 node_modules/slugify/CHANGELOG.md create mode 100644 node_modules/slugify/LICENSE create mode 100644 node_modules/slugify/README.md create mode 100644 node_modules/slugify/package.json create mode 100644 node_modules/slugify/slugify.d.ts create mode 100644 node_modules/slugify/slugify.js create mode 100644 node_modules/source-map-js/LICENSE create mode 100644 node_modules/source-map-js/README.md create mode 100644 node_modules/source-map-js/lib/array-set.js create mode 100644 node_modules/source-map-js/lib/base64-vlq.js create mode 100644 node_modules/source-map-js/lib/base64.js create mode 100644 node_modules/source-map-js/lib/binary-search.js create mode 100644 node_modules/source-map-js/lib/mapping-list.js create mode 100644 node_modules/source-map-js/lib/quick-sort.js create mode 100644 node_modules/source-map-js/lib/source-map-consumer.js create mode 100644 node_modules/source-map-js/lib/source-map-generator.js create mode 100644 node_modules/source-map-js/lib/source-node.js create mode 100644 node_modules/source-map-js/lib/util.js create mode 100644 node_modules/source-map-js/package.json create mode 100644 node_modules/source-map-js/source-map.d.ts create mode 100644 node_modules/source-map-js/source-map.js create mode 100644 node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/source-map/LICENSE create mode 100644 node_modules/source-map/README.md create mode 100644 node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/source-map/dist/source-map.js create mode 100644 node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/source-map/lib/array-set.js create mode 100644 node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/source-map/lib/base64.js create mode 100644 node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/source-map/lib/source-node.js create mode 100644 node_modules/source-map/lib/util.js create mode 100644 node_modules/source-map/package.json create mode 100644 node_modules/source-map/source-map.d.ts create mode 100644 node_modules/source-map/source-map.js create mode 100644 node_modules/sprintf-js/.npmignore create mode 100644 node_modules/sprintf-js/LICENSE create mode 100644 node_modules/sprintf-js/README.md create mode 100644 node_modules/sprintf-js/bower.json create mode 100644 node_modules/sprintf-js/demo/angular.html create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js.map create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.map create mode 100644 node_modules/sprintf-js/dist/sprintf.min.js create mode 100644 node_modules/sprintf-js/dist/sprintf.min.js.map create mode 100644 node_modules/sprintf-js/dist/sprintf.min.map create mode 100644 node_modules/sprintf-js/gruntfile.js create mode 100644 node_modules/sprintf-js/package.json create mode 100644 node_modules/sprintf-js/src/angular-sprintf.js create mode 100644 node_modules/sprintf-js/src/sprintf.js create mode 100644 node_modules/sprintf-js/test/test.js create mode 100644 node_modules/ssri/CHANGELOG.md create mode 100644 node_modules/ssri/LICENSE.md create mode 100644 node_modules/ssri/README.md create mode 100644 node_modules/ssri/index.js create mode 100644 node_modules/ssri/node_modules/minipass/LICENSE create mode 100644 node_modules/ssri/node_modules/minipass/README.md create mode 100644 node_modules/ssri/node_modules/minipass/index.d.ts create mode 100644 node_modules/ssri/node_modules/minipass/index.js create mode 100644 node_modules/ssri/node_modules/minipass/package.json create mode 100644 node_modules/ssri/package.json create mode 100644 node_modules/statuses/HISTORY.md create mode 100644 node_modules/statuses/LICENSE create mode 100644 node_modules/statuses/README.md create mode 100644 node_modules/statuses/codes.json create mode 100644 node_modules/statuses/index.js create mode 100644 node_modules/statuses/package.json create mode 100644 node_modules/string-width-cjs/index.d.ts create mode 100644 node_modules/string-width-cjs/index.js create mode 100644 node_modules/string-width-cjs/license create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/index.js create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/license create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/package.json create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/readme.md create mode 100644 node_modules/string-width-cjs/package.json create mode 100644 node_modules/string-width-cjs/readme.md create mode 100644 node_modules/string-width/index.d.ts create mode 100644 node_modules/string-width/index.js create mode 100644 node_modules/string-width/license create mode 100644 node_modules/string-width/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/string-width/node_modules/emoji-regex/README.md create mode 100644 node_modules/string-width/node_modules/emoji-regex/RGI_Emoji.d.ts create mode 100644 node_modules/string-width/node_modules/emoji-regex/RGI_Emoji.js create mode 100644 node_modules/string-width/node_modules/emoji-regex/es2015/RGI_Emoji.d.ts create mode 100644 node_modules/string-width/node_modules/emoji-regex/es2015/RGI_Emoji.js create mode 100644 node_modules/string-width/node_modules/emoji-regex/es2015/index.d.ts create mode 100644 node_modules/string-width/node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/string-width/node_modules/emoji-regex/es2015/text.d.ts create mode 100644 node_modules/string-width/node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/string-width/node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/string-width/node_modules/emoji-regex/index.js create mode 100644 node_modules/string-width/node_modules/emoji-regex/package.json create mode 100644 node_modules/string-width/node_modules/emoji-regex/text.d.ts create mode 100644 node_modules/string-width/node_modules/emoji-regex/text.js create mode 100644 node_modules/string-width/package.json create mode 100644 node_modules/string-width/readme.md create mode 100644 node_modules/strip-ansi-cjs/index.d.ts create mode 100644 node_modules/strip-ansi-cjs/index.js create mode 100644 node_modules/strip-ansi-cjs/license create mode 100644 node_modules/strip-ansi-cjs/package.json create mode 100644 node_modules/strip-ansi-cjs/readme.md create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/index.js create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/license create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/package.json create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/readme.md create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-bom-string/LICENSE create mode 100644 node_modules/strip-bom-string/README.md create mode 100644 node_modules/strip-bom-string/index.js create mode 100644 node_modules/strip-bom-string/package.json create mode 100644 node_modules/sucrase/LICENSE create mode 100644 node_modules/sucrase/README.md create mode 100755 node_modules/sucrase/bin/sucrase create mode 100755 node_modules/sucrase/bin/sucrase-node create mode 100644 node_modules/sucrase/dist/CJSImportProcessor.js create mode 100644 node_modules/sucrase/dist/HelperManager.js create mode 100644 node_modules/sucrase/dist/NameManager.js create mode 100644 node_modules/sucrase/dist/Options-gen-types.js create mode 100644 node_modules/sucrase/dist/Options.js create mode 100644 node_modules/sucrase/dist/TokenProcessor.js create mode 100644 node_modules/sucrase/dist/cli.js create mode 100644 node_modules/sucrase/dist/computeSourceMap.js create mode 100644 node_modules/sucrase/dist/esm/CJSImportProcessor.js create mode 100644 node_modules/sucrase/dist/esm/HelperManager.js create mode 100644 node_modules/sucrase/dist/esm/NameManager.js create mode 100644 node_modules/sucrase/dist/esm/Options-gen-types.js create mode 100644 node_modules/sucrase/dist/esm/Options.js create mode 100644 node_modules/sucrase/dist/esm/TokenProcessor.js create mode 100644 node_modules/sucrase/dist/esm/cli.js create mode 100644 node_modules/sucrase/dist/esm/computeSourceMap.js create mode 100644 node_modules/sucrase/dist/esm/identifyShadowedGlobals.js create mode 100644 node_modules/sucrase/dist/esm/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/flow.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/types.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/typescript.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/state.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/types.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/base.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/expression.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/lval.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/statement.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/util.js create mode 100644 node_modules/sucrase/dist/esm/parser/util/charcodes.js create mode 100644 node_modules/sucrase/dist/esm/parser/util/identifier.js create mode 100644 node_modules/sucrase/dist/esm/parser/util/whitespace.js create mode 100644 node_modules/sucrase/dist/esm/register.js create mode 100644 node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/FlowTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/JSXTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/RootTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/Transformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js create mode 100644 node_modules/sucrase/dist/esm/util/elideImportEquals.js create mode 100644 node_modules/sucrase/dist/esm/util/formatTokens.js create mode 100644 node_modules/sucrase/dist/esm/util/getClassInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getDeclarationInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getIdentifierNames.js create mode 100644 node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js create mode 100644 node_modules/sucrase/dist/esm/util/getTSImportedNames.js create mode 100644 node_modules/sucrase/dist/esm/util/isAsyncOperation.js create mode 100644 node_modules/sucrase/dist/esm/util/isExportFrom.js create mode 100644 node_modules/sucrase/dist/esm/util/isIdentifier.js create mode 100644 node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js create mode 100644 node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js create mode 100644 node_modules/sucrase/dist/identifyShadowedGlobals.js create mode 100644 node_modules/sucrase/dist/index.js create mode 100644 node_modules/sucrase/dist/parser/index.js create mode 100644 node_modules/sucrase/dist/parser/plugins/flow.js create mode 100644 node_modules/sucrase/dist/parser/plugins/jsx/index.js create mode 100644 node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js create mode 100644 node_modules/sucrase/dist/parser/plugins/types.js create mode 100644 node_modules/sucrase/dist/parser/plugins/typescript.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/index.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/keywords.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/readWord.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/readWordTree.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/state.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/types.js create mode 100644 node_modules/sucrase/dist/parser/traverser/base.js create mode 100644 node_modules/sucrase/dist/parser/traverser/expression.js create mode 100644 node_modules/sucrase/dist/parser/traverser/index.js create mode 100644 node_modules/sucrase/dist/parser/traverser/lval.js create mode 100644 node_modules/sucrase/dist/parser/traverser/statement.js create mode 100644 node_modules/sucrase/dist/parser/traverser/util.js create mode 100644 node_modules/sucrase/dist/parser/util/charcodes.js create mode 100644 node_modules/sucrase/dist/parser/util/identifier.js create mode 100644 node_modules/sucrase/dist/parser/util/whitespace.js create mode 100644 node_modules/sucrase/dist/register.js create mode 100644 node_modules/sucrase/dist/transformers/CJSImportTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/ESMImportTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/FlowTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/JSXTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/JestHoistTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/RootTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/Transformer.js create mode 100644 node_modules/sucrase/dist/transformers/TypeScriptTransformer.js create mode 100644 node_modules/sucrase/dist/types/CJSImportProcessor.d.ts create mode 100644 node_modules/sucrase/dist/types/HelperManager.d.ts create mode 100644 node_modules/sucrase/dist/types/NameManager.d.ts create mode 100644 node_modules/sucrase/dist/types/Options-gen-types.d.ts create mode 100644 node_modules/sucrase/dist/types/Options.d.ts create mode 100644 node_modules/sucrase/dist/types/TokenProcessor.d.ts create mode 100644 node_modules/sucrase/dist/types/cli.d.ts create mode 100644 node_modules/sucrase/dist/types/computeSourceMap.d.ts create mode 100644 node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts create mode 100644 node_modules/sucrase/dist/types/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/flow.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/types.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/base.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/expression.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/lval.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/statement.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/util.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/util/charcodes.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/util/identifier.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/util/whitespace.d.ts create mode 100644 node_modules/sucrase/dist/types/register.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/Transformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/util/elideImportEquals.d.ts create mode 100644 node_modules/sucrase/dist/types/util/formatTokens.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getClassInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts create mode 100644 node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts create mode 100644 node_modules/sucrase/dist/types/util/isExportFrom.d.ts create mode 100644 node_modules/sucrase/dist/types/util/isIdentifier.d.ts create mode 100644 node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts create mode 100644 node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts create mode 100644 node_modules/sucrase/dist/util/elideImportEquals.js create mode 100644 node_modules/sucrase/dist/util/formatTokens.js create mode 100644 node_modules/sucrase/dist/util/getClassInfo.js create mode 100644 node_modules/sucrase/dist/util/getDeclarationInfo.js create mode 100644 node_modules/sucrase/dist/util/getIdentifierNames.js create mode 100644 node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js create mode 100644 node_modules/sucrase/dist/util/getJSXPragmaInfo.js create mode 100644 node_modules/sucrase/dist/util/getNonTypeIdentifiers.js create mode 100644 node_modules/sucrase/dist/util/getTSImportedNames.js create mode 100644 node_modules/sucrase/dist/util/isAsyncOperation.js create mode 100644 node_modules/sucrase/dist/util/isExportFrom.js create mode 100644 node_modules/sucrase/dist/util/isIdentifier.js create mode 100644 node_modules/sucrase/dist/util/removeMaybeImportAttributes.js create mode 100644 node_modules/sucrase/dist/util/shouldElideDefaultExport.js create mode 120000 node_modules/sucrase/node_modules/.bin/glob create mode 100644 node_modules/sucrase/node_modules/commander/CHANGELOG.md create mode 100644 node_modules/sucrase/node_modules/commander/LICENSE create mode 100644 node_modules/sucrase/node_modules/commander/Readme.md create mode 100644 node_modules/sucrase/node_modules/commander/index.js create mode 100644 node_modules/sucrase/node_modules/commander/package.json create mode 100644 node_modules/sucrase/node_modules/commander/typings/index.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/LICENSE create mode 100644 node_modules/sucrase/node_modules/glob/README.md create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/glob.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/glob.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/glob.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/glob.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/has-magic.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/has-magic.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/has-magic.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/has-magic.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/ignore.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/ignore.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/ignore.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/ignore.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/index.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/index.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/index.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/index.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/package.json create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/pattern.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/pattern.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/pattern.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/pattern.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/processor.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/processor.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/processor.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/processor.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/walker.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/walker.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/walker.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/commonjs/walker.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/bin.d.mts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/bin.d.mts.map create mode 100755 node_modules/sucrase/node_modules/glob/dist/esm/bin.mjs create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/bin.mjs.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/glob.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/glob.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/glob.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/glob.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/has-magic.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/has-magic.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/has-magic.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/has-magic.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/ignore.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/ignore.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/ignore.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/ignore.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/index.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/index.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/index.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/index.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/package.json create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/pattern.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/pattern.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/pattern.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/pattern.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/processor.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/processor.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/processor.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/processor.js.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/walker.d.ts create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/walker.d.ts.map create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/walker.js create mode 100644 node_modules/sucrase/node_modules/glob/dist/esm/walker.js.map create mode 100644 node_modules/sucrase/node_modules/glob/package.json create mode 100644 node_modules/sucrase/node_modules/minimatch/LICENSE create mode 100644 node_modules/sucrase/node_modules/minimatch/README.md create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/ast.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/ast.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/ast.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/ast.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/brace-expressions.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/brace-expressions.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/escape.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/escape.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/escape.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/escape.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/index.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/index.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/index.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/index.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/package.json create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/unescape.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/unescape.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/unescape.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/commonjs/unescape.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/assert-valid-pattern.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/ast.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/ast.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/ast.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/ast.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/brace-expressions.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/brace-expressions.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/brace-expressions.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/escape.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/escape.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/escape.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/escape.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/index.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/index.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/index.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/index.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/package.json create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/unescape.d.ts create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/unescape.d.ts.map create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/unescape.js create mode 100644 node_modules/sucrase/node_modules/minimatch/dist/esm/unescape.js.map create mode 100644 node_modules/sucrase/node_modules/minimatch/package.json create mode 100644 node_modules/sucrase/package.json create mode 100644 node_modules/sucrase/register/index.js create mode 100644 node_modules/sucrase/register/js.js create mode 100644 node_modules/sucrase/register/jsx.js create mode 100644 node_modules/sucrase/register/ts-legacy-module-interop.js create mode 100644 node_modules/sucrase/register/ts.js create mode 100644 node_modules/sucrase/register/tsx-legacy-module-interop.js create mode 100644 node_modules/sucrase/register/tsx.js create mode 100644 node_modules/sucrase/ts-node-plugin/index.js create mode 100644 node_modules/supports-color/browser.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/license create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/supports-preserve-symlinks-flag/.eslintrc create mode 100644 node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml create mode 100644 node_modules/supports-preserve-symlinks-flag/.nycrc create mode 100644 node_modules/supports-preserve-symlinks-flag/CHANGELOG.md create mode 100644 node_modules/supports-preserve-symlinks-flag/LICENSE create mode 100644 node_modules/supports-preserve-symlinks-flag/README.md create mode 100644 node_modules/supports-preserve-symlinks-flag/browser.js create mode 100644 node_modules/supports-preserve-symlinks-flag/index.js create mode 100644 node_modules/supports-preserve-symlinks-flag/package.json create mode 100644 node_modules/supports-preserve-symlinks-flag/test/index.js create mode 100644 node_modules/tailwindcss/CHANGELOG.md create mode 100644 node_modules/tailwindcss/LICENSE create mode 100644 node_modules/tailwindcss/README.md create mode 100644 node_modules/tailwindcss/base.css create mode 100644 node_modules/tailwindcss/colors.d.ts create mode 100644 node_modules/tailwindcss/colors.js create mode 100644 node_modules/tailwindcss/components.css create mode 100644 node_modules/tailwindcss/defaultConfig.d.ts create mode 100644 node_modules/tailwindcss/defaultConfig.js create mode 100644 node_modules/tailwindcss/defaultTheme.d.ts create mode 100644 node_modules/tailwindcss/defaultTheme.js create mode 100644 node_modules/tailwindcss/lib/cli-peer-dependencies.js create mode 100755 node_modules/tailwindcss/lib/cli.js create mode 100644 node_modules/tailwindcss/lib/cli/build/deps.js create mode 100644 node_modules/tailwindcss/lib/cli/build/index.js create mode 100644 node_modules/tailwindcss/lib/cli/build/plugin.js create mode 100644 node_modules/tailwindcss/lib/cli/build/utils.js create mode 100644 node_modules/tailwindcss/lib/cli/build/watching.js create mode 100644 node_modules/tailwindcss/lib/cli/help/index.js create mode 100644 node_modules/tailwindcss/lib/cli/index.js create mode 100644 node_modules/tailwindcss/lib/cli/init/index.js create mode 100644 node_modules/tailwindcss/lib/corePluginList.js create mode 100644 node_modules/tailwindcss/lib/corePlugins.js create mode 100644 node_modules/tailwindcss/lib/css/LICENSE create mode 100644 node_modules/tailwindcss/lib/css/preflight.css create mode 100644 node_modules/tailwindcss/lib/featureFlags.js create mode 100644 node_modules/tailwindcss/lib/index.js create mode 100644 node_modules/tailwindcss/lib/lib/cacheInvalidation.js create mode 100644 node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js create mode 100644 node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js create mode 100644 node_modules/tailwindcss/lib/lib/content.js create mode 100644 node_modules/tailwindcss/lib/lib/defaultExtractor.js create mode 100644 node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js create mode 100644 node_modules/tailwindcss/lib/lib/expandApplyAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/findAtConfigPath.js create mode 100644 node_modules/tailwindcss/lib/lib/generateRules.js create mode 100644 node_modules/tailwindcss/lib/lib/getModuleDependencies.js create mode 100644 node_modules/tailwindcss/lib/lib/load-config.js create mode 100644 node_modules/tailwindcss/lib/lib/normalizeTailwindDirectives.js create mode 100644 node_modules/tailwindcss/lib/lib/offsets.js create mode 100644 node_modules/tailwindcss/lib/lib/partitionApplyAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/regex.js create mode 100644 node_modules/tailwindcss/lib/lib/remap-bitfield.js create mode 100644 node_modules/tailwindcss/lib/lib/resolveDefaultsAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/setupContextUtils.js create mode 100644 node_modules/tailwindcss/lib/lib/setupTrackingContext.js create mode 100644 node_modules/tailwindcss/lib/lib/sharedState.js create mode 100644 node_modules/tailwindcss/lib/lib/substituteScreenAtRules.js create mode 100644 node_modules/tailwindcss/lib/plugin.js create mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/README.md create mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/index.js create mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/plugin.js create mode 100644 node_modules/tailwindcss/lib/processTailwindFeatures.js create mode 100644 node_modules/tailwindcss/lib/public/colors.js create mode 100644 node_modules/tailwindcss/lib/public/create-plugin.js create mode 100644 node_modules/tailwindcss/lib/public/default-config.js create mode 100644 node_modules/tailwindcss/lib/public/default-theme.js create mode 100644 node_modules/tailwindcss/lib/public/load-config.js create mode 100644 node_modules/tailwindcss/lib/public/resolve-config.js create mode 100644 node_modules/tailwindcss/lib/util/applyImportantSelector.js create mode 100644 node_modules/tailwindcss/lib/util/bigSign.js create mode 100644 node_modules/tailwindcss/lib/util/buildMediaQuery.js create mode 100644 node_modules/tailwindcss/lib/util/cloneDeep.js create mode 100644 node_modules/tailwindcss/lib/util/cloneNodes.js create mode 100644 node_modules/tailwindcss/lib/util/color.js create mode 100644 node_modules/tailwindcss/lib/util/colorNames.js create mode 100644 node_modules/tailwindcss/lib/util/configurePlugins.js create mode 100644 node_modules/tailwindcss/lib/util/createPlugin.js create mode 100644 node_modules/tailwindcss/lib/util/createUtilityPlugin.js create mode 100644 node_modules/tailwindcss/lib/util/dataTypes.js create mode 100644 node_modules/tailwindcss/lib/util/defaults.js create mode 100644 node_modules/tailwindcss/lib/util/escapeClassName.js create mode 100644 node_modules/tailwindcss/lib/util/escapeCommas.js create mode 100644 node_modules/tailwindcss/lib/util/flattenColorPalette.js create mode 100644 node_modules/tailwindcss/lib/util/formatVariantSelector.js create mode 100644 node_modules/tailwindcss/lib/util/getAllConfigs.js create mode 100644 node_modules/tailwindcss/lib/util/hashConfig.js create mode 100644 node_modules/tailwindcss/lib/util/isKeyframeRule.js create mode 100644 node_modules/tailwindcss/lib/util/isPlainObject.js create mode 100644 node_modules/tailwindcss/lib/util/isSyntacticallyValidPropertyValue.js create mode 100644 node_modules/tailwindcss/lib/util/log.js create mode 100644 node_modules/tailwindcss/lib/util/nameClass.js create mode 100644 node_modules/tailwindcss/lib/util/negateValue.js create mode 100644 node_modules/tailwindcss/lib/util/normalizeConfig.js create mode 100644 node_modules/tailwindcss/lib/util/normalizeScreens.js create mode 100644 node_modules/tailwindcss/lib/util/parseAnimationValue.js create mode 100644 node_modules/tailwindcss/lib/util/parseBoxShadowValue.js create mode 100644 node_modules/tailwindcss/lib/util/parseDependency.js create mode 100644 node_modules/tailwindcss/lib/util/parseGlob.js create mode 100644 node_modules/tailwindcss/lib/util/parseObjectStyles.js create mode 100644 node_modules/tailwindcss/lib/util/pluginUtils.js create mode 100644 node_modules/tailwindcss/lib/util/prefixSelector.js create mode 100644 node_modules/tailwindcss/lib/util/pseudoElements.js create mode 100644 node_modules/tailwindcss/lib/util/removeAlphaVariables.js create mode 100644 node_modules/tailwindcss/lib/util/resolveConfig.js create mode 100644 node_modules/tailwindcss/lib/util/resolveConfigPath.js create mode 100644 node_modules/tailwindcss/lib/util/responsive.js create mode 100644 node_modules/tailwindcss/lib/util/splitAtTopLevelOnly.js create mode 100644 node_modules/tailwindcss/lib/util/tap.js create mode 100644 node_modules/tailwindcss/lib/util/toColorValue.js create mode 100644 node_modules/tailwindcss/lib/util/toPath.js create mode 100644 node_modules/tailwindcss/lib/util/transformThemeValue.js create mode 100644 node_modules/tailwindcss/lib/util/validateConfig.js create mode 100644 node_modules/tailwindcss/lib/util/validateFormalSyntax.js create mode 100644 node_modules/tailwindcss/lib/util/withAlphaVariable.js create mode 100644 node_modules/tailwindcss/lib/value-parser/LICENSE create mode 100644 node_modules/tailwindcss/lib/value-parser/README.md create mode 100644 node_modules/tailwindcss/lib/value-parser/index.d.js create mode 100644 node_modules/tailwindcss/lib/value-parser/index.js create mode 100644 node_modules/tailwindcss/lib/value-parser/parse.js create mode 100644 node_modules/tailwindcss/lib/value-parser/stringify.js create mode 100644 node_modules/tailwindcss/lib/value-parser/unit.js create mode 100644 node_modules/tailwindcss/lib/value-parser/walk.js create mode 100644 node_modules/tailwindcss/loadConfig.d.ts create mode 100644 node_modules/tailwindcss/loadConfig.js create mode 100644 node_modules/tailwindcss/nesting/index.d.ts create mode 100644 node_modules/tailwindcss/nesting/index.js create mode 100644 node_modules/tailwindcss/node_modules/glob-parent/LICENSE create mode 100644 node_modules/tailwindcss/node_modules/glob-parent/README.md create mode 100644 node_modules/tailwindcss/node_modules/glob-parent/index.js create mode 100644 node_modules/tailwindcss/node_modules/glob-parent/package.json create mode 100644 node_modules/tailwindcss/package.json create mode 100644 node_modules/tailwindcss/peers/index.js create mode 100644 node_modules/tailwindcss/plugin.d.ts create mode 100644 node_modules/tailwindcss/plugin.js create mode 100644 node_modules/tailwindcss/prettier.config.js create mode 100644 node_modules/tailwindcss/resolveConfig.d.ts create mode 100644 node_modules/tailwindcss/resolveConfig.js create mode 100644 node_modules/tailwindcss/screens.css create mode 100644 node_modules/tailwindcss/scripts/create-plugin-list.js create mode 100644 node_modules/tailwindcss/scripts/generate-types.js create mode 100644 node_modules/tailwindcss/scripts/release-channel.js create mode 100644 node_modules/tailwindcss/scripts/release-notes.js create mode 100644 node_modules/tailwindcss/scripts/type-utils.js create mode 100644 node_modules/tailwindcss/src/cli-peer-dependencies.js create mode 100644 node_modules/tailwindcss/src/cli.js create mode 100644 node_modules/tailwindcss/src/cli/build/deps.js create mode 100644 node_modules/tailwindcss/src/cli/build/index.js create mode 100644 node_modules/tailwindcss/src/cli/build/plugin.js create mode 100644 node_modules/tailwindcss/src/cli/build/utils.js create mode 100644 node_modules/tailwindcss/src/cli/build/watching.js create mode 100644 node_modules/tailwindcss/src/cli/help/index.js create mode 100644 node_modules/tailwindcss/src/cli/index.js create mode 100644 node_modules/tailwindcss/src/cli/init/index.js create mode 100644 node_modules/tailwindcss/src/corePluginList.js create mode 100644 node_modules/tailwindcss/src/corePlugins.js create mode 100644 node_modules/tailwindcss/src/css/LICENSE create mode 100644 node_modules/tailwindcss/src/css/preflight.css create mode 100644 node_modules/tailwindcss/src/featureFlags.js create mode 100644 node_modules/tailwindcss/src/index.js create mode 100644 node_modules/tailwindcss/src/lib/cacheInvalidation.js create mode 100644 node_modules/tailwindcss/src/lib/collapseAdjacentRules.js create mode 100644 node_modules/tailwindcss/src/lib/collapseDuplicateDeclarations.js create mode 100644 node_modules/tailwindcss/src/lib/content.js create mode 100644 node_modules/tailwindcss/src/lib/defaultExtractor.js create mode 100644 node_modules/tailwindcss/src/lib/evaluateTailwindFunctions.js create mode 100644 node_modules/tailwindcss/src/lib/expandApplyAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/expandTailwindAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/findAtConfigPath.js create mode 100644 node_modules/tailwindcss/src/lib/generateRules.js create mode 100644 node_modules/tailwindcss/src/lib/getModuleDependencies.js create mode 100644 node_modules/tailwindcss/src/lib/load-config.ts create mode 100644 node_modules/tailwindcss/src/lib/normalizeTailwindDirectives.js create mode 100644 node_modules/tailwindcss/src/lib/offsets.js create mode 100644 node_modules/tailwindcss/src/lib/partitionApplyAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/regex.js create mode 100644 node_modules/tailwindcss/src/lib/remap-bitfield.js create mode 100644 node_modules/tailwindcss/src/lib/resolveDefaultsAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/setupContextUtils.js create mode 100644 node_modules/tailwindcss/src/lib/setupTrackingContext.js create mode 100644 node_modules/tailwindcss/src/lib/sharedState.js create mode 100644 node_modules/tailwindcss/src/lib/substituteScreenAtRules.js create mode 100644 node_modules/tailwindcss/src/plugin.js create mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/README.md create mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/index.js create mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/plugin.js create mode 100644 node_modules/tailwindcss/src/processTailwindFeatures.js create mode 100644 node_modules/tailwindcss/src/public/colors.js create mode 100644 node_modules/tailwindcss/src/public/create-plugin.js create mode 100644 node_modules/tailwindcss/src/public/default-config.js create mode 100644 node_modules/tailwindcss/src/public/default-theme.js create mode 100644 node_modules/tailwindcss/src/public/load-config.js create mode 100644 node_modules/tailwindcss/src/public/resolve-config.js create mode 100644 node_modules/tailwindcss/src/util/applyImportantSelector.js create mode 100644 node_modules/tailwindcss/src/util/bigSign.js create mode 100644 node_modules/tailwindcss/src/util/buildMediaQuery.js create mode 100644 node_modules/tailwindcss/src/util/cloneDeep.js create mode 100644 node_modules/tailwindcss/src/util/cloneNodes.js create mode 100644 node_modules/tailwindcss/src/util/color.js create mode 100644 node_modules/tailwindcss/src/util/colorNames.js create mode 100644 node_modules/tailwindcss/src/util/configurePlugins.js create mode 100644 node_modules/tailwindcss/src/util/createPlugin.js create mode 100644 node_modules/tailwindcss/src/util/createUtilityPlugin.js create mode 100644 node_modules/tailwindcss/src/util/dataTypes.js create mode 100644 node_modules/tailwindcss/src/util/defaults.js create mode 100644 node_modules/tailwindcss/src/util/escapeClassName.js create mode 100644 node_modules/tailwindcss/src/util/escapeCommas.js create mode 100644 node_modules/tailwindcss/src/util/flattenColorPalette.js create mode 100644 node_modules/tailwindcss/src/util/formatVariantSelector.js create mode 100644 node_modules/tailwindcss/src/util/getAllConfigs.js create mode 100644 node_modules/tailwindcss/src/util/hashConfig.js create mode 100644 node_modules/tailwindcss/src/util/isKeyframeRule.js create mode 100644 node_modules/tailwindcss/src/util/isPlainObject.js create mode 100644 node_modules/tailwindcss/src/util/isSyntacticallyValidPropertyValue.js create mode 100644 node_modules/tailwindcss/src/util/log.js create mode 100644 node_modules/tailwindcss/src/util/nameClass.js create mode 100644 node_modules/tailwindcss/src/util/negateValue.js create mode 100644 node_modules/tailwindcss/src/util/normalizeConfig.js create mode 100644 node_modules/tailwindcss/src/util/normalizeScreens.js create mode 100644 node_modules/tailwindcss/src/util/parseAnimationValue.js create mode 100644 node_modules/tailwindcss/src/util/parseBoxShadowValue.js create mode 100644 node_modules/tailwindcss/src/util/parseDependency.js create mode 100644 node_modules/tailwindcss/src/util/parseGlob.js create mode 100644 node_modules/tailwindcss/src/util/parseObjectStyles.js create mode 100644 node_modules/tailwindcss/src/util/pluginUtils.js create mode 100644 node_modules/tailwindcss/src/util/prefixSelector.js create mode 100644 node_modules/tailwindcss/src/util/pseudoElements.js create mode 100644 node_modules/tailwindcss/src/util/removeAlphaVariables.js create mode 100644 node_modules/tailwindcss/src/util/resolveConfig.js create mode 100644 node_modules/tailwindcss/src/util/resolveConfigPath.js create mode 100644 node_modules/tailwindcss/src/util/responsive.js create mode 100644 node_modules/tailwindcss/src/util/splitAtTopLevelOnly.js create mode 100644 node_modules/tailwindcss/src/util/tap.js create mode 100644 node_modules/tailwindcss/src/util/toColorValue.js create mode 100644 node_modules/tailwindcss/src/util/toPath.js create mode 100644 node_modules/tailwindcss/src/util/transformThemeValue.js create mode 100644 node_modules/tailwindcss/src/util/validateConfig.js create mode 100644 node_modules/tailwindcss/src/util/validateFormalSyntax.js create mode 100644 node_modules/tailwindcss/src/util/withAlphaVariable.js create mode 100644 node_modules/tailwindcss/src/value-parser/LICENSE create mode 100644 node_modules/tailwindcss/src/value-parser/README.md create mode 100644 node_modules/tailwindcss/src/value-parser/index.d.ts create mode 100644 node_modules/tailwindcss/src/value-parser/index.js create mode 100644 node_modules/tailwindcss/src/value-parser/parse.js create mode 100644 node_modules/tailwindcss/src/value-parser/stringify.js create mode 100644 node_modules/tailwindcss/src/value-parser/unit.js create mode 100644 node_modules/tailwindcss/src/value-parser/walk.js create mode 100644 node_modules/tailwindcss/stubs/.gitignore create mode 100644 node_modules/tailwindcss/stubs/.prettierrc.json create mode 100644 node_modules/tailwindcss/stubs/config.full.js create mode 100644 node_modules/tailwindcss/stubs/config.simple.js create mode 100644 node_modules/tailwindcss/stubs/postcss.config.cjs create mode 100644 node_modules/tailwindcss/stubs/postcss.config.js create mode 100644 node_modules/tailwindcss/stubs/tailwind.config.cjs create mode 100644 node_modules/tailwindcss/stubs/tailwind.config.js create mode 100644 node_modules/tailwindcss/stubs/tailwind.config.ts create mode 100644 node_modules/tailwindcss/tailwind.css create mode 100644 node_modules/tailwindcss/types/config.d.ts create mode 100644 node_modules/tailwindcss/types/generated/.gitkeep create mode 100644 node_modules/tailwindcss/types/generated/colors.d.ts create mode 100644 node_modules/tailwindcss/types/generated/corePluginList.d.ts create mode 100644 node_modules/tailwindcss/types/generated/default-theme.d.ts create mode 100644 node_modules/tailwindcss/types/index.d.ts create mode 100644 node_modules/tailwindcss/utilities.css create mode 100644 node_modules/tailwindcss/variants.css create mode 100644 node_modules/thenify-all/History.md create mode 100644 node_modules/thenify-all/LICENSE create mode 100644 node_modules/thenify-all/README.md create mode 100644 node_modules/thenify-all/index.js create mode 100644 node_modules/thenify-all/package.json create mode 100644 node_modules/thenify/History.md create mode 100644 node_modules/thenify/LICENSE create mode 100644 node_modules/thenify/README.md create mode 100644 node_modules/thenify/index.js create mode 100644 node_modules/thenify/package.json create mode 100644 node_modules/to-fast-properties/index.js create mode 100644 node_modules/to-fast-properties/license create mode 100644 node_modules/to-fast-properties/package.json create mode 100644 node_modules/to-fast-properties/readme.md create mode 100644 node_modules/to-regex-range/LICENSE create mode 100644 node_modules/to-regex-range/README.md create mode 100644 node_modules/to-regex-range/index.js create mode 100644 node_modules/to-regex-range/package.json create mode 100644 node_modules/token-stream/.npmignore create mode 100644 node_modules/token-stream/.travis.yml create mode 100644 node_modules/token-stream/HISTORY.md create mode 100644 node_modules/token-stream/LICENSE create mode 100644 node_modules/token-stream/README.md create mode 100644 node_modules/token-stream/index.js create mode 100644 node_modules/token-stream/package.json create mode 100644 node_modules/token-stream/test/index.js create mode 100644 node_modules/ts-interface-checker/LICENSE create mode 100644 node_modules/ts-interface-checker/README.md create mode 100644 node_modules/ts-interface-checker/dist/index.d.ts create mode 100644 node_modules/ts-interface-checker/dist/index.js create mode 100644 node_modules/ts-interface-checker/dist/types.d.ts create mode 100644 node_modules/ts-interface-checker/dist/types.js create mode 100644 node_modules/ts-interface-checker/dist/util.d.ts create mode 100644 node_modules/ts-interface-checker/dist/util.js create mode 100644 node_modules/ts-interface-checker/package.json create mode 100644 node_modules/uc.micro/CHANGELOG.md create mode 100644 node_modules/uc.micro/LICENSE.txt create mode 100644 node_modules/uc.micro/README.md create mode 100644 node_modules/uc.micro/categories/Cc/regex.js create mode 100644 node_modules/uc.micro/categories/Cf/regex.js create mode 100644 node_modules/uc.micro/categories/P/regex.js create mode 100644 node_modules/uc.micro/categories/Z/regex.js create mode 100644 node_modules/uc.micro/index.js create mode 100644 node_modules/uc.micro/package.json create mode 100644 node_modules/uc.micro/properties/Any/regex.js create mode 100644 node_modules/uglify-js/LICENSE create mode 100644 node_modules/uglify-js/README.md create mode 100755 node_modules/uglify-js/bin/uglifyjs create mode 100644 node_modules/uglify-js/lib/ast.js create mode 100644 node_modules/uglify-js/lib/compress.js create mode 100644 node_modules/uglify-js/lib/minify.js create mode 100644 node_modules/uglify-js/lib/mozilla-ast.js create mode 100644 node_modules/uglify-js/lib/output.js create mode 100644 node_modules/uglify-js/lib/parse.js create mode 100644 node_modules/uglify-js/lib/propmangle.js create mode 100644 node_modules/uglify-js/lib/scope.js create mode 100644 node_modules/uglify-js/lib/sourcemap.js create mode 100644 node_modules/uglify-js/lib/transform.js create mode 100644 node_modules/uglify-js/lib/utils.js create mode 100644 node_modules/uglify-js/package.json create mode 100644 node_modules/uglify-js/tools/domprops.html create mode 100644 node_modules/uglify-js/tools/domprops.json create mode 100644 node_modules/uglify-js/tools/exports.js create mode 100644 node_modules/uglify-js/tools/node.js create mode 100644 node_modules/uglify-js/tools/tty.js create mode 100644 node_modules/undici-types/README.md create mode 100644 node_modules/undici-types/agent.d.ts create mode 100644 node_modules/undici-types/api.d.ts create mode 100644 node_modules/undici-types/balanced-pool.d.ts create mode 100644 node_modules/undici-types/cache.d.ts create mode 100644 node_modules/undici-types/client.d.ts create mode 100644 node_modules/undici-types/connector.d.ts create mode 100644 node_modules/undici-types/content-type.d.ts create mode 100644 node_modules/undici-types/cookies.d.ts create mode 100644 node_modules/undici-types/diagnostics-channel.d.ts create mode 100644 node_modules/undici-types/dispatcher.d.ts create mode 100644 node_modules/undici-types/errors.d.ts create mode 100644 node_modules/undici-types/fetch.d.ts create mode 100644 node_modules/undici-types/file.d.ts create mode 100644 node_modules/undici-types/filereader.d.ts create mode 100644 node_modules/undici-types/formdata.d.ts create mode 100644 node_modules/undici-types/global-dispatcher.d.ts create mode 100644 node_modules/undici-types/global-origin.d.ts create mode 100644 node_modules/undici-types/handlers.d.ts create mode 100644 node_modules/undici-types/header.d.ts create mode 100644 node_modules/undici-types/index.d.ts create mode 100644 node_modules/undici-types/interceptors.d.ts create mode 100644 node_modules/undici-types/mock-agent.d.ts create mode 100644 node_modules/undici-types/mock-client.d.ts create mode 100644 node_modules/undici-types/mock-errors.d.ts create mode 100644 node_modules/undici-types/mock-interceptor.d.ts create mode 100644 node_modules/undici-types/mock-pool.d.ts create mode 100644 node_modules/undici-types/package.json create mode 100644 node_modules/undici-types/patch.d.ts create mode 100644 node_modules/undici-types/pool-stats.d.ts create mode 100644 node_modules/undici-types/pool.d.ts create mode 100644 node_modules/undici-types/proxy-agent.d.ts create mode 100644 node_modules/undici-types/readable.d.ts create mode 100644 node_modules/undici-types/webidl.d.ts create mode 100644 node_modules/undici-types/websocket.d.ts create mode 100644 node_modules/unpipe/HISTORY.md create mode 100644 node_modules/unpipe/LICENSE create mode 100644 node_modules/unpipe/README.md create mode 100644 node_modules/unpipe/index.js create mode 100644 node_modules/unpipe/package.json create mode 100644 node_modules/util-deprecate/History.md create mode 100644 node_modules/util-deprecate/LICENSE create mode 100644 node_modules/util-deprecate/README.md create mode 100644 node_modules/util-deprecate/browser.js create mode 100644 node_modules/util-deprecate/node.js create mode 100644 node_modules/util-deprecate/package.json create mode 100644 node_modules/void-elements/LICENSE create mode 100644 node_modules/void-elements/README.md create mode 100644 node_modules/void-elements/index.js create mode 100644 node_modules/void-elements/package.json create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100755 node_modules/which/bin/node-which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/with/.babelrc create mode 100644 node_modules/with/.github/workflows/rollingversions-canary.yml create mode 100644 node_modules/with/.github/workflows/rollingversions.yml create mode 100644 node_modules/with/.github/workflows/test.yml create mode 100644 node_modules/with/LICENSE create mode 100644 node_modules/with/README.md create mode 100644 node_modules/with/lib/globals.d.ts create mode 100644 node_modules/with/lib/globals.js create mode 100644 node_modules/with/lib/globals.js.map create mode 100644 node_modules/with/lib/index.d.ts create mode 100644 node_modules/with/lib/index.js create mode 100644 node_modules/with/lib/index.js.map create mode 100644 node_modules/with/lib/reference.d.ts create mode 100644 node_modules/with/lib/reference.js create mode 100644 node_modules/with/lib/reference.js.map create mode 100644 node_modules/with/package.json create mode 100644 node_modules/with/prettier.config.js create mode 100644 node_modules/with/src/globals.ts create mode 100644 node_modules/with/src/index.ts create mode 100644 node_modules/with/src/reference.ts create mode 100644 node_modules/with/tsconfig.json create mode 100644 node_modules/with/tslint.json create mode 100644 node_modules/wordwrap/LICENSE create mode 100644 node_modules/wordwrap/README.markdown create mode 100644 node_modules/wordwrap/example/center.js create mode 100644 node_modules/wordwrap/example/meat.js create mode 100644 node_modules/wordwrap/index.js create mode 100644 node_modules/wordwrap/package.json create mode 100644 node_modules/wordwrap/test/break.js create mode 100644 node_modules/wordwrap/test/idleness.txt create mode 100644 node_modules/wordwrap/test/wrap.js create mode 100755 node_modules/wrap-ansi-cjs/index.js create mode 100644 node_modules/wrap-ansi-cjs/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/package.json create mode 100644 node_modules/wrap-ansi-cjs/node_modules/string-width/readme.md create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/readme.md create mode 100644 node_modules/wrap-ansi-cjs/package.json create mode 100644 node_modules/wrap-ansi-cjs/readme.md create mode 100644 node_modules/wrap-ansi/index.d.ts create mode 100755 node_modules/wrap-ansi/index.js create mode 100644 node_modules/wrap-ansi/license create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/index.js create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/license create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/package.json create mode 100644 node_modules/wrap-ansi/node_modules/ansi-styles/readme.md create mode 100644 node_modules/wrap-ansi/package.json create mode 100644 node_modules/wrap-ansi/readme.md create mode 100644 node_modules/wrappy/LICENSE create mode 100644 node_modules/wrappy/README.md create mode 100644 node_modules/wrappy/package.json create mode 100644 node_modules/wrappy/wrappy.js create mode 100644 node_modules/ws/LICENSE create mode 100644 node_modules/ws/README.md create mode 100644 node_modules/ws/browser.js create mode 100644 node_modules/ws/index.js create mode 100644 node_modules/ws/lib/buffer-util.js create mode 100644 node_modules/ws/lib/constants.js create mode 100644 node_modules/ws/lib/event-target.js create mode 100644 node_modules/ws/lib/extension.js create mode 100644 node_modules/ws/lib/limiter.js create mode 100644 node_modules/ws/lib/permessage-deflate.js create mode 100644 node_modules/ws/lib/receiver.js create mode 100644 node_modules/ws/lib/sender.js create mode 100644 node_modules/ws/lib/stream.js create mode 100644 node_modules/ws/lib/subprotocol.js create mode 100644 node_modules/ws/lib/validation.js create mode 100644 node_modules/ws/lib/websocket-server.js create mode 100644 node_modules/ws/lib/websocket.js create mode 100644 node_modules/ws/package.json create mode 100644 node_modules/ws/wrapper.mjs create mode 100644 node_modules/yallist/LICENSE create mode 100644 node_modules/yallist/README.md create mode 100644 node_modules/yallist/iterator.js create mode 100644 node_modules/yallist/package.json create mode 100644 node_modules/yallist/yallist.js create mode 100644 node_modules/yaml/LICENSE create mode 100644 node_modules/yaml/README.md create mode 100755 node_modules/yaml/bin.mjs create mode 100644 node_modules/yaml/browser/dist/compose/compose-collection.js create mode 100644 node_modules/yaml/browser/dist/compose/compose-doc.js create mode 100644 node_modules/yaml/browser/dist/compose/compose-node.js create mode 100644 node_modules/yaml/browser/dist/compose/compose-scalar.js create mode 100644 node_modules/yaml/browser/dist/compose/composer.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-block-map.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-block-scalar.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-block-seq.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-end.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-flow-collection.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-props.js create mode 100644 node_modules/yaml/browser/dist/compose/util-contains-newline.js create mode 100644 node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js create mode 100644 node_modules/yaml/browser/dist/compose/util-flow-indent-check.js create mode 100644 node_modules/yaml/browser/dist/compose/util-map-includes.js create mode 100644 node_modules/yaml/browser/dist/doc/Document.js create mode 100644 node_modules/yaml/browser/dist/doc/anchors.js create mode 100644 node_modules/yaml/browser/dist/doc/applyReviver.js create mode 100644 node_modules/yaml/browser/dist/doc/createNode.js create mode 100644 node_modules/yaml/browser/dist/doc/directives.js create mode 100644 node_modules/yaml/browser/dist/errors.js create mode 100644 node_modules/yaml/browser/dist/index.js create mode 100644 node_modules/yaml/browser/dist/log.js create mode 100644 node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js create mode 100644 node_modules/yaml/browser/dist/nodes/Alias.js create mode 100644 node_modules/yaml/browser/dist/nodes/Collection.js create mode 100644 node_modules/yaml/browser/dist/nodes/Node.js create mode 100644 node_modules/yaml/browser/dist/nodes/Pair.js create mode 100644 node_modules/yaml/browser/dist/nodes/Scalar.js create mode 100644 node_modules/yaml/browser/dist/nodes/YAMLMap.js create mode 100644 node_modules/yaml/browser/dist/nodes/YAMLSeq.js create mode 100644 node_modules/yaml/browser/dist/nodes/addPairToJSMap.js create mode 100644 node_modules/yaml/browser/dist/nodes/identity.js create mode 100644 node_modules/yaml/browser/dist/nodes/toJS.js create mode 100644 node_modules/yaml/browser/dist/parse/cst-scalar.js create mode 100644 node_modules/yaml/browser/dist/parse/cst-stringify.js create mode 100644 node_modules/yaml/browser/dist/parse/cst-visit.js create mode 100644 node_modules/yaml/browser/dist/parse/cst.js create mode 100644 node_modules/yaml/browser/dist/parse/lexer.js create mode 100644 node_modules/yaml/browser/dist/parse/line-counter.js create mode 100644 node_modules/yaml/browser/dist/parse/parser.js create mode 100644 node_modules/yaml/browser/dist/public-api.js create mode 100644 node_modules/yaml/browser/dist/schema/Schema.js create mode 100644 node_modules/yaml/browser/dist/schema/common/map.js create mode 100644 node_modules/yaml/browser/dist/schema/common/null.js create mode 100644 node_modules/yaml/browser/dist/schema/common/seq.js create mode 100644 node_modules/yaml/browser/dist/schema/common/string.js create mode 100644 node_modules/yaml/browser/dist/schema/core/bool.js create mode 100644 node_modules/yaml/browser/dist/schema/core/float.js create mode 100644 node_modules/yaml/browser/dist/schema/core/int.js create mode 100644 node_modules/yaml/browser/dist/schema/core/schema.js create mode 100644 node_modules/yaml/browser/dist/schema/json/schema.js create mode 100644 node_modules/yaml/browser/dist/schema/tags.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/float.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/int.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/set.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js create mode 100644 node_modules/yaml/browser/dist/stringify/foldFlowLines.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringify.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyCollection.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyComment.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyDocument.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyNumber.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyPair.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyString.js create mode 100644 node_modules/yaml/browser/dist/util.js create mode 100644 node_modules/yaml/browser/dist/visit.js create mode 100644 node_modules/yaml/browser/index.js create mode 100644 node_modules/yaml/browser/package.json create mode 100644 node_modules/yaml/dist/cli.d.ts create mode 100644 node_modules/yaml/dist/cli.mjs create mode 100644 node_modules/yaml/dist/compose/compose-collection.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-collection.js create mode 100644 node_modules/yaml/dist/compose/compose-doc.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-doc.js create mode 100644 node_modules/yaml/dist/compose/compose-node.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-node.js create mode 100644 node_modules/yaml/dist/compose/compose-scalar.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-scalar.js create mode 100644 node_modules/yaml/dist/compose/composer.d.ts create mode 100644 node_modules/yaml/dist/compose/composer.js create mode 100644 node_modules/yaml/dist/compose/resolve-block-map.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-block-map.js create mode 100644 node_modules/yaml/dist/compose/resolve-block-scalar.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-block-scalar.js create mode 100644 node_modules/yaml/dist/compose/resolve-block-seq.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-block-seq.js create mode 100644 node_modules/yaml/dist/compose/resolve-end.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-end.js create mode 100644 node_modules/yaml/dist/compose/resolve-flow-collection.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-flow-collection.js create mode 100644 node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-flow-scalar.js create mode 100644 node_modules/yaml/dist/compose/resolve-props.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-props.js create mode 100644 node_modules/yaml/dist/compose/util-contains-newline.d.ts create mode 100644 node_modules/yaml/dist/compose/util-contains-newline.js create mode 100644 node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts create mode 100644 node_modules/yaml/dist/compose/util-empty-scalar-position.js create mode 100644 node_modules/yaml/dist/compose/util-flow-indent-check.d.ts create mode 100644 node_modules/yaml/dist/compose/util-flow-indent-check.js create mode 100644 node_modules/yaml/dist/compose/util-map-includes.d.ts create mode 100644 node_modules/yaml/dist/compose/util-map-includes.js create mode 100644 node_modules/yaml/dist/doc/Document.d.ts create mode 100644 node_modules/yaml/dist/doc/Document.js create mode 100644 node_modules/yaml/dist/doc/anchors.d.ts create mode 100644 node_modules/yaml/dist/doc/anchors.js create mode 100644 node_modules/yaml/dist/doc/applyReviver.d.ts create mode 100644 node_modules/yaml/dist/doc/applyReviver.js create mode 100644 node_modules/yaml/dist/doc/createNode.d.ts create mode 100644 node_modules/yaml/dist/doc/createNode.js create mode 100644 node_modules/yaml/dist/doc/directives.d.ts create mode 100644 node_modules/yaml/dist/doc/directives.js create mode 100644 node_modules/yaml/dist/errors.d.ts create mode 100644 node_modules/yaml/dist/errors.js create mode 100644 node_modules/yaml/dist/index.d.ts create mode 100644 node_modules/yaml/dist/index.js create mode 100644 node_modules/yaml/dist/log.d.ts create mode 100644 node_modules/yaml/dist/log.js create mode 100644 node_modules/yaml/dist/nodes/Alias.d.ts create mode 100644 node_modules/yaml/dist/nodes/Alias.js create mode 100644 node_modules/yaml/dist/nodes/Collection.d.ts create mode 100644 node_modules/yaml/dist/nodes/Collection.js create mode 100644 node_modules/yaml/dist/nodes/Node.d.ts create mode 100644 node_modules/yaml/dist/nodes/Node.js create mode 100644 node_modules/yaml/dist/nodes/Pair.d.ts create mode 100644 node_modules/yaml/dist/nodes/Pair.js create mode 100644 node_modules/yaml/dist/nodes/Scalar.d.ts create mode 100644 node_modules/yaml/dist/nodes/Scalar.js create mode 100644 node_modules/yaml/dist/nodes/YAMLMap.d.ts create mode 100644 node_modules/yaml/dist/nodes/YAMLMap.js create mode 100644 node_modules/yaml/dist/nodes/YAMLSeq.d.ts create mode 100644 node_modules/yaml/dist/nodes/YAMLSeq.js create mode 100644 node_modules/yaml/dist/nodes/addPairToJSMap.d.ts create mode 100644 node_modules/yaml/dist/nodes/addPairToJSMap.js create mode 100644 node_modules/yaml/dist/nodes/identity.d.ts create mode 100644 node_modules/yaml/dist/nodes/identity.js create mode 100644 node_modules/yaml/dist/nodes/toJS.d.ts create mode 100644 node_modules/yaml/dist/nodes/toJS.js create mode 100644 node_modules/yaml/dist/options.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-scalar.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-scalar.js create mode 100644 node_modules/yaml/dist/parse/cst-stringify.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-stringify.js create mode 100644 node_modules/yaml/dist/parse/cst-visit.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-visit.js create mode 100644 node_modules/yaml/dist/parse/cst.d.ts create mode 100644 node_modules/yaml/dist/parse/cst.js create mode 100644 node_modules/yaml/dist/parse/lexer.d.ts create mode 100644 node_modules/yaml/dist/parse/lexer.js create mode 100644 node_modules/yaml/dist/parse/line-counter.d.ts create mode 100644 node_modules/yaml/dist/parse/line-counter.js create mode 100644 node_modules/yaml/dist/parse/parser.d.ts create mode 100644 node_modules/yaml/dist/parse/parser.js create mode 100644 node_modules/yaml/dist/public-api.d.ts create mode 100644 node_modules/yaml/dist/public-api.js create mode 100644 node_modules/yaml/dist/schema/Schema.d.ts create mode 100644 node_modules/yaml/dist/schema/Schema.js create mode 100644 node_modules/yaml/dist/schema/common/map.d.ts create mode 100644 node_modules/yaml/dist/schema/common/map.js create mode 100644 node_modules/yaml/dist/schema/common/null.d.ts create mode 100644 node_modules/yaml/dist/schema/common/null.js create mode 100644 node_modules/yaml/dist/schema/common/seq.d.ts create mode 100644 node_modules/yaml/dist/schema/common/seq.js create mode 100644 node_modules/yaml/dist/schema/common/string.d.ts create mode 100644 node_modules/yaml/dist/schema/common/string.js create mode 100644 node_modules/yaml/dist/schema/core/bool.d.ts create mode 100644 node_modules/yaml/dist/schema/core/bool.js create mode 100644 node_modules/yaml/dist/schema/core/float.d.ts create mode 100644 node_modules/yaml/dist/schema/core/float.js create mode 100644 node_modules/yaml/dist/schema/core/int.d.ts create mode 100644 node_modules/yaml/dist/schema/core/int.js create mode 100644 node_modules/yaml/dist/schema/core/schema.d.ts create mode 100644 node_modules/yaml/dist/schema/core/schema.js create mode 100644 node_modules/yaml/dist/schema/json-schema.d.ts create mode 100644 node_modules/yaml/dist/schema/json/schema.d.ts create mode 100644 node_modules/yaml/dist/schema/json/schema.js create mode 100644 node_modules/yaml/dist/schema/tags.d.ts create mode 100644 node_modules/yaml/dist/schema/tags.js create mode 100644 node_modules/yaml/dist/schema/types.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/binary.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/bool.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/float.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/float.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/int.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/int.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/omap.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/pairs.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/schema.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/set.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/set.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/timestamp.js create mode 100644 node_modules/yaml/dist/stringify/foldFlowLines.d.ts create mode 100644 node_modules/yaml/dist/stringify/foldFlowLines.js create mode 100644 node_modules/yaml/dist/stringify/stringify.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringify.js create mode 100644 node_modules/yaml/dist/stringify/stringifyCollection.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyCollection.js create mode 100644 node_modules/yaml/dist/stringify/stringifyComment.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyComment.js create mode 100644 node_modules/yaml/dist/stringify/stringifyDocument.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyDocument.js create mode 100644 node_modules/yaml/dist/stringify/stringifyNumber.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyNumber.js create mode 100644 node_modules/yaml/dist/stringify/stringifyPair.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyPair.js create mode 100644 node_modules/yaml/dist/stringify/stringifyString.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyString.js create mode 100644 node_modules/yaml/dist/test-events.d.ts create mode 100644 node_modules/yaml/dist/test-events.js create mode 100644 node_modules/yaml/dist/util.d.ts create mode 100644 node_modules/yaml/dist/util.js create mode 100644 node_modules/yaml/dist/visit.d.ts create mode 100644 node_modules/yaml/dist/visit.js create mode 100644 node_modules/yaml/package.json create mode 100644 node_modules/yaml/util.js create mode 100644 src/index.html create mode 100644 src/style/base.css create mode 100644 tailwind.config.js diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/_site/README/index.html b/_site/README/index.html deleted file mode 100644 index 613890d..0000000 --- a/_site/README/index.html +++ /dev/null @@ -1 +0,0 @@ -

Heading

diff --git a/_site/index.html b/_site/index.html deleted file mode 100644 index 921c931..0000000 --- a/_site/index.html +++ /dev/null @@ -1,2 +0,0 @@ -abs3nt.dev -

hello i am abs3nt

diff --git a/eleventy.config.js b/eleventy.config.js new file mode 100644 index 0000000..1a9fe37 --- /dev/null +++ b/eleventy.config.js @@ -0,0 +1,8 @@ +module.exports = function (eleventyConfig) { + return { + dir: { + input: "src", + output: "dist", + }, + }; +}; diff --git a/index.html b/index.html deleted file mode 100644 index 921c931..0000000 --- a/index.html +++ /dev/null @@ -1,2 +0,0 @@ -abs3nt.dev -

hello i am abs3nt

diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 0000000..cf76760 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/cssesc b/node_modules/.bin/cssesc new file mode 120000 index 0000000..487b689 --- /dev/null +++ b/node_modules/.bin/cssesc @@ -0,0 +1 @@ +../cssesc/bin/cssesc \ No newline at end of file diff --git a/node_modules/.bin/dev-ip b/node_modules/.bin/dev-ip new file mode 120000 index 0000000..138e5ac --- /dev/null +++ b/node_modules/.bin/dev-ip @@ -0,0 +1 @@ +../dev-ip/lib/dev-ip.js \ No newline at end of file diff --git a/node_modules/.bin/ejs b/node_modules/.bin/ejs new file mode 120000 index 0000000..88e80d0 --- /dev/null +++ b/node_modules/.bin/ejs @@ -0,0 +1 @@ +../ejs/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/eleventy b/node_modules/.bin/eleventy new file mode 120000 index 0000000..489851a --- /dev/null +++ b/node_modules/.bin/eleventy @@ -0,0 +1 @@ +../@11ty/eleventy/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/eleventy-dev-server b/node_modules/.bin/eleventy-dev-server new file mode 120000 index 0000000..31a8419 --- /dev/null +++ b/node_modules/.bin/eleventy-dev-server @@ -0,0 +1 @@ +../@11ty/eleventy-dev-server/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/errno b/node_modules/.bin/errno new file mode 120000 index 0000000..5a98e53 --- /dev/null +++ b/node_modules/.bin/errno @@ -0,0 +1 @@ +../errno/cli.js \ No newline at end of file diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 120000 index 0000000..7423b18 --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 120000 index 0000000..16069ef --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/.bin/handlebars b/node_modules/.bin/handlebars new file mode 120000 index 0000000..fb7d090 --- /dev/null +++ b/node_modules/.bin/handlebars @@ -0,0 +1 @@ +../handlebars/bin/handlebars \ No newline at end of file diff --git a/node_modules/.bin/jake b/node_modules/.bin/jake new file mode 120000 index 0000000..3626745 --- /dev/null +++ b/node_modules/.bin/jake @@ -0,0 +1 @@ +../jake/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/jiti b/node_modules/.bin/jiti new file mode 120000 index 0000000..031ee3f --- /dev/null +++ b/node_modules/.bin/jiti @@ -0,0 +1 @@ +../jiti/bin/jiti.js \ No newline at end of file diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 120000 index 0000000..9dbd010 --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/.bin/liquid b/node_modules/.bin/liquid new file mode 120000 index 0000000..b06ee5f --- /dev/null +++ b/node_modules/.bin/liquid @@ -0,0 +1 @@ +../liquidjs/bin/liquid.js \ No newline at end of file diff --git a/node_modules/.bin/liquidjs b/node_modules/.bin/liquidjs new file mode 120000 index 0000000..b06ee5f --- /dev/null +++ b/node_modules/.bin/liquidjs @@ -0,0 +1 @@ +../liquidjs/bin/liquid.js \ No newline at end of file diff --git a/node_modules/.bin/markdown-it b/node_modules/.bin/markdown-it new file mode 120000 index 0000000..894bcdb --- /dev/null +++ b/node_modules/.bin/markdown-it @@ -0,0 +1 @@ +../markdown-it/bin/markdown-it.js \ No newline at end of file diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 120000 index 0000000..fbb7ee0 --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1 @@ +../mime/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 120000 index 0000000..017896c --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/mustache b/node_modules/.bin/mustache new file mode 120000 index 0000000..f8b7197 --- /dev/null +++ b/node_modules/.bin/mustache @@ -0,0 +1 @@ +../mustache/bin/mustache \ No newline at end of file diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid new file mode 120000 index 0000000..e2be547 --- /dev/null +++ b/node_modules/.bin/nanoid @@ -0,0 +1 @@ +../nanoid/bin/nanoid.cjs \ No newline at end of file diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which new file mode 120000 index 0000000..6f8415e --- /dev/null +++ b/node_modules/.bin/node-which @@ -0,0 +1 @@ +../which/bin/node-which \ No newline at end of file diff --git a/node_modules/.bin/nunjucks-precompile b/node_modules/.bin/nunjucks-precompile new file mode 120000 index 0000000..3465a52 --- /dev/null +++ b/node_modules/.bin/nunjucks-precompile @@ -0,0 +1 @@ +../nunjucks/bin/precompile \ No newline at end of file diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser new file mode 120000 index 0000000..ce7bf97 --- /dev/null +++ b/node_modules/.bin/parser @@ -0,0 +1 @@ +../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 120000 index 0000000..b6afda6 --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1 @@ +../resolve/bin/resolve \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 120000 index 0000000..4cd49a4 --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 0000000..5aaadf4 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/.bin/sucrase b/node_modules/.bin/sucrase new file mode 120000 index 0000000..0ac7e77 --- /dev/null +++ b/node_modules/.bin/sucrase @@ -0,0 +1 @@ +../sucrase/bin/sucrase \ No newline at end of file diff --git a/node_modules/.bin/sucrase-node b/node_modules/.bin/sucrase-node new file mode 120000 index 0000000..8b96fae --- /dev/null +++ b/node_modules/.bin/sucrase-node @@ -0,0 +1 @@ +../sucrase/bin/sucrase-node \ No newline at end of file diff --git a/node_modules/.bin/tailwind b/node_modules/.bin/tailwind new file mode 120000 index 0000000..d497797 --- /dev/null +++ b/node_modules/.bin/tailwind @@ -0,0 +1 @@ +../tailwindcss/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/tailwindcss b/node_modules/.bin/tailwindcss new file mode 120000 index 0000000..d497797 --- /dev/null +++ b/node_modules/.bin/tailwindcss @@ -0,0 +1 @@ +../tailwindcss/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/uglifyjs b/node_modules/.bin/uglifyjs new file mode 120000 index 0000000..fef3468 --- /dev/null +++ b/node_modules/.bin/uglifyjs @@ -0,0 +1 @@ +../uglify-js/bin/uglifyjs \ No newline at end of file diff --git a/node_modules/.bin/yaml b/node_modules/.bin/yaml new file mode 120000 index 0000000..0368324 --- /dev/null +++ b/node_modules/.bin/yaml @@ -0,0 +1 @@ +../yaml/bin.mjs \ No newline at end of file diff --git a/node_modules/.yarn-state.yml b/node_modules/.yarn-state.yml new file mode 100644 index 0000000..1a2395c --- /dev/null +++ b/node_modules/.yarn-state.yml @@ -0,0 +1,1169 @@ +# Warning: This file is automatically generated. Removing it is fine, but will +# cause your node_modules installation to become invalidated. + +__metadata: + version: 1 + nmMode: classic + +"@11ty/dependency-tree@npm:2.0.1": + locations: + - "node_modules/@11ty/dependency-tree" + +"@11ty/eleventy-dev-server@npm:1.0.4": + locations: + - "node_modules/@11ty/eleventy-dev-server" + +"@11ty/eleventy-utils@npm:1.0.3": + locations: + - "node_modules/@11ty/eleventy-utils" + +"@11ty/eleventy@npm:2.0.1": + locations: + - "node_modules/@11ty/eleventy" + +"@11ty/lodash-custom@npm:4.17.21": + locations: + - "node_modules/@11ty/lodash-custom" + +"@alloc/quick-lru@npm:5.2.0": + locations: + - "node_modules/@alloc/quick-lru" + +"@babel/helper-string-parser@npm:7.24.7": + locations: + - "node_modules/@babel/helper-string-parser" + +"@babel/helper-validator-identifier@npm:7.24.7": + locations: + - "node_modules/@babel/helper-validator-identifier" + +"@babel/parser@npm:7.24.7": + locations: + - "node_modules/@babel/parser" + +"@babel/types@npm:7.24.7": + locations: + - "node_modules/@babel/types" + +"@catppuccin/tailwindcss@virtual:22af014af304e4b12efa087d38ea14f51e7695e22ebf6420c62e665b6a54225a8eb6e5baf350ad2187bdb0669a01fe404a929437a0073c6bb8fe4c3706a2c55b#npm:0.1.6": + locations: + - "node_modules/@catppuccin/tailwindcss" + +"@iarna/toml@npm:2.2.5": + locations: + - "node_modules/@iarna/toml" + +"@isaacs/cliui@npm:8.0.2": + locations: + - "node_modules/@isaacs/cliui" + +"@jridgewell/gen-mapping@npm:0.3.5": + locations: + - "node_modules/@jridgewell/gen-mapping" + +"@jridgewell/resolve-uri@npm:3.1.2": + locations: + - "node_modules/@jridgewell/resolve-uri" + +"@jridgewell/set-array@npm:1.2.1": + locations: + - "node_modules/@jridgewell/set-array" + +"@jridgewell/sourcemap-codec@npm:1.4.15": + locations: + - "node_modules/@jridgewell/sourcemap-codec" + +"@jridgewell/trace-mapping@npm:0.3.25": + locations: + - "node_modules/@jridgewell/trace-mapping" + +"@nodelib/fs.scandir@npm:2.1.5": + locations: + - "node_modules/@nodelib/fs.scandir" + +"@nodelib/fs.stat@npm:2.0.5": + locations: + - "node_modules/@nodelib/fs.stat" + +"@nodelib/fs.walk@npm:1.2.8": + locations: + - "node_modules/@nodelib/fs.walk" + +"@pkgjs/parseargs@npm:0.11.0": + locations: + - "node_modules/@pkgjs/parseargs" + +"@sindresorhus/slugify@npm:1.1.2": + locations: + - "node_modules/@sindresorhus/slugify" + +"@sindresorhus/transliterate@npm:0.1.2": + locations: + - "node_modules/@sindresorhus/transliterate" + +"@types/minimatch@npm:3.0.5": + locations: + - "node_modules/@types/minimatch" + +"@types/node@npm:20.14.10": + locations: + - "node_modules/@types/node" + +"a-sync-waterfall@npm:1.0.1": + locations: + - "node_modules/a-sync-waterfall" + +"acorn@npm:7.4.1": + locations: + - "node_modules/acorn" + +"ansi-regex@npm:5.0.1": + locations: + - "node_modules/ansi-regex" + +"ansi-regex@npm:6.0.1": + locations: + - "node_modules/strip-ansi/node_modules/ansi-regex" + +"ansi-styles@npm:4.3.0": + locations: + - "node_modules/ansi-styles" + +"ansi-styles@npm:6.2.1": + locations: + - "node_modules/wrap-ansi/node_modules/ansi-styles" + +"any-promise@npm:0.1.0": + locations: + - "node_modules/promise-each/node_modules/any-promise" + +"any-promise@npm:1.3.0": + locations: + - "node_modules/any-promise" + +"anymatch@npm:3.1.3": + locations: + - "node_modules/anymatch" + +"arg@npm:5.0.2": + locations: + - "node_modules/arg" + +"argparse@npm:1.0.10": + locations: + - "node_modules/argparse" + +"argparse@npm:2.0.1": + locations: + - "node_modules/markdown-it/node_modules/argparse" + +"array-differ@npm:1.0.0": + locations: + - "node_modules/maximatch/node_modules/array-differ" + +"array-differ@npm:3.0.0": + locations: + - "node_modules/array-differ" + +"array-union@npm:1.0.2": + locations: + - "node_modules/maximatch/node_modules/array-union" + +"array-union@npm:2.1.0": + locations: + - "node_modules/array-union" + +"array-uniq@npm:1.0.3": + locations: + - "node_modules/array-uniq" + +"arrify@npm:1.0.1": + locations: + - "node_modules/maximatch/node_modules/arrify" + +"arrify@npm:2.0.1": + locations: + - "node_modules/arrify" + +"asap@npm:2.0.6": + locations: + - "node_modules/asap" + +"assert-never@npm:1.3.0": + locations: + - "node_modules/assert-never" + +"async@npm:3.2.5": + locations: + - "node_modules/async" + +"babel-walk@npm:3.0.0-canary-5": + locations: + - "node_modules/babel-walk" + +"balanced-match@npm:1.0.2": + locations: + - "node_modules/balanced-match" + +"bcp-47-match@npm:1.0.3": + locations: + - "node_modules/bcp-47-match" + +"bcp-47-normalize@npm:1.1.1": + locations: + - "node_modules/bcp-47-normalize" + +"bcp-47@npm:1.0.8": + locations: + - "node_modules/bcp-47" + +"binary-extensions@npm:2.3.0": + locations: + - "node_modules/binary-extensions" + +"brace-expansion@npm:1.1.11": + locations: + - "node_modules/minimatch/node_modules/brace-expansion" + +"brace-expansion@npm:2.0.1": + locations: + - "node_modules/brace-expansion" + +"braces@npm:3.0.3": + locations: + - "node_modules/braces" + +"call-bind@npm:1.0.7": + locations: + - "node_modules/call-bind" + +"camelcase-css@npm:2.0.1": + locations: + - "node_modules/camelcase-css" + +"chalk@npm:4.1.2": + locations: + - "node_modules/chalk" + +"character-parser@npm:2.2.0": + locations: + - "node_modules/character-parser" + +"chokidar@npm:3.6.0": + locations: + - "node_modules/chokidar" + +"color-convert@npm:2.0.1": + locations: + - "node_modules/color-convert" + +"color-name@npm:1.1.4": + locations: + - "node_modules/color-name" + +"commander@npm:10.0.1": + locations: + - "node_modules/commander" + +"commander@npm:4.1.1": + locations: + - "node_modules/sucrase/node_modules/commander" + +"commander@npm:5.1.0": + locations: + - "node_modules/nunjucks/node_modules/commander" + +"concat-map@npm:0.0.1": + locations: + - "node_modules/concat-map" + +"constantinople@npm:4.0.1": + locations: + - "node_modules/constantinople" + +"cross-spawn@npm:7.0.3": + locations: + - "node_modules/cross-spawn" + +"cssesc@npm:3.0.0": + locations: + - "node_modules/cssesc" + +"debug@virtual:593d0014635aef7193149d484690d0265953f676955a1d3c5790630ae1dd35272b10aefbcf1736f8c2b196d3b37ffd0a972b97a0c7719d481592abaf319fe014#npm:2.6.9": + locations: + - "node_modules/finalhandler/node_modules/debug" + +"debug@virtual:c9e1a4b59e37cb479517edede3bf2093b28c0ca1a9d0e517f3c345075bd1e468980b94b4957e389116607ee7155441dfd7d09e19a4229d5d09bcf06244401590#npm:4.3.5": + locations: + - "node_modules/debug" + +"define-data-property@npm:1.1.4": + locations: + - "node_modules/define-data-property" + +"dependency-graph@npm:0.11.0": + locations: + - "node_modules/dependency-graph" + +"dev-ip@npm:1.0.1": + locations: + - "node_modules/dev-ip" + +"devsite@workspace:.": + locations: + - "" + bin: + "node_modules/sucrase": + "glob": "glob/dist/esm/bin.mjs" + ".": + "eleventy": "@11ty/eleventy/cmd.js" + "eleventy-dev-server": "@11ty/eleventy-dev-server/cmd.js" + "tailwind": "tailwindcss/lib/cli.js" + "tailwindcss": "tailwindcss/lib/cli.js" + "ejs": "ejs/bin/cli.js" + "handlebars": "handlebars/bin/handlebars" + "liquidjs": "liquidjs/bin/liquid.js" + "liquid": "liquidjs/bin/liquid.js" + "markdown-it": "markdown-it/bin/markdown-it.js" + "mustache": "mustache/bin/mustache" + "semver": "semver/bin/semver.js" + "nunjucks-precompile": "nunjucks/bin/precompile" + "jiti": "jiti/bin/jiti.js" + "resolve": "resolve/bin/resolve" + "sucrase": "sucrase/bin/sucrase" + "sucrase-node": "sucrase/bin/sucrase-node" + "dev-ip": "dev-ip/lib/dev-ip.js" + "mime": "mime/cli.js" + "node-which": "which/bin/node-which" + "jake": "jake/bin/cli.js" + "js-yaml": "js-yaml/bin/js-yaml.js" + "uglifyjs": "uglify-js/bin/uglifyjs" + "errno": "errno/cli.js" + "mkdirp": "mkdirp/bin/cmd.js" + "rimraf": "rimraf/bin.js" + "cssesc": "cssesc/bin/cssesc" + "nanoid": "nanoid/bin/nanoid.cjs" + "yaml": "yaml/bin.mjs" + "esparse": "esprima/bin/esparse.js" + "esvalidate": "esprima/bin/esvalidate.js" + "parser": "@babel/parser/bin/babel-parser.js" + "acorn": "acorn/bin/acorn" + +"didyoumean@npm:1.2.2": + locations: + - "node_modules/didyoumean" + +"dlv@npm:1.1.3": + locations: + - "node_modules/dlv" + +"doctypes@npm:1.1.0": + locations: + - "node_modules/doctypes" + +"dom-serializer@npm:1.4.1": + locations: + - "node_modules/dom-serializer" + +"domelementtype@npm:2.3.0": + locations: + - "node_modules/domelementtype" + +"domhandler@npm:4.3.1": + locations: + - "node_modules/domhandler" + +"domutils@npm:2.8.0": + locations: + - "node_modules/domutils" + +"eastasianwidth@npm:0.2.0": + locations: + - "node_modules/eastasianwidth" + +"ee-first@npm:1.1.1": + locations: + - "node_modules/ee-first" + +"ejs@npm:3.1.10": + locations: + - "node_modules/ejs" + +"emoji-regex@npm:8.0.0": + locations: + - "node_modules/emoji-regex" + +"emoji-regex@npm:9.2.2": + locations: + - "node_modules/string-width/node_modules/emoji-regex" + +"encodeurl@npm:1.0.2": + locations: + - "node_modules/encodeurl" + +"entities@npm:2.2.0": + locations: + - "node_modules/dom-serializer/node_modules/entities" + +"entities@npm:3.0.1": + locations: + - "node_modules/entities" + +"errno@npm:0.1.8": + locations: + - "node_modules/errno" + +"es-define-property@npm:1.0.0": + locations: + - "node_modules/es-define-property" + +"es-errors@npm:1.3.0": + locations: + - "node_modules/es-errors" + +"escape-html@npm:1.0.3": + locations: + - "node_modules/escape-html" + +"escape-string-regexp@npm:2.0.0": + locations: + - "node_modules/escape-string-regexp" + +"escape-string-regexp@npm:4.0.0": + locations: + - "node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp" + +"esprima@npm:4.0.1": + locations: + - "node_modules/esprima" + +"extend-shallow@npm:2.0.1": + locations: + - "node_modules/extend-shallow" + +"fast-glob@npm:3.3.2": + locations: + - "node_modules/fast-glob" + +"fastq@npm:1.17.1": + locations: + - "node_modules/fastq" + +"filelist@npm:1.0.4": + locations: + - "node_modules/filelist" + +"fill-range@npm:7.1.1": + locations: + - "node_modules/fill-range" + +"finalhandler@npm:1.2.0": + locations: + - "node_modules/finalhandler" + +"foreground-child@npm:3.2.1": + locations: + - "node_modules/foreground-child" + +"fs.realpath@npm:1.0.0": + locations: + - "node_modules/fs.realpath" + +"function-bind@npm:1.1.2": + locations: + - "node_modules/function-bind" + +"get-intrinsic@npm:1.2.4": + locations: + - "node_modules/get-intrinsic" + +"glob-parent@npm:5.1.2": + locations: + - "node_modules/glob-parent" + +"glob-parent@npm:6.0.2": + locations: + - "node_modules/tailwindcss/node_modules/glob-parent" + +"glob@npm:10.4.3": + locations: + - "node_modules/sucrase/node_modules/glob" + +"glob@npm:7.2.3": + locations: + - "node_modules/glob" + +"gopd@npm:1.0.1": + locations: + - "node_modules/gopd" + +"graceful-fs@npm:4.2.11": + locations: + - "node_modules/graceful-fs" + +"gray-matter@npm:4.0.3": + locations: + - "node_modules/gray-matter" + +"hamljs@npm:0.6.2": + locations: + - "node_modules/hamljs" + +"handlebars@npm:4.7.8": + locations: + - "node_modules/handlebars" + +"has-flag@npm:4.0.0": + locations: + - "node_modules/has-flag" + +"has-property-descriptors@npm:1.0.2": + locations: + - "node_modules/has-property-descriptors" + +"has-proto@npm:1.0.3": + locations: + - "node_modules/has-proto" + +"has-symbols@npm:1.0.3": + locations: + - "node_modules/has-symbols" + +"has-tostringtag@npm:1.0.2": + locations: + - "node_modules/has-tostringtag" + +"hasown@npm:2.0.2": + locations: + - "node_modules/hasown" + +"htmlparser2@npm:7.2.0": + locations: + - "node_modules/htmlparser2" + +"http-equiv-refresh@npm:1.0.0": + locations: + - "node_modules/http-equiv-refresh" + +"inflight@npm:1.0.6": + locations: + - "node_modules/inflight" + +"inherits@npm:2.0.4": + locations: + - "node_modules/inherits" + +"is-alphabetical@npm:1.0.4": + locations: + - "node_modules/is-alphabetical" + +"is-alphanumerical@npm:1.0.4": + locations: + - "node_modules/is-alphanumerical" + +"is-binary-path@npm:2.1.0": + locations: + - "node_modules/is-binary-path" + +"is-core-module@npm:2.14.0": + locations: + - "node_modules/is-core-module" + +"is-decimal@npm:1.0.4": + locations: + - "node_modules/is-decimal" + +"is-expression@npm:4.0.0": + locations: + - "node_modules/is-expression" + +"is-extendable@npm:0.1.1": + locations: + - "node_modules/is-extendable" + +"is-extglob@npm:2.1.1": + locations: + - "node_modules/is-extglob" + +"is-fullwidth-code-point@npm:3.0.0": + locations: + - "node_modules/is-fullwidth-code-point" + +"is-glob@npm:4.0.3": + locations: + - "node_modules/is-glob" + +"is-json@npm:2.0.1": + locations: + - "node_modules/is-json" + +"is-number@npm:7.0.0": + locations: + - "node_modules/is-number" + +"is-promise@npm:2.2.2": + locations: + - "node_modules/is-promise" + +"is-regex@npm:1.1.4": + locations: + - "node_modules/is-regex" + +"isexe@npm:2.0.0": + locations: + - "node_modules/isexe" + +"iso-639-1@npm:2.1.15": + locations: + - "node_modules/iso-639-1" + +"jackspeak@npm:3.4.1": + locations: + - "node_modules/jackspeak" + +"jake@npm:10.9.1": + locations: + - "node_modules/jake" + +"jiti@npm:1.21.6": + locations: + - "node_modules/jiti" + +"js-stringify@npm:1.0.2": + locations: + - "node_modules/js-stringify" + +"js-yaml@npm:3.14.1": + locations: + - "node_modules/js-yaml" + +"jstransformer@npm:1.0.0": + locations: + - "node_modules/jstransformer" + +"junk@npm:1.0.3": + locations: + - "node_modules/junk" + +"kind-of@npm:6.0.3": + locations: + - "node_modules/kind-of" + +"kleur@npm:4.1.5": + locations: + - "node_modules/kleur" + +"lilconfig@npm:2.1.0": + locations: + - "node_modules/lilconfig" + +"lilconfig@npm:3.1.2": + locations: + - "node_modules/postcss-load-config/node_modules/lilconfig" + +"lines-and-columns@npm:1.2.4": + locations: + - "node_modules/lines-and-columns" + +"linkify-it@npm:4.0.1": + locations: + - "node_modules/linkify-it" + +"liquidjs@npm:10.14.0": + locations: + - "node_modules/liquidjs" + +"list-to-array@npm:1.1.0": + locations: + - "node_modules/list-to-array" + +"lodash.deburr@npm:4.1.0": + locations: + - "node_modules/lodash.deburr" + +"lru-cache@npm:10.3.1": + locations: + - "node_modules/lru-cache" + +"luxon@npm:3.4.4": + locations: + - "node_modules/luxon" + +"markdown-it@npm:13.0.2": + locations: + - "node_modules/markdown-it" + +"maximatch@npm:0.1.0": + locations: + - "node_modules/maximatch" + +"mdurl@npm:1.0.1": + locations: + - "node_modules/mdurl" + +"merge2@npm:1.4.1": + locations: + - "node_modules/merge2" + +"micromatch@npm:4.0.7": + locations: + - "node_modules/micromatch" + +"mime@npm:3.0.0": + locations: + - "node_modules/mime" + +"minimatch@npm:3.1.2": + locations: + - "node_modules/minimatch" + +"minimatch@npm:5.1.6": + locations: + - "node_modules/filelist/node_modules/minimatch" + +"minimatch@npm:9.0.5": + locations: + - "node_modules/sucrase/node_modules/minimatch" + +"minimist@npm:1.2.8": + locations: + - "node_modules/minimist" + +"minipass@npm:3.3.6": + locations: + - "node_modules/ssri/node_modules/minipass" + +"minipass@npm:7.1.2": + locations: + - "node_modules/minipass" + +"mkdirp@npm:0.5.6": + locations: + - "node_modules/mkdirp" + +"moo@npm:0.5.2": + locations: + - "node_modules/moo" + +"morphdom@npm:2.7.3": + locations: + - "node_modules/morphdom" + +"ms@npm:2.0.0": + locations: + - "node_modules/ms" + +"ms@npm:2.1.2": + locations: + - "node_modules/debug/node_modules/ms" + +"multimatch@npm:5.0.0": + locations: + - "node_modules/multimatch" + +"mustache@npm:4.2.0": + locations: + - "node_modules/mustache" + +"mz@npm:2.7.0": + locations: + - "node_modules/mz" + +"nanoid@npm:3.3.7": + locations: + - "node_modules/nanoid" + +"neo-async@npm:2.6.2": + locations: + - "node_modules/neo-async" + +"normalize-path@npm:3.0.0": + locations: + - "node_modules/normalize-path" + +"nunjucks@virtual:38575667a0f0a7b5bac10ee52446370590206cb4d6c1b4fa87e1c8adbb936a22b8da7a49588d2a80d87db6e39d28a8013503deddc1eebdb780f19a2c81d349f2#npm:3.2.4": + locations: + - "node_modules/nunjucks" + +"object-assign@npm:4.1.1": + locations: + - "node_modules/object-assign" + +"object-hash@npm:3.0.0": + locations: + - "node_modules/object-hash" + +"on-finished@npm:2.4.1": + locations: + - "node_modules/on-finished" + +"once@npm:1.4.0": + locations: + - "node_modules/once" + +"package-json-from-dist@npm:1.0.0": + locations: + - "node_modules/package-json-from-dist" + +"parse-srcset@npm:1.0.2": + locations: + - "node_modules/parse-srcset" + +"parseurl@npm:1.3.3": + locations: + - "node_modules/parseurl" + +"path-is-absolute@npm:1.0.1": + locations: + - "node_modules/path-is-absolute" + +"path-key@npm:3.1.1": + locations: + - "node_modules/path-key" + +"path-parse@npm:1.0.7": + locations: + - "node_modules/path-parse" + +"path-scurry@npm:1.11.1": + locations: + - "node_modules/path-scurry" + +"path-to-regexp@npm:6.2.2": + locations: + - "node_modules/path-to-regexp" + +"picocolors@npm:1.0.1": + locations: + - "node_modules/picocolors" + +"picomatch@npm:2.3.1": + locations: + - "node_modules/picomatch" + +"pify@npm:2.3.0": + locations: + - "node_modules/pify" + +"pirates@npm:4.0.6": + locations: + - "node_modules/pirates" + +"please-upgrade-node@npm:3.2.0": + locations: + - "node_modules/please-upgrade-node" + +"postcss-import@virtual:18aba64742bc7799e5186578113f42e99b152f5068e2bf8163a16c70382d8aaa7d8e3400d1e3aea692635655480c295717f5c451e94f1023c573a584b3a9ffeb#npm:15.1.0": + locations: + - "node_modules/postcss-import" + +"postcss-js@virtual:18aba64742bc7799e5186578113f42e99b152f5068e2bf8163a16c70382d8aaa7d8e3400d1e3aea692635655480c295717f5c451e94f1023c573a584b3a9ffeb#npm:4.0.1": + locations: + - "node_modules/postcss-js" + +"postcss-load-config@virtual:18aba64742bc7799e5186578113f42e99b152f5068e2bf8163a16c70382d8aaa7d8e3400d1e3aea692635655480c295717f5c451e94f1023c573a584b3a9ffeb#npm:4.0.2": + locations: + - "node_modules/postcss-load-config" + +"postcss-nested@virtual:18aba64742bc7799e5186578113f42e99b152f5068e2bf8163a16c70382d8aaa7d8e3400d1e3aea692635655480c295717f5c451e94f1023c573a584b3a9ffeb#npm:6.0.1": + locations: + - "node_modules/postcss-nested" + +"postcss-selector-parser@npm:6.1.0": + locations: + - "node_modules/postcss-selector-parser" + +"postcss-value-parser@npm:4.2.0": + locations: + - "node_modules/postcss-value-parser" + +"postcss@npm:8.4.39": + locations: + - "node_modules/postcss" + +"posthtml-parser@npm:0.11.0": + locations: + - "node_modules/posthtml-parser" + +"posthtml-render@npm:3.0.0": + locations: + - "node_modules/posthtml-render" + +"posthtml-urls@npm:1.0.0": + locations: + - "node_modules/posthtml-urls" + +"posthtml@npm:0.16.6": + locations: + - "node_modules/posthtml" + +"promise-each@npm:2.2.0": + locations: + - "node_modules/promise-each" + +"promise@npm:7.3.1": + locations: + - "node_modules/promise" + +"prr@npm:1.0.1": + locations: + - "node_modules/prr" + +"pug-attrs@npm:3.0.0": + locations: + - "node_modules/pug-attrs" + +"pug-code-gen@npm:3.0.3": + locations: + - "node_modules/pug-code-gen" + +"pug-error@npm:2.1.0": + locations: + - "node_modules/pug-error" + +"pug-filters@npm:4.0.0": + locations: + - "node_modules/pug-filters" + +"pug-lexer@npm:5.0.1": + locations: + - "node_modules/pug-lexer" + +"pug-linker@npm:4.0.0": + locations: + - "node_modules/pug-linker" + +"pug-load@npm:3.0.0": + locations: + - "node_modules/pug-load" + +"pug-parser@npm:6.0.0": + locations: + - "node_modules/pug-parser" + +"pug-runtime@npm:3.0.1": + locations: + - "node_modules/pug-runtime" + +"pug-strip-comments@npm:2.0.0": + locations: + - "node_modules/pug-strip-comments" + +"pug-walk@npm:2.0.0": + locations: + - "node_modules/pug-walk" + +"pug@npm:3.0.3": + locations: + - "node_modules/pug" + +"queue-microtask@npm:1.2.3": + locations: + - "node_modules/queue-microtask" + +"read-cache@npm:1.0.0": + locations: + - "node_modules/read-cache" + +"readdirp@npm:3.6.0": + locations: + - "node_modules/readdirp" + +"recursive-copy@npm:2.0.14": + locations: + - "node_modules/recursive-copy" + +"resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d": + locations: + - "node_modules/resolve" + +"reusify@npm:1.0.4": + locations: + - "node_modules/reusify" + +"rimraf@npm:2.7.1": + locations: + - "node_modules/rimraf" + +"run-parallel@npm:1.2.0": + locations: + - "node_modules/run-parallel" + +"section-matter@npm:1.0.0": + locations: + - "node_modules/section-matter" + +"semver-compare@npm:1.0.0": + locations: + - "node_modules/semver-compare" + +"semver@npm:7.6.2": + locations: + - "node_modules/semver" + +"set-function-length@npm:1.2.2": + locations: + - "node_modules/set-function-length" + +"shebang-command@npm:2.0.0": + locations: + - "node_modules/shebang-command" + +"shebang-regex@npm:3.0.0": + locations: + - "node_modules/shebang-regex" + +"signal-exit@npm:4.1.0": + locations: + - "node_modules/signal-exit" + +"slash@npm:1.0.0": + locations: + - "node_modules/slash" + +"slugify@npm:1.6.6": + locations: + - "node_modules/slugify" + +"source-map-js@npm:1.2.0": + locations: + - "node_modules/source-map-js" + +"source-map@npm:0.6.1": + locations: + - "node_modules/source-map" + +"sprintf-js@npm:1.0.3": + locations: + - "node_modules/sprintf-js" + +"ssri@npm:8.0.1": + locations: + - "node_modules/ssri" + +"statuses@npm:2.0.1": + locations: + - "node_modules/statuses" + +"string-width@npm:4.2.3": + locations: + - "node_modules/wrap-ansi-cjs/node_modules/string-width" + - "node_modules/string-width-cjs" + +"string-width@npm:5.1.2": + locations: + - "node_modules/string-width" + +"strip-ansi@npm:6.0.1": + locations: + - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi" + - "node_modules/strip-ansi-cjs" + - "node_modules/string-width-cjs/node_modules/strip-ansi" + +"strip-ansi@npm:7.1.0": + locations: + - "node_modules/strip-ansi" + +"strip-bom-string@npm:1.0.0": + locations: + - "node_modules/strip-bom-string" + +"sucrase@npm:3.35.0": + locations: + - "node_modules/sucrase" + +"supports-color@npm:7.2.0": + locations: + - "node_modules/supports-color" + +"supports-preserve-symlinks-flag@npm:1.0.0": + locations: + - "node_modules/supports-preserve-symlinks-flag" + +"tailwindcss@npm:3.4.4": + locations: + - "node_modules/tailwindcss" + +"thenify-all@npm:1.6.0": + locations: + - "node_modules/thenify-all" + +"thenify@npm:3.3.1": + locations: + - "node_modules/thenify" + +"to-fast-properties@npm:2.0.0": + locations: + - "node_modules/to-fast-properties" + +"to-regex-range@npm:5.0.1": + locations: + - "node_modules/to-regex-range" + +"token-stream@npm:1.0.0": + locations: + - "node_modules/token-stream" + +"ts-interface-checker@npm:0.1.13": + locations: + - "node_modules/ts-interface-checker" + +"uc.micro@npm:1.0.6": + locations: + - "node_modules/uc.micro" + +"uglify-js@npm:3.18.0": + locations: + - "node_modules/uglify-js" + +"undici-types@npm:5.26.5": + locations: + - "node_modules/undici-types" + +"unpipe@npm:1.0.0": + locations: + - "node_modules/unpipe" + +"util-deprecate@npm:1.0.2": + locations: + - "node_modules/util-deprecate" + +"void-elements@npm:3.1.0": + locations: + - "node_modules/void-elements" + +"which@npm:2.0.2": + locations: + - "node_modules/which" + +"with@npm:7.0.2": + locations: + - "node_modules/with" + +"wordwrap@npm:1.0.0": + locations: + - "node_modules/wordwrap" + +"wrap-ansi@npm:7.0.0": + locations: + - "node_modules/wrap-ansi-cjs" + +"wrap-ansi@npm:8.1.0": + locations: + - "node_modules/wrap-ansi" + +"wrappy@npm:1.0.2": + locations: + - "node_modules/wrappy" + +"ws@virtual:35c7c2892d725266679f5535537b72095436bf58e40269ea2fd4e737cab6bba169c84ecd38a403932f3953289b9f6422aeac326691808b360ff3b62cd51b85f1#npm:8.18.0": + locations: + - "node_modules/ws" + +"yallist@npm:4.0.0": + locations: + - "node_modules/yallist" + +"yaml@npm:2.4.5": + locations: + - "node_modules/yaml" diff --git a/node_modules/@11ty/dependency-tree/LICENSE b/node_modules/@11ty/dependency-tree/LICENSE new file mode 100644 index 0000000..629c31b --- /dev/null +++ b/node_modules/@11ty/dependency-tree/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Eleventy + +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. diff --git a/node_modules/@11ty/dependency-tree/README.md b/node_modules/@11ty/dependency-tree/README.md new file mode 100644 index 0000000..b7fa19c --- /dev/null +++ b/node_modules/@11ty/dependency-tree/README.md @@ -0,0 +1,92 @@ +# dependency-tree + +Returns an unordered array of local paths to dependencies of a node JavaScript file (everything it or any of its dependencies `require`s). + +Reduced feature (faster) alternative to the [`dependency-tree` package](https://www.npmjs.com/package/dependency-tree) that only works with stock node JS. This is used by Eleventy to find dependencies of a JavaScript file to watch for changes to re-run Eleventy’s build. + +## Big Huge Caveat + +⚠ A big caveat to this plugin is that it will require the file in order to build a dependency tree. So if your module has side effects and you don’t want it to execute—do not use this! + +## Installation + +``` +npm install --save-dev @11ty/dependency-tree +``` + +## Features + +* Ignores `node_modules` +* Or, use `nodeModuleNamesOnly` to return a list of node_modules packages (added in v2.0.0) +* Ignores Node’s built-ins (e.g. `path`) +* Handles circular dependencies (Node does this too) + +## Usage + +```js +// my-file.js + +// if my-local-dependency.js has dependencies, it will include those too +const test = require("./my-local-dependency.js"); + +// ignored, is a built-in +const path = require("path"); +``` + +```js +const DependencyTree = require("@11ty/dependency-tree"); + +DependencyTree("./my-file.js"); +// returns ["./my-local-dependency.js"] +``` + +### `allowNotFound` + +```js +const DependencyTree = require("@11ty/dependency-tree"); + +DependencyTree("./this-does-not-exist.js"); // throws an error + +DependencyTree("./this-does-not-exist.js", { allowNotFound: true }); +// returns [] +``` + +### `nodeModuleNames` + +(Added in v2.0.1) Controls whether or not node package names are included in the list of dependencies. + +* `nodeModuleNames: "include"`: included alongside the local JS files. +* `nodeModuleNames: "exclude"` (default): node module package names are excluded. +* `nodeModuleNames: "only"`: only node module package names are returned. + +```js +// my-file.js: + +require("./my-local-dependency.js"); +require("@11ty/eleventy"); +``` + +```js +const DependencyTree = require("@11ty/dependency-tree"); + +DependencyTree("./my-file.js"); +// returns ["./my-local-dependency.js"] + +DependencyTree("./my-file.js", { nodeModuleNames: "exclude" }); +// returns ["./my-local-dependency.js"] + +DependencyTree("./my-file.js", { nodeModuleNames: "include" }); +// returns ["./my-local-dependency.js", "@11ty/eleventy"] + +DependencyTree("./my-file.js", { nodeModuleNames: "only" }); +// returns ["@11ty/eleventy"] +``` + +#### (Deprecated) `nodeModuleNamesOnly` + +(Added in v2.0.0) Changed to use `nodeModuleNames` option instead. Backwards compatibility is maintained automatically. + +* `nodeModuleNamesOnly: false` is mapped to `nodeModuleNames: "exclude"` +* `nodeModuleNamesOnly: true` is mapped to `nodeModuleNames: "only"` + +If both `nodeModuleNamesOnly` and `nodeModuleNames` are included in options, `nodeModuleNames` takes precedence. \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/main.js b/node_modules/@11ty/dependency-tree/main.js new file mode 100644 index 0000000..8d0df87 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/main.js @@ -0,0 +1,120 @@ +const path = require("path"); + +function getAbsolutePath(filename) { + let normalizedFilename = path.normalize(filename); // removes dot slash + let hasDotSlash = filename.startsWith("./"); + return hasDotSlash ? path.join(path.resolve("."), normalizedFilename) : normalizedFilename; +} + +function getRelativePath(filename) { + let normalizedFilename = path.normalize(filename); // removes dot slash + let workingDirectory = path.resolve("."); + let result = "./" + (normalizedFilename.startsWith(workingDirectory) ? normalizedFilename.substr(workingDirectory.length + 1) : normalizedFilename); + return result; +} + +function getNodeModuleName(filename) { + let foundNodeModules = false; + let moduleName = []; + + let s = filename.split(path.sep); + for(let entry of s) { + if(foundNodeModules) { + moduleName.push(entry); + if(!entry.startsWith("@")) { + return moduleName.join("/"); + } + } + + if(entry === "node_modules") { + foundNodeModules = true; + } + } + + return false; +} + +/* unordered */ +function getDependenciesFor(filename, avoidCircular, optionsArg = {}) { + // backwards compatibility with `nodeModuleNamesOnly` boolean option + // Using `nodeModuleNames` property moving forward + if(("nodeModuleNamesOnly" in optionsArg) && !("nodeModuleNames" in optionsArg)) { + if(optionsArg.nodeModuleNamesOnly === true) { + optionsArg.nodeModuleNames = "only"; + } + if(optionsArg.nodeModuleNamesOnly === false) { + optionsArg.nodeModuleNames = "exclude"; + } + } + + let options = Object.assign({ + allowNotFound: false, + nodeModuleNames: "exclude", // also "include" or "only" + }, optionsArg); + let absoluteFilename = getAbsolutePath(filename) + + try { + require(absoluteFilename); + } catch(e) { + if(e.code === "MODULE_NOT_FOUND" && options.allowNotFound) { + // do nothing + } else { + throw e; + } + } + + + let mod; + for(let entry in require.cache) { + if(entry === absoluteFilename) { + mod = require.cache[entry]; + break; + } + } + + let dependencies = new Set(); + + if(!mod) { + if(!options.allowNotFound) { + throw new Error(`Could not find ${filename} in @11ty/dependency-tree`); + } + } else { + let relativeFilename = getRelativePath(mod.filename); + if(!avoidCircular) { + avoidCircular = {}; + } else if(options.nodeModuleNames !== "only") { + dependencies.add(relativeFilename); + } + + avoidCircular[relativeFilename] = true; + + if(mod.children) { + for(let child of mod.children) { + let relativeChildFilename = getRelativePath(child.filename); + let nodeModuleName = getNodeModuleName(child.filename); + + if(options.nodeModuleNames !== "exclude" && nodeModuleName) { + dependencies.add(nodeModuleName); + } + // Add dependencies of this dependency (not top level node_modules) + if(nodeModuleName === false) { + if(!dependencies.has(relativeChildFilename) && // avoid infinite looping with circular deps + !avoidCircular[relativeChildFilename] ) { + for(let dependency of getDependenciesFor(relativeChildFilename, avoidCircular, options)) { + dependencies.add(dependency); + } + } + } + } + } + } + + return dependencies; +} + +function getCleanDependencyListFor(filename, options = {}) { + return Array.from( getDependenciesFor(filename, null, options) ); +} + +module.exports = getCleanDependencyListFor; +module.exports.getNodeModuleName = getNodeModuleName; \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/package.json b/node_modules/@11ty/dependency-tree/package.json new file mode 100644 index 0000000..b323bd6 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/package.json @@ -0,0 +1,30 @@ +{ + "name": "@11ty/dependency-tree", + "version": "2.0.1", + "description": "Finds all JavaScript require dependencies from a filename.", + "main": "main.js", + "scripts": { + "test": "npx ava" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/11ty/eleventy-dependency-tree.git" + }, + "author": { + "name": "Zach Leatherman", + "email": "zach@zachleat.com", + "url": "https://zachleat.com/" + }, + "license": "MIT", + "devDependencies": { + "ava": "^3.15.0" + }, + "ava": { + "files": [ + "./test/*.js" + ], + "ignoredByWatcher": [ + "./test/stubs/**" + ] + } +} diff --git a/node_modules/@11ty/dependency-tree/test/mainTest.js b/node_modules/@11ty/dependency-tree/test/mainTest.js new file mode 100644 index 0000000..ab5af3c --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/mainTest.js @@ -0,0 +1,92 @@ +const test = require("ava"); +const DependencyTree = require("../main.js"); + +test("Nonexistent", t => { + t.throws(() => { + DependencyTree("./test/stubs/thisdoesnotexist.js"); + }); +}); + +test("Allow not Found", t => { + DependencyTree("./test/stubs/thisdoesnotexist.js", { allowNotFound: true }); + t.true(true); +}); + +test("Not require()’d before calling", t => { + DependencyTree("./test/stubs/parent/parent.js"); + t.true(true); +}); + +test("simple.js", t => { + t.deepEqual(DependencyTree("./test/stubs/simple.js"), ["./test/stubs/simple2.js"]); +}); + +test("parent.js", t => { + t.deepEqual(DependencyTree("./test/stubs/parent/parent.js").sort(), [ + "./test/stubs/parent/child1.js", + "./test/stubs/parent/child2.js", + "./test/stubs/parent/grandchild.js", + "./test/stubs/parent/greatgrandchild.js" + ]); + + t.deepEqual(DependencyTree("./test/stubs/parent/child1.js").sort(), [ + "./test/stubs/parent/grandchild.js", + "./test/stubs/parent/greatgrandchild.js" + ]); + + t.deepEqual(DependencyTree("./test/stubs/parent/child2.js").sort(), [ + "./test/stubs/parent/grandchild.js", + "./test/stubs/parent/greatgrandchild.js" + ]); + + t.deepEqual(DependencyTree("./test/stubs/parent/grandchild.js"), [ + "./test/stubs/parent/greatgrandchild.js" + ]); + + t.deepEqual(DependencyTree("./test/stubs/parent/greatgrandchild.js"), []); +}); + +test("circular", t => { + t.deepEqual(DependencyTree("./test/stubs/circular/circle-a.js").sort(), [ + "./test/stubs/circular/circle-b.js", + "./test/stubs/circular/circle-c.js"]); +}); + +test("another circular", t => { + t.deepEqual(DependencyTree("./test/stubs/circular2/circle-a.js").sort(), [ + "./test/stubs/circular2/circle-b.js", + "./test/stubs/circular2/circle-c.js" + ]); +}); + +test("dot dot (dependency is up a directory)", t => { + t.deepEqual(DependencyTree("./test/stubs/dotdot/dotdot.js").sort(), [ + "./test/stubs/simple2.js" + ]); +}); + +test("only node_modules", t => { + t.deepEqual(DependencyTree("./test/stubs/uses_node_modules.js", { + nodeModuleNamesOnly: true + }).sort(), [ + "@sindresorhus/is", + "lodash", + ]); +}); + +test("getNodeModuleName", t => { + t.is(DependencyTree.getNodeModuleName("./eleventy-dependency-tree/node_modules/lodash/lodash.js"), "lodash"); + t.is(DependencyTree.getNodeModuleName("./eleventy-dependency-tree/node_modules/@sindresorhus/is/dist/index.js"), "@sindresorhus/is"); +}); + +test("both files and node_modules", t => { + t.deepEqual(DependencyTree("./test/stubs/uses_node_modules.js", { + nodeModuleNames: "include" + }).sort(), [ + "./test/stubs/parent/child1.js", + "./test/stubs/parent/grandchild.js", + "./test/stubs/parent/greatgrandchild.js", + "@sindresorhus/is", + "lodash", + ]); +}); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-a.js b/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-a.js new file mode 100644 index 0000000..6623835 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-a.js @@ -0,0 +1 @@ +const circleB = require("./circle-b"); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-b.js b/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-b.js new file mode 100644 index 0000000..c0e7321 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-b.js @@ -0,0 +1 @@ +const circleC = require("./circle-c"); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-c.js b/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-c.js new file mode 100644 index 0000000..8a6e8fe --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/circular/circle-c.js @@ -0,0 +1 @@ +const circleA = require("./circle-a"); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-a.js b/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-a.js new file mode 100644 index 0000000..6623835 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-a.js @@ -0,0 +1 @@ +const circleB = require("./circle-b"); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-b.js b/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-b.js new file mode 100644 index 0000000..c0e7321 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-b.js @@ -0,0 +1 @@ +const circleC = require("./circle-c"); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-c.js b/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-c.js new file mode 100644 index 0000000..035f42f --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/circular2/circle-c.js @@ -0,0 +1 @@ +const circleA = require("./circle-b"); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/dotdot/dotdot.js b/node_modules/@11ty/dependency-tree/test/stubs/dotdot/dotdot.js new file mode 100644 index 0000000..c9f0d88 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/dotdot/dotdot.js @@ -0,0 +1 @@ +const test = require("../simple2") \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/parent/child1.js b/node_modules/@11ty/dependency-tree/test/stubs/parent/child1.js new file mode 100644 index 0000000..a1dd077 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/parent/child1.js @@ -0,0 +1,4 @@ +const test2 = require("./grandchild"); +const lodash = require("lodash"); + +module.exports = {}; \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/parent/child2.js b/node_modules/@11ty/dependency-tree/test/stubs/parent/child2.js new file mode 100644 index 0000000..991077a --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/parent/child2.js @@ -0,0 +1,3 @@ +const test = require("./grandchild"); + +module.exports = {}; \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/parent/grandchild.js b/node_modules/@11ty/dependency-tree/test/stubs/parent/grandchild.js new file mode 100644 index 0000000..d721195 --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/parent/grandchild.js @@ -0,0 +1,2 @@ +const test = require("./greatgrandchild.js"); +module.exports = {}; \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/parent/greatgrandchild.js b/node_modules/@11ty/dependency-tree/test/stubs/parent/greatgrandchild.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@11ty/dependency-tree/test/stubs/parent/parent.js b/node_modules/@11ty/dependency-tree/test/stubs/parent/parent.js new file mode 100644 index 0000000..3045c9b --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/parent/parent.js @@ -0,0 +1,5 @@ +const path = require("path"); +const test = require("./child1"); +const test2 = require("./child2"); + +module.exports = {}; \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/simple.js b/node_modules/@11ty/dependency-tree/test/stubs/simple.js new file mode 100644 index 0000000..eedd85c --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/simple.js @@ -0,0 +1 @@ +const test = require("./simple2"); \ No newline at end of file diff --git a/node_modules/@11ty/dependency-tree/test/stubs/simple2.js b/node_modules/@11ty/dependency-tree/test/stubs/simple2.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@11ty/dependency-tree/test/stubs/uses_node_modules.js b/node_modules/@11ty/dependency-tree/test/stubs/uses_node_modules.js new file mode 100644 index 0000000..870f51f --- /dev/null +++ b/node_modules/@11ty/dependency-tree/test/stubs/uses_node_modules.js @@ -0,0 +1,4 @@ +const is = require("@sindresorhus/is"); +const child1 = require("./parent/child1.js"); + +module.exports = {}; \ No newline at end of file diff --git a/node_modules/@11ty/eleventy-dev-server/README.md b/node_modules/@11ty/eleventy-dev-server/README.md new file mode 100644 index 0000000..fcdb54c --- /dev/null +++ b/node_modules/@11ty/eleventy-dev-server/README.md @@ -0,0 +1,56 @@ +

11ty Logo

+ +# eleventy-dev-server 🕚⚡️🎈🐀 + +A minimal, modern, generic, hot-reloading local web server to help web developers. + +## ➡ [Documentation](https://www.11ty.dev/docs/watch-serve/#eleventy-dev-server) + +- Please star [Eleventy on GitHub](https://github.com/11ty/eleventy/)! +- Follow us on Twitter [@eleven_ty](https://twitter.com/eleven_ty) +- Support [11ty on Open Collective](https://opencollective.com/11ty) +- [11ty on npm](https://www.npmjs.com/org/11ty) +- [11ty on GitHub](https://github.com/11ty) + +[![npm Version](https://img.shields.io/npm/v/@11ty/eleventy-dev-server.svg?style=for-the-badge)](https://www.npmjs.com/package/@11ty/eleventy-dev-server) + +## Installation + +This is bundled with `@11ty/eleventy` (and you do not need to install it separately) in Eleventy v2.0. + +## CLI + +Eleventy Dev Server now also includes a CLI. The CLI is for **standalone** (non-Eleventy) use only: separate installation is unnecessary if you’re using this server with `@11ty/eleventy`. + +```sh +npm install -g @11ty/eleventy-dev-server + +# Alternatively, install locally into your project +npm install @11ty/eleventy-dev-server +``` + +This package requires Node 14 or newer. + +### CLI Usage + +```sh +# Serve the current directory +npx @11ty/eleventy-dev-server + +# Serve a different subdirectory (also aliased as --input) +npx @11ty/eleventy-dev-server --dir=_site + +# Disable the `domdiff` feature +npx @11ty/eleventy-dev-server --domdiff=false + +# Full command list in the Help +npx @11ty/eleventy-dev-server --help +``` + +## Tests + +``` +npm run test +``` + +- We use the [ava JavaScript test runner](https://github.com/avajs/ava) ([Assertions documentation](https://github.com/avajs/ava/blob/master/docs/03-assertions.md)) diff --git a/node_modules/@11ty/eleventy-dev-server/cli.js b/node_modules/@11ty/eleventy-dev-server/cli.js new file mode 100644 index 0000000..35621eb --- /dev/null +++ b/node_modules/@11ty/eleventy-dev-server/cli.js @@ -0,0 +1,92 @@ +const chokidar = require("chokidar"); +const fs = require("fs"); + +const pkg = require("./package.json"); +const EleventyDevServer = require("./server.js"); + +const Logger = { + info: function(...args) { + console.log( "[11ty/eleventy-dev-server]", ...args ); + }, + error: function(...args) { + console.error( "[11ty/eleventy-dev-server]", ...args ); + }, + fatal: function(...args) { + Logger.error(...args); + process.exitCode = 1; + } +}; + +Logger.log = Logger.info; + +class Cli { + static getVersion() { + return pkg.version; + } + + static getHelp() { + return `Usage: + + eleventy-dev-server + eleventy-dev-server --dir=_site + eleventy-dev-server --port=3000 + +Arguments: + + --version + + --dir=. + Directory to serve (default: \`.\`) + + --input (alias for --dir) + + --port=8080 + Run the web server on this port (default: \`8080\`) + Will autoincrement if already in use. + + --domdiff (enabled, default) + --domdiff=false (disabled) + Apply HTML changes without a full page reload. + + --help`; + } + + static getDefaultOptions() { + return { + port: "8080", + input: ".", + domDiff: true, + } + } + + async serve(options = {}) { + this.options = Object.assign(Cli.getDefaultOptions(), options); + + this.server = EleventyDevServer.getServer("eleventy-dev-server-cli", this.options.input, { + // TODO allow server configuration extensions + showVersion: true, + logger: Logger, + domDiff: this.options.domDiff, + + // CLI watches all files in the folder by default + // this is different from Eleventy usage! + watch: [ this.options.input ], + }); + + this.server.serve(this.options.port); + + // TODO? send any errors here to the server too + // with server.sendError({ error }); + } + + close() { + if(this.server) { + this.server.close(); + } + } +} + +module.exports = { + Logger, + Cli +} diff --git a/node_modules/@11ty/eleventy-dev-server/client/reload-client.js b/node_modules/@11ty/eleventy-dev-server/client/reload-client.js new file mode 100644 index 0000000..1763411 --- /dev/null +++ b/node_modules/@11ty/eleventy-dev-server/client/reload-client.js @@ -0,0 +1,259 @@ +class Util { + static pad(num, digits = 2) { + let zeroes = new Array(digits + 1).join(0); + return `${zeroes}${num}`.slice(-1 * digits); + } + + static log(message) { + Util.output("log", message); + } + static error(message, error) { + Util.output("error", message, error); + } + static output(type, ...messages) { + let now = new Date(); + let date = `${Util.pad(now.getUTCHours())}:${Util.pad( + now.getUTCMinutes() + )}:${Util.pad(now.getUTCSeconds())}.${Util.pad( + now.getUTCMilliseconds(), + 3 + )}`; + console[type](`[11ty][${date} UTC]`, ...messages); + } + + static capitalize(word) { + return word.substr(0, 1).toUpperCase() + word.substr(1); + } + + static matchRootAttributes(htmlContent) { + // Workaround for morphdom bug with attributes on https://github.com/11ty/eleventy-dev-server/issues/6 + // Note also `childrenOnly: true` above + const parser = new DOMParser(); + let parsed = parser.parseFromString(htmlContent, "text/html"); + let parsedDoc = parsed.documentElement; + let newAttrs = parsedDoc.getAttributeNames(); + + let docEl = document.documentElement; + // Remove old + let removedAttrs = docEl.getAttributeNames().filter(name => !newAttrs.includes(name)); + for(let attr of removedAttrs) { + docEl.removeAttribute(attr); + } + + // Add new + for(let attr of newAttrs) { + docEl.setAttribute(attr, parsedDoc.getAttribute(attr)); + } + } + + static isEleventyLinkNodeMatch(from, to) { + // Issue #18 https://github.com/11ty/eleventy-dev-server/issues/18 + // Don’t update a if the _11ty searchParam is the only thing that’s different + if(from.tagName !== "LINK" || to.tagName !== "LINK") { + return false; + } + + let oldWithoutHref = from.cloneNode(); + let newWithoutHref = to.cloneNode(); + + oldWithoutHref.removeAttribute("href"); + newWithoutHref.removeAttribute("href"); + + // if all other attributes besides href match + if(!oldWithoutHref.isEqualNode(newWithoutHref)) { + return false; + } + + let oldUrl = new URL(from.href); + let newUrl = new URL(to.href); + + // morphdom wants to force href="style.css?_11ty" => href="style.css" + let isErasing = oldUrl.searchParams.has("_11ty") && !newUrl.searchParams.has("_11ty"); + if(!isErasing) { + // not a match if _11ty has a new value (not being erased) + return false; + } + + oldUrl.searchParams.set("_11ty", ""); + newUrl.searchParams.set("_11ty", ""); + + // is a match if erasing and the rest of the href matches too + return oldUrl.toString() === newUrl.toString(); + } + + // https://github.com/patrick-steele-idem/morphdom/issues/178#issuecomment-652562769 + static runScript(source, target) { + let script = document.createElement('script'); + + //copy over the attributes + for(let attr of [...source.attributes]) { + script.setAttribute(attr.nodeName ,attr.nodeValue); + } + + script.innerHTML = source.innerHTML; + (target || source).replaceWith(script); + } +} + +class EleventyReload { + constructor() { + this.connectionMessageShown = false; + this.reconnectEventCallback = this.reconnect.bind(this); + } + + init(options = {}) { + if (!("WebSocket" in window)) { + return; + } + + let { protocol, host } = new URL(document.location.href); + + // works with http (ws) and https (wss) + let websocketProtocol = protocol.replace("http", "ws"); + + let socket = new WebSocket(`${websocketProtocol}//${host}`); + + socket.addEventListener("message", async (event) => { + try { + let data = JSON.parse(event.data); + // Util.log( JSON.stringify(data, null, 2) ); + + let { type } = data; + + if (type === "eleventy.reload") { + await this.onreload(data); + } else if (type === "eleventy.msg") { + Util.log(`${data.message}`); + } else if (type === "eleventy.error") { + // Log Eleventy build errors + // Extra parsing for Node Error objects + let e = JSON.parse(data.error); + Util.error(`Build error: ${e.message}`, e); + } else if (type === "eleventy.status") { + // Full page reload on initial reconnect + if (data.status === "connected" && options.mode === "reconnect") { + window.location.reload(); + } + + if(data.status === "connected") { + // With multiple windows, only show one connection message + if(!this.isConnected) { + Util.log(Util.capitalize(data.status)); + } + + this.connectionMessageShown = true; + } else { + if(data.status === "disconnected") { + this.addReconnectListeners(); + } + + Util.log(Util.capitalize(data.status)); + } + } else { + Util.log("Unknown event type", data); + } + } catch (e) { + Util.error(`Error parsing ${event.data}: ${e.message}`, e); + } + }); + + socket.addEventListener("open", () => { + // no reconnection when the connect is already open + this.removeReconnectListeners(); + }); + + socket.addEventListener("close", () => { + this.connectionMessageShown = false; + this.addReconnectListeners(); + }); + } + + reconnect() { + Util.log( "Reconnecting…" ); + this.init({ mode: "reconnect" }); + } + + async onreload({ subtype, files, build }) { + if (subtype === "css") { + for (let link of document.querySelectorAll(`link[rel="stylesheet"]`)) { + let url = new URL(link.href); + url.searchParams.set("_11ty", Date.now()); + link.href = url.toString(); + } + Util.log(`CSS updated without page reload.`); + } else { + let morphed = false; + + try { + if((build.templates || []).length > 0) { + // Important: using `./` in `./morphdom.js` allows the special `.11ty` folder to be changed upstream + const { default: morphdom } = await import(`./morphdom.js`); + + // { url, inputPath, content } + for (let template of build.templates || []) { + if (template.url === document.location.pathname) { + // Importantly, if this does not match but is still relevant (layout/include/etc), a full reload happens below. This could be improved. + if ((files || []).includes(template.inputPath)) { + // Notable limitation: this won’t re-run script elements or JavaScript page lifecycle events (load/DOMContentLoaded) + morphed = true; + + morphdom(document.documentElement, template.content, { + childrenOnly: true, + onBeforeElUpdated: function (fromEl, toEl) { + if (fromEl.nodeName === "SCRIPT" && toEl.nodeName === "SCRIPT") { + Util.runScript(toEl, fromEl); + return false; + } + + // Speed-up trick from morphdom docs + // https://dom.spec.whatwg.org/#concept-node-equals + if (fromEl.isEqualNode(toEl)) { + return false; + } + + if(Util.isEleventyLinkNodeMatch(fromEl, toEl)) { + return false; + } + + return true; + }, + onNodeAdded: function (node) { + if (node.nodeName === 'SCRIPT') { + Util.runScript(node); + } + }, + }); + + Util.matchRootAttributes(template.content); + Util.log(`HTML delta applied without page reload.`); + } + break; + } + } + } + } catch(e) { + Util.error( "Morphdom error", e ); + } + + if (!morphed) { + Util.log(`Page reload initiated.`); + window.location.reload(); + } + } + } + + addReconnectListeners() { + this.removeReconnectListeners(); + + window.addEventListener("focus", this.reconnectEventCallback); + window.addEventListener("visibilitychange", this.reconnectEventCallback); + } + + removeReconnectListeners() { + window.removeEventListener("focus", this.reconnectEventCallback); + window.removeEventListener("visibilitychange", this.reconnectEventCallback); + } +} + +let reloader = new EleventyReload(); +reloader.init(); \ No newline at end of file diff --git a/node_modules/@11ty/eleventy-dev-server/cmd.js b/node_modules/@11ty/eleventy-dev-server/cmd.js new file mode 100755 index 0000000..0cde317 --- /dev/null +++ b/node_modules/@11ty/eleventy-dev-server/cmd.js @@ -0,0 +1,69 @@ +#!/usr/bin/env node + +const pkg = require("./package.json"); + +// Node check +require("please-upgrade-node")(pkg, { + message: function (requiredVersion) { + return ( + "eleventy-dev-server requires Node " + + requiredVersion + + ". You will need to upgrade Node!" + ); + }, +}); + +const { Logger, Cli } = require("./cli.js"); + +const debug = require("debug")("EleventyDevServer:cmd"); + +try { + const argv = require("minimist")(process.argv.slice(2), { + string: [ + "dir", + "input", // alias for dir + "port", + ], + boolean: [ + "version", + "help", + "domdiff", + ], + default: Cli.getDefaultOptions(), + unknown: function (unknownArgument) { + throw new Error( + `We don’t know what '${unknownArgument}' is. Use --help to see the list of supported commands.` + ); + }, + }); + + debug("command: eleventy-dev-server %o", argv); + + process.on("unhandledRejection", (error, promise) => { + Logger.fatal("Unhandled rejection in promise:", promise, error); + }); + process.on("uncaughtException", (error) => { + Logger.fatal("Uncaught exception:", error); + }); + + if (argv.version) { + console.log(Cli.getVersion()); + } else if (argv.help) { + console.log(Cli.getHelp()); + } else { + let cli = new Cli(); + + cli.serve({ + input: argv.dir || argv.input, + port: argv.port, + domDiff: argv.domdiff, + }); + + process.on("SIGINT", () => { + cli.close(); + process.exit(); + }); + } +} catch (e) { + Logger.fatal("Fatal Error:", e) +} diff --git a/node_modules/@11ty/eleventy-dev-server/package.json b/node_modules/@11ty/eleventy-dev-server/package.json new file mode 100644 index 0000000..4606b77 --- /dev/null +++ b/node_modules/@11ty/eleventy-dev-server/package.json @@ -0,0 +1,56 @@ +{ + "name": "@11ty/eleventy-dev-server", + "version": "1.0.4", + "description": "A minimal, modern, generic, hot-reloading local web server to help web developers.", + "main": "server.js", + "scripts": { + "test": "npx ava --verbose", + "sample": "node cmd.js --input=test/stubs" + }, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/11ty" + }, + "bin": { + "eleventy-dev-server": "./cmd.js" + }, + "keywords": [ + "eleventy", + "server", + "cli" + ], + "publishConfig": { + "access": "public" + }, + "author": { + "name": "Zach Leatherman", + "email": "zachleatherman@gmail.com", + "url": "https://zachleat.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/11ty/eleventy-dev-server.git" + }, + "bugs": "https://github.com/11ty/eleventy-dev-server/issues", + "homepage": "https://github.com/11ty/eleventy-dev-server/", + "dependencies": { + "@11ty/eleventy-utils": "^1.0.1", + "chokidar": "^3.5.3", + "debug": "^4.3.4", + "dev-ip": "^1.0.1", + "finalhandler": "^1.2.0", + "mime": "^3.0.0", + "minimist": "^1.2.8", + "morphdom": "^2.7.0", + "please-upgrade-node": "^3.2.0", + "ssri": "^8.0.1", + "ws": "^8.13.0" + }, + "devDependencies": { + "ava": "^5.2.0" + } +} diff --git a/node_modules/@11ty/eleventy-dev-server/server.js b/node_modules/@11ty/eleventy-dev-server/server.js new file mode 100644 index 0000000..aad4c38 --- /dev/null +++ b/node_modules/@11ty/eleventy-dev-server/server.js @@ -0,0 +1,807 @@ +const pkg = require("./package.json"); +const path = require("path"); +const fs = require("fs"); +const finalhandler = require("finalhandler"); +const WebSocket = require("ws"); +const { WebSocketServer } = WebSocket; +const mime = require("mime"); +const ssri = require("ssri"); +const devip = require("dev-ip"); +const chokidar = require("chokidar"); +const { TemplatePath } = require("@11ty/eleventy-utils"); + +const debug = require("debug")("EleventyDevServer"); + +const wrapResponse = require("./server/wrapResponse.js"); + +const DEFAULT_OPTIONS = { + port: 8080, + liveReload: true, // Enable live reload at all + showAllHosts: false, // IP address based hosts (other than localhost) + injectedScriptsFolder: ".11ty", // Change the name of the special folder used for injected scripts + portReassignmentRetryCount: 10, // number of times to increment the port if in use + https: {}, // `key` and `cert`, required for http/2 and https + domDiff: true, // Use morphdom to apply DOM diffing delta updates to HTML + showVersion: false, // Whether or not to show the server version on the command line. + encoding: "utf-8", // Default file encoding + pathPrefix: "/", // May be overridden by Eleventy, adds a virtual base directory to your project + watch: [], // Globs to pass to separate dev server chokidar for watching + aliases: {}, // Aliasing feature + + // Logger (fancier one is injected by Eleventy) + logger: { + info: console.log, + log: console.log, + error: console.error, + } +} + +class EleventyDevServer { + static getServer(...args) { + return new EleventyDevServer(...args); + } + + constructor(name, dir, options = {}) { + debug("Creating new Dev Server instance.") + this.name = name; + this.normalizeOptions(options); + + this.fileCache = {}; + // Directory to serve + if(!dir) { + throw new Error("Missing `dir` to serve."); + } + this.dir = dir; + this.logger = this.options.logger; + + if(this.options.watch.length > 0) { + this.getWatcher(); + } + } + + normalizeOptions(options = {}) { + this.options = Object.assign({}, DEFAULT_OPTIONS, options); + + // better names for options https://github.com/11ty/eleventy-dev-server/issues/41 + if(options.folder !== undefined) { + this.options.injectedScriptsFolder = options.folder; + delete this.options.folder; + } + if(options.domdiff !== undefined) { + this.options.domDiff = options.domdiff; + delete this.options.domdiff; + } + if(options.enabled !== undefined) { + this.options.liveReload = options.enabled; + delete this.options.enabled; + } + + this.options.pathPrefix = this.cleanupPathPrefix(this.options.pathPrefix); + } + + get watcher() { + if(!this._watcher) { + debug("Watching %O", this.options.watch); + // TODO if using Eleventy and `watch` option includes output folder (_site) this will trigger two update events! + this._watcher = chokidar.watch(this.options.watch, { + // TODO allow chokidar configuration extensions (or re-use the ones in Eleventy) + + ignored: ["**/node_modules/**", ".git"], + ignoreInitial: true, + + // same values as Eleventy + awaitWriteFinish: { + stabilityThreshold: 150, + pollInterval: 25, + }, + }); + + this._watcher.on("change", (path) => { + this.logger.log( `File changed: ${path} (skips build)` ); + this.reloadFiles([path]); + }); + + this._watcher.on("add", (path) => { + this.logger.log( `File added: ${path} (skips build)` ); + this.reloadFiles([path]); + }); + } + + return this._watcher; + } + + getWatcher() { + return this.watcher; + } + + watchFiles(files) { + if(Array.isArray(files)) { + files = files.map(entry => TemplatePath.stripLeadingDotSlash(entry)); + + debug("Also watching %O", files); + this.watcher.add(files); + } + } + + cleanupPathPrefix(pathPrefix) { + if(!pathPrefix || pathPrefix === "/") { + return "/"; + } + if(!pathPrefix.startsWith("/")) { + pathPrefix = `/${pathPrefix}` + } + if(!pathPrefix.endsWith("/")) { + pathPrefix = `${pathPrefix}/`; + } + return pathPrefix; + } + + // Allowed list of files that can be served from outside `dir` + setAliases(aliases) { + if(aliases) { + this.passthroughAliases = aliases; + debug( "Setting aliases (emulated passthrough copy) %O", aliases ); + } + } + + matchPassthroughAlias(url) { + let aliases = Object.assign({}, this.options.aliases, this.passthroughAliases); + for(let targetUrl in aliases) { + if(!targetUrl) { + continue; + } + + let file = aliases[targetUrl]; + if(url.startsWith(targetUrl)) { + let inputDirectoryPath = file + url.slice(targetUrl.length); + + // e.g. addPassthroughCopy("img/") but + // generated by the image plugin (written to the output folder) + // If they do not exist in the input directory, this will fallback to the output directory. + if(fs.existsSync(inputDirectoryPath)) { + return inputDirectoryPath; + } + } + } + return false; + } + + isFileInDirectory(dir, file) { + let absoluteDir = TemplatePath.absolutePath(dir); + let absoluteFile = TemplatePath.absolutePath(file); + return absoluteFile.startsWith(absoluteDir); + } + + getOutputDirFilePath(filepath, filename = "") { + let computedPath; + if(filename === ".html") { + // avoid trailing slash for filepath/.html requests + let prefix = path.join(this.dir, filepath); + if(prefix.endsWith(path.sep)) { + prefix = prefix.substring(0, prefix.length - path.sep.length); + } + computedPath = prefix + filename; + } else { + computedPath = path.join(this.dir, filepath, filename); + } + + computedPath = decodeURIComponent(computedPath); + + if(!filename) { // is a direct URL request (not an implicit .html or index.html add) + let alias = this.matchPassthroughAlias(filepath); + + if(alias) { + if(!this.isFileInDirectory(path.resolve("."), alias)) { + throw new Error("Invalid path"); + } + + return alias; + } + } + + // Check that the file is in the output path (error if folks try use `..` in the filepath) + if(!this.isFileInDirectory(this.dir, computedPath)) { + throw new Error("Invalid path"); + } + + return computedPath; + } + + isOutputFilePathExists(rawPath) { + return fs.existsSync(rawPath) && !TemplatePath.isDirectorySync(rawPath); + } + + /* Use conventions documented here https://www.zachleat.com/web/trailing-slash/ + * resource.html exists: + * /resource matches + * /resource/ redirects to /resource + * resource/index.html exists: + * /resource redirects to /resource/ + * /resource/ matches + * both resource.html and resource/index.html exists: + * /resource matches /resource.html + * /resource/ matches /resource/index.html + */ + mapUrlToFilePath(url) { + // Note: `localhost` is not important here, any host would work + let u = new URL(url, "http://localhost/"); + url = u.pathname; + + // Remove PathPrefix from start of URL + if (this.options.pathPrefix !== "/") { + // Requests to root should redirect to new pathPrefix + if(url === "/") { + return { + statusCode: 302, + url: this.options.pathPrefix, + } + } + + // Requests to anything outside of root should fail with 404 + if (!url.startsWith(this.options.pathPrefix)) { + return { + statusCode: 404, + }; + } + + url = url.slice(this.options.pathPrefix.length - 1); + } + + let rawPath = this.getOutputDirFilePath(url); + if (this.isOutputFilePathExists(rawPath)) { + return { + statusCode: 200, + filepath: rawPath, + }; + } + + let indexHtmlPath = this.getOutputDirFilePath(url, "index.html"); + let indexHtmlExists = fs.existsSync(indexHtmlPath); + + let htmlPath = this.getOutputDirFilePath(url, ".html"); + let htmlExists = fs.existsSync(htmlPath); + + // /resource/ => /resource/index.html + if (indexHtmlExists && url.endsWith("/")) { + return { + statusCode: 200, + filepath: indexHtmlPath, + }; + } + // /resource => resource.html + if (htmlExists && !url.endsWith("/")) { + return { + statusCode: 200, + filepath: htmlPath, + }; + } + + // /resource => redirect to /resource/ + if (indexHtmlExists && !url.endsWith("/")) { + return { + statusCode: 301, + url: url + "/", + }; + } + + // /resource/ => redirect to /resource + if (htmlExists && url.endsWith("/")) { + return { + statusCode: 301, + url: url.substring(0, url.length - 1), + }; + } + + return { + statusCode: 404, + }; + } + + _getFileContents(localpath, rootDir, useCache = true) { + if(this.fileCache[localpath]) { + return this.fileCache[localpath]; + } + + let filepath; + let searchLocations = []; + + if(rootDir) { + searchLocations.push(TemplatePath.absolutePath(rootDir, localpath)); + } + // fallbacks for file:../ installations + searchLocations.push(TemplatePath.absolutePath(__dirname, localpath)); + searchLocations.push(TemplatePath.absolutePath(__dirname, "../../../", localpath)); + + for(let loc of searchLocations) { + if(fs.existsSync(loc)) { + filepath = loc; + break; + } + } + + let contents = fs.readFileSync(filepath, { + encoding: this.options.encoding, + }); + if(useCache) { + this.fileCache[localpath] = contents; + } + return contents; + } + + augmentContentWithNotifier(content, inlineContents = false, options = {}) { + let { integrityHash, scriptContents } = options; + if(!scriptContents) { + scriptContents = this._getFileContents("./client/reload-client.js"); + } + if(!integrityHash) { + integrityHash = ssri.fromData(scriptContents); + } + + // This isn’t super necessary because it’s a local file, but it’s included anyway + let script = ``; + + if (content.includes("")) { + return content.replace("", `${script}`); + } + + // If the HTML document contains an importmap, insert the module script after the importmap element + let importMapRegEx = / +``` + +In [Node.js](https://nodejs.org/): + +```js +const cssesc = require('cssesc'); +``` + +In Ruby using [the `ruby-cssesc` wrapper gem](https://github.com/borodean/ruby-cssesc): + +```bash +gem install ruby-cssesc +``` + +```ruby +require 'ruby-cssesc' +CSSEsc.escape('I ♥ Ruby', is_identifier: true) +``` + +In Sass using [`sassy-escape`](https://github.com/borodean/sassy-escape): + +```bash +gem install sassy-escape +``` + +```scss +body { + content: escape('I ♥ Sass', $is-identifier: true); +} +``` + +## API + +### `cssesc(value, options)` + +This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes). + +```js +cssesc('Ich ♥ Bücher'); +// → 'Ich \\2665 B\\FC cher' + +cssesc('foo 𝌆 bar'); +// → 'foo \\1D306 bar' +``` + +By default, `cssesc` returns a string that can be used as part of a CSS string. If the target is a CSS identifier rather than a CSS string, use the `isIdentifier: true` setting (see below). + +The optional `options` argument accepts an object with the following options: + +#### `isIdentifier` + +The default value for the `isIdentifier` option is `false`. This means that the input text will be escaped for use in a CSS string literal. If you want to use the result as a CSS identifier instead (in a selector, for example), set this option to `true`. + +```js +cssesc('123a2b'); +// → '123a2b' + +cssesc('123a2b', { + 'isIdentifier': true +}); +// → '\\31 23a2b' +``` + +#### `quotes` + +The default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input text will be escaped as `\'`, so that the output can be used in a CSS string literal wrapped in single quotes. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.'); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' +// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." + +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single' +}); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' +// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." +``` + +If you want to use the output as part of a CSS string literal wrapped in double quotes, set the `quotes` option to `'double'`. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double' +}); +// → 'Lorem ipsum \\"dolor\\" sit \'amet\' etc.' +// → "Lorem ipsum \\\"dolor\\\" sit 'amet' etc." +``` + +#### `wrap` + +The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid CSS string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single', + 'wrap': true +}); +// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' +// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" + +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double', + 'wrap': true +}); +// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' +// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" +``` + +#### `escapeEverything` + +The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols. + +```js +cssesc('lolwat"foo\'bar', { + 'escapeEverything': true +}); +// → '\\6C\\6F\\6C\\77\\61\\74\\"\\66\\6F\\6F\\\'\\62\\61\\72' +// → "\\6C\\6F\\6C\\77\\61\\74\\\"\\66\\6F\\6F\\'\\62\\61\\72" +``` + +#### Overriding the default options globally + +The global default settings can be overridden by modifying the `css.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting. + +```js +// Read the global default setting for `escapeEverything`: +cssesc.options.escapeEverything; +// → `false` by default + +// Override the global default setting for `escapeEverything`: +cssesc.options.escapeEverything = true; + +// Using the global default setting for `escapeEverything`, which is now `true`: +cssesc('foo © bar ≠ baz 𝌆 qux'); +// → '\\66\\6F\\6F\\ \\A9\\ \\62\\61\\72\\ \\2260\\ \\62\\61\\7A\\ \\1D306\\ \\71\\75\\78' +``` + +### `cssesc.version` + +A string representing the semantic version number. + +### Using the `cssesc` binary + +To use the `cssesc` binary in your shell, simply install cssesc globally using npm: + +```bash +npm install -g cssesc +``` + +After that you will be able to escape text for use in CSS strings or identifiers from the command line: + +```bash +$ cssesc 'föo ♥ bår 𝌆 baz' +f\F6o \2665 b\E5r \1D306 baz +``` + +If the output needs to be a CSS identifier rather than part of a string literal, use the `-i`/`--identifier` option: + +```bash +$ cssesc --identifier 'föo ♥ bår 𝌆 baz' +f\F6o\ \2665\ b\E5r\ \1D306\ baz +``` + +See `cssesc --help` for the full list of options. + +## Support + +This library supports the Node.js and browser versions mentioned in [`.babelrc`](https://github.com/mathiasbynens/cssesc/blob/master/.babelrc). For a version that supports a wider variety of legacy browsers and environments out-of-the-box, [see v0.1.0](https://github.com/mathiasbynens/cssesc/releases/tag/v0.1.0). + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +This library is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/cssesc/bin/cssesc b/node_modules/cssesc/bin/cssesc new file mode 100755 index 0000000..188c034 --- /dev/null +++ b/node_modules/cssesc/bin/cssesc @@ -0,0 +1,116 @@ +#!/usr/bin/env node +const fs = require('fs'); +const cssesc = require('../cssesc.js'); +const strings = process.argv.splice(2); +const stdin = process.stdin; +const options = {}; +const log = console.log; + +const main = function() { + const option = strings[0]; + + if (/^(?:-h|--help|undefined)$/.test(option)) { + log( + 'cssesc v%s - https://mths.be/cssesc', + cssesc.version + ); + log([ + '\nUsage:\n', + '\tcssesc [string]', + '\tcssesc [-i | --identifier] [string]', + '\tcssesc [-s | --single-quotes] [string]', + '\tcssesc [-d | --double-quotes] [string]', + '\tcssesc [-w | --wrap] [string]', + '\tcssesc [-e | --escape-everything] [string]', + '\tcssesc [-v | --version]', + '\tcssesc [-h | --help]', + '\nExamples:\n', + '\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc' + ].join('\n')); + return process.exit(1); + } + + if (/^(?:-v|--version)$/.test(option)) { + log('v%s', cssesc.version); + return process.exit(1); + } + + strings.forEach(function(string) { + // Process options + if (/^(?:-i|--identifier)$/.test(string)) { + options.isIdentifier = true; + return; + } + if (/^(?:-s|--single-quotes)$/.test(string)) { + options.quotes = 'single'; + return; + } + if (/^(?:-d|--double-quotes)$/.test(string)) { + options.quotes = 'double'; + return; + } + if (/^(?:-w|--wrap)$/.test(string)) { + options.wrap = true; + return; + } + if (/^(?:-e|--escape-everything)$/.test(string)) { + options.escapeEverything = true; + return; + } + + // Process string(s) + let result; + try { + result = cssesc(string, options); + log(result); + } catch (exception) { + log(exception.message + '\n'); + log('Error: failed to escape.'); + log('If you think this is a bug in cssesc, please report it:'); + log('https://github.com/mathiasbynens/cssesc/issues/new'); + log( + '\nStack trace using cssesc@%s:\n', + cssesc.version + ); + log(exception.stack); + return process.exit(1); + } + }); + // Return with exit status 0 outside of the `forEach` loop, in case + // multiple strings were passed in. + return process.exit(0); + +}; + +if (stdin.isTTY) { + // handle shell arguments + main(); +} else { + let timeout; + // Either the script is called from within a non-TTY context, or `stdin` + // content is being piped in. + if (!process.stdout.isTTY) { + // The script was called from a non-TTY context. This is a rather uncommon + // use case we don’t actively support. However, we don’t want the script + // to wait forever in such cases, so… + timeout = setTimeout(function() { + // …if no piped data arrived after a whole minute, handle shell + // arguments instead. + main(); + }, 60000); + } + let data = ''; + stdin.on('data', function(chunk) { + clearTimeout(timeout); + data += chunk; + }); + stdin.on('end', function() { + strings.push(data.trim()); + main(); + }); + stdin.resume(); +} diff --git a/node_modules/cssesc/cssesc.js b/node_modules/cssesc/cssesc.js new file mode 100644 index 0000000..1c0928e --- /dev/null +++ b/node_modules/cssesc/cssesc.js @@ -0,0 +1,110 @@ +/*! https://mths.be/cssesc v3.0.0 by @mathias */ +'use strict'; + +var object = {}; +var hasOwnProperty = object.hasOwnProperty; +var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; +}; + +var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; +var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; +var regexAlwaysEscape = /['"\\]/; +var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + +// https://mathiasbynens.be/notes/css-escapes#css +var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 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. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; +}; + +// Expose default options (so they can be overridden globally). +cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false +}; + +cssesc.version = '3.0.0'; + +module.exports = cssesc; diff --git a/node_modules/cssesc/man/cssesc.1 b/node_modules/cssesc/man/cssesc.1 new file mode 100644 index 0000000..eee4996 --- /dev/null +++ b/node_modules/cssesc/man/cssesc.1 @@ -0,0 +1,70 @@ +.Dd August 9, 2013 +.Dt cssesc 1 +.Sh NAME +.Nm cssesc +.Nd escape text for use in CSS string literals or identifiers +.Sh SYNOPSIS +.Nm +.Op Fl i | -identifier Ar string +.br +.Op Fl s | -single-quotes Ar string +.br +.Op Fl d | -double-quotes Ar string +.br +.Op Fl w | -wrap Ar string +.br +.Op Fl e | -escape-everything Ar string +.br +.Op Fl v | -version +.br +.Op Fl h | -help +.Sh DESCRIPTION +.Nm +escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output. +.Sh OPTIONS +.Bl -ohang -offset +.It Sy "-s, --single-quotes" +Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes. +.It Sy "-d, --double-quotes" +Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes. +.It Sy "-w, --wrap" +Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the +.Ar -s | --single-quotes +or +.Ar -d | --double-quotes +settings. +.It Sy "-e, --escape-everything" +Escape all the symbols in the output, even printable ASCII symbols. +.It Sy "-v, --version" +Print cssesc's version. +.It Sy "-h, --help" +Show the help screen. +.El +.Sh EXIT STATUS +The +.Nm cssesc +utility exits with one of the following values: +.Pp +.Bl -tag -width flag -compact +.It Li 0 +.Nm +successfully escaped the given text and printed the result. +.It Li 1 +.Nm +wasn't instructed to escape anything (for example, the +.Ar --help +flag was set); or, an error occurred. +.El +.Sh EXAMPLES +.Bl -ohang -offset +.It Sy "cssesc 'foo bar baz'" +Print an escaped version of the given text. +.It Sy echo\ 'foo bar baz'\ |\ cssesc +Print an escaped version of the text that gets piped in. +.El +.Sh BUGS +cssesc's bug tracker is located at . +.Sh AUTHOR +Mathias Bynens +.Sh WWW + diff --git a/node_modules/cssesc/package.json b/node_modules/cssesc/package.json new file mode 100644 index 0000000..076c84d --- /dev/null +++ b/node_modules/cssesc/package.json @@ -0,0 +1,51 @@ +{ + "name": "cssesc", + "version": "3.0.0", + "description": "A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.", + "homepage": "https://mths.be/cssesc", + "engines": { + "node": ">=4" + }, + "main": "cssesc.js", + "bin": "bin/cssesc", + "man": "man/cssesc.1", + "keywords": [ + "css", + "escape", + "identifier", + "string", + "tool" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/cssesc.git" + }, + "bugs": "https://github.com/mathiasbynens/cssesc/issues", + "files": [ + "LICENSE-MIT.txt", + "cssesc.js", + "bin/", + "man/" + ], + "scripts": { + "build": "grunt template && babel cssesc.js -o cssesc.js", + "test": "mocha tests", + "cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.6.1", + "codecov": "^1.0.1", + "grunt": "^1.0.1", + "grunt-template": "^1.0.0", + "istanbul": "^0.4.4", + "mocha": "^2.5.3", + "regenerate": "^1.2.1", + "requirejs": "^2.1.16" + } +} diff --git a/node_modules/debug/LICENSE b/node_modules/debug/LICENSE new file mode 100644 index 0000000..1a9820e --- /dev/null +++ b/node_modules/debug/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk +Copyright (c) 2018-2021 Josh Junon + +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. + diff --git a/node_modules/debug/README.md b/node_modules/debug/README.md new file mode 100644 index 0000000..e9c3e04 --- /dev/null +++ b/node_modules/debug/README.md @@ -0,0 +1,481 @@ +# debug +[![Build Status](https://travis-ci.org/debug-js/debug.svg?branch=master)](https://travis-ci.org/debug-js/debug) [![Coverage Status](https://coveralls.io/repos/github/debug-js/debug/badge.svg?branch=master)](https://coveralls.io/github/debug-js/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. + + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +`disable()` + +Will disable all namespaces. The functions returns the namespaces currently +enabled (and skipped). This can be useful if you want to disable debugging +temporarily without knowing what was enabled to begin with. + +For example: + +```js +let debug = require('debug'); +debug.enable('foo:*,-foo:bar'); +let namespaces = debug.disable(); +debug.enable(namespaces); +``` + +Note: There is no guarantee that the string will be identical to the initial +enable string, but semantically they will be identical. + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + +## Usage in child processes + +Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. +For example: + +```javascript +worker = fork(WORKER_WRAP_PATH, [workerPath], { + stdio: [ + /* stdin: */ 0, + /* stdout: */ 'pipe', + /* stderr: */ 'pipe', + 'ipc', + ], + env: Object.assign({}, process.env, { + DEBUG_COLORS: 1 // without this settings, colors won't be shown + }), +}); + +worker.stderr.pipe(process.stderr, { end: false }); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + - Josh Junon + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> +Copyright (c) 2018-2021 Josh Junon + +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. diff --git a/node_modules/debug/node_modules/ms/index.js b/node_modules/debug/node_modules/ms/index.js new file mode 100644 index 0000000..c4498bc --- /dev/null +++ b/node_modules/debug/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * 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' : ''); +} diff --git a/node_modules/debug/node_modules/ms/license.md b/node_modules/debug/node_modules/ms/license.md new file mode 100644 index 0000000..69b6125 --- /dev/null +++ b/node_modules/debug/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +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. diff --git a/node_modules/debug/node_modules/ms/package.json b/node_modules/debug/node_modules/ms/package.json new file mode 100644 index 0000000..eea666e --- /dev/null +++ b/node_modules/debug/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.1.2", + "description": "Tiny millisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" + } +} diff --git a/node_modules/debug/node_modules/ms/readme.md b/node_modules/debug/node_modules/ms/readme.md new file mode 100644 index 0000000..9a1996b --- /dev/null +++ b/node_modules/debug/node_modules/ms/readme.md @@ -0,0 +1,60 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json new file mode 100644 index 0000000..cb67103 --- /dev/null +++ b/node_modules/debug/package.json @@ -0,0 +1,60 @@ +{ + "name": "debug", + "version": "4.3.5", + "repository": { + "type": "git", + "url": "git://github.com/debug-js/debug.git" + }, + "description": "Lightweight debugging utility for Node.js and the browser", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "Josh Junon (https://github.com/qix-)", + "contributors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "istanbul cover _mocha -- test.js test.node.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "2.1.2" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "sinon": "^14.0.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + } +} diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js new file mode 100644 index 0000000..cd0fc35 --- /dev/null +++ b/node_modules/debug/src/browser.js @@ -0,0 +1,269 @@ +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * 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.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * 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 = require('./common')(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; + } +}; diff --git a/node_modules/debug/src/common.js b/node_modules/debug/src/common.js new file mode 100644 index 0000000..e3291b2 --- /dev/null +++ b/node_modules/debug/src/common.js @@ -0,0 +1,274 @@ + +/** + * 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 = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * 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 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; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + 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 '%'; + } + 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.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + 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.namespaces = 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.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * 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; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; diff --git a/node_modules/debug/src/index.js b/node_modules/debug/src/index.js new file mode 100644 index 0000000..bf4c57f --- /dev/null +++ b/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * 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 = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/debug/src/node.js b/node_modules/debug/src/node.js new file mode 100644 index 0000000..715560a --- /dev/null +++ b/node_modules/debug/src/node.js @@ -0,0 +1,263 @@ +/** + * Module dependencies. + */ + +const tty = require('tty'); +const util = require('util'); + +/** + * 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; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); + +/** + * 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 = require('supports-color'); + + 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.formatWithOptions()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...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 = require('./common')(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) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; + +/** + * 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); +}; diff --git a/node_modules/define-data-property/.eslintrc b/node_modules/define-data-property/.eslintrc new file mode 100644 index 0000000..75443e8 --- /dev/null +++ b/node_modules/define-data-property/.eslintrc @@ -0,0 +1,24 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": 0, + "id-length": 0, + "new-cap": ["error", { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "max-lines-per-function": "off", + }, + }, + ], +} diff --git a/node_modules/define-data-property/.github/FUNDING.yml b/node_modules/define-data-property/.github/FUNDING.yml new file mode 100644 index 0000000..3e17725 --- /dev/null +++ b/node_modules/define-data-property/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/define-data-property +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/define-data-property/.nycrc b/node_modules/define-data-property/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/node_modules/define-data-property/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/define-data-property/CHANGELOG.md b/node_modules/define-data-property/CHANGELOG.md new file mode 100644 index 0000000..4eed75e --- /dev/null +++ b/node_modules/define-data-property/CHANGELOG.md @@ -0,0 +1,70 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.4](https://github.com/ljharb/define-data-property/compare/v1.1.3...v1.1.4) - 2024-02-13 + +### Commits + +- [Refactor] use `es-define-property` [`90f2f4c`](https://github.com/ljharb/define-data-property/commit/90f2f4cc20298401e71c28e1e08888db12021453) +- [Dev Deps] update `@types/object.getownpropertydescriptors` [`cd929d9`](https://github.com/ljharb/define-data-property/commit/cd929d9a04f5f2fdcfa9d5be140940b91a083153) + +## [v1.1.3](https://github.com/ljharb/define-data-property/compare/v1.1.2...v1.1.3) - 2024-02-12 + +### Commits + +- [types] hand-write d.ts instead of emitting it [`0cbc988`](https://github.com/ljharb/define-data-property/commit/0cbc988203c105f2d97948327c7167ebd33bd318) +- [meta] simplify `exports` [`690781e`](https://github.com/ljharb/define-data-property/commit/690781eed28bbf2d6766237efda0ba6dd591609e) +- [Dev Deps] update `hasown`; clean up DT packages [`6cdfd1c`](https://github.com/ljharb/define-data-property/commit/6cdfd1cb2d91d791bfd18cda5d5cab232fd5d8fc) +- [actions] cleanup [`3142bc6`](https://github.com/ljharb/define-data-property/commit/3142bc6a4bc406a51f5b04f31e98562a27f35ffd) +- [meta] add `funding` [`8474423`](https://github.com/ljharb/define-data-property/commit/847442391a79779af3e0f1bf0b5bb923552b7804) +- [Deps] update `get-intrinsic` [`3e9be00`](https://github.com/ljharb/define-data-property/commit/3e9be00e07784ba34e7c77d8bc0fdbc832ad61de) + +## [v1.1.2](https://github.com/ljharb/define-data-property/compare/v1.1.1...v1.1.2) - 2024-02-05 + +### Commits + +- [Dev Deps] update @types packages, `object-inspect`, `tape`, `typescript` [`df41bf8`](https://github.com/ljharb/define-data-property/commit/df41bf84ca3456be6226055caab44e38e3a7fd2f) +- [Dev Deps] update DT packages, `aud`, `npmignore`, `tape`, typescript` [`fab0e4e`](https://github.com/ljharb/define-data-property/commit/fab0e4ec709ee02b79f42d6db3ee5f26e0a34b8a) +- [Dev Deps] use `hasown` instead of `has` [`aa51ef9`](https://github.com/ljharb/define-data-property/commit/aa51ef93f6403d49d9bb72a807bcdb6e418978c0) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`d89be50`](https://github.com/ljharb/define-data-property/commit/d89be50571175888d391238605122679f7e65ffc) +- [Deps] update `has-property-descriptors` [`7af887c`](https://github.com/ljharb/define-data-property/commit/7af887c9083b59b195b0079e04815cfed9fcee2b) +- [Deps] update `get-intrinsic` [`bb8728e`](https://github.com/ljharb/define-data-property/commit/bb8728ec42cd998505a7157ae24853a560c20646) + +## [v1.1.1](https://github.com/ljharb/define-data-property/compare/v1.1.0...v1.1.1) - 2023-10-12 + +### Commits + +- [Tests] fix tests in ES3 engines [`5c6920e`](https://github.com/ljharb/define-data-property/commit/5c6920edd1f52f675b02f417e539c28135b43f94) +- [Dev Deps] update `@types/es-value-fixtures`, `@types/for-each`, `@types/gopd`, `@types/has-property-descriptors`, `tape`, `typescript` [`7d82dfc`](https://github.com/ljharb/define-data-property/commit/7d82dfc20f778b4465bba06335dd53f6f431aea3) +- [Fix] IE 8 has a broken `Object.defineProperty` [`0672e1a`](https://github.com/ljharb/define-data-property/commit/0672e1af2a9fcc787e7c23b96dea60d290df5548) +- [meta] emit types on prepack [`73acb1f`](https://github.com/ljharb/define-data-property/commit/73acb1f903c21b314ec7156bf10f73c7910530c0) +- [Dev Deps] update `tape`, `typescript` [`9489a77`](https://github.com/ljharb/define-data-property/commit/9489a7738bf2ecf0ac71d5b78ec4ca6ad7ba0142) + +## [v1.1.0](https://github.com/ljharb/define-data-property/compare/v1.0.1...v1.1.0) - 2023-09-13 + +### Commits + +- [New] add `loose` arg [`155235a`](https://github.com/ljharb/define-data-property/commit/155235a4c4d7741f6de01cd87c99599a56654b72) +- [New] allow `null` to be passed for the non* args [`7d2fa5f`](https://github.com/ljharb/define-data-property/commit/7d2fa5f06be0392736c13b126f7cd38979f34792) + +## [v1.0.1](https://github.com/ljharb/define-data-property/compare/v1.0.0...v1.0.1) - 2023-09-12 + +### Commits + +- [meta] add TS types [`43d763c`](https://github.com/ljharb/define-data-property/commit/43d763c6c883f652de1c9c02ef6216ee507ffa69) +- [Dev Deps] update `@types/tape`, `typescript` [`f444985`](https://github.com/ljharb/define-data-property/commit/f444985811c36f3e6448a03ad2f9b7898917f4c7) +- [meta] add `safe-publish-latest`, [`172bb10`](https://github.com/ljharb/define-data-property/commit/172bb10890896ebb160e64398f6ee55760107bee) + +## v1.0.0 - 2023-09-12 + +### Commits + +- Initial implementation, tests, readme [`5b43d6b`](https://github.com/ljharb/define-data-property/commit/5b43d6b44e675a904810467a7d4e0adb7efc3196) +- Initial commit [`35e577a`](https://github.com/ljharb/define-data-property/commit/35e577a6ba59a98befa97776d70d90f3bea9009d) +- npm init [`82a0a04`](https://github.com/ljharb/define-data-property/commit/82a0a04a321ca7de220af02d41e2745e8a9962ed) +- Only apps should have lockfiles [`96df244`](https://github.com/ljharb/define-data-property/commit/96df244a3c6f426f9a2437be825d1c6f5dd7158e) +- [meta] use `npmignore` to autogenerate an npmignore file [`a87ff18`](https://github.com/ljharb/define-data-property/commit/a87ff18cb79e14c2eb5720486c4759fd9a189375) diff --git a/node_modules/define-data-property/LICENSE b/node_modules/define-data-property/LICENSE new file mode 100644 index 0000000..b4213ac --- /dev/null +++ b/node_modules/define-data-property/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Jordan Harband + +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. diff --git a/node_modules/define-data-property/README.md b/node_modules/define-data-property/README.md new file mode 100644 index 0000000..f2304da --- /dev/null +++ b/node_modules/define-data-property/README.md @@ -0,0 +1,67 @@ +# define-data-property [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Define a data property on an object. Will fall back to assignment in an engine without descriptors. + +The three `non*` argument can also be passed `null`, which will use the existing state if available. + +The `loose` argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment. + +## Usage + +```javascript +var defineDataProperty = require('define-data-property'); +var assert = require('assert'); + +var obj = {}; +defineDataProperty(obj, 'key', 'value'); +defineDataProperty( + obj, + 'key2', + 'value', + true, // nonEnumerable, optional + false, // nonWritable, optional + true, // nonConfigurable, optional + false // loose, optional +); + +assert.deepEqual( + Object.getOwnPropertyDescriptors(obj), + { + key: { + configurable: true, + enumerable: true, + value: 'value', + writable: true, + }, + key2: { + configurable: false, + enumerable: false, + value: 'value', + writable: true, + }, + } +); +``` + +[package-url]: https://npmjs.org/package/define-data-property +[npm-version-svg]: https://versionbadg.es/ljharb/define-data-property.svg +[deps-svg]: https://david-dm.org/ljharb/define-data-property.svg +[deps-url]: https://david-dm.org/ljharb/define-data-property +[dev-deps-svg]: https://david-dm.org/ljharb/define-data-property/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/define-data-property#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/define-data-property.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/define-data-property.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/define-data-property.svg +[downloads-url]: https://npm-stat.com/charts.html?package=define-data-property +[codecov-image]: https://codecov.io/gh/ljharb/define-data-property/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/define-data-property/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-data-property +[actions-url]: https://github.com/ljharb/define-data-property/actions diff --git a/node_modules/define-data-property/index.d.ts b/node_modules/define-data-property/index.d.ts new file mode 100644 index 0000000..b56a77d --- /dev/null +++ b/node_modules/define-data-property/index.d.ts @@ -0,0 +1,12 @@ + +declare function defineDataProperty( + obj: Record, + property: keyof typeof obj, + value: typeof obj[typeof property], + nonEnumerable?: boolean | null, + nonWritable?: boolean | null, + nonConfigurable?: boolean | null, + loose?: boolean +): void; + +export = defineDataProperty; \ No newline at end of file diff --git a/node_modules/define-data-property/index.js b/node_modules/define-data-property/index.js new file mode 100644 index 0000000..e1a38c0 --- /dev/null +++ b/node_modules/define-data-property/index.js @@ -0,0 +1,56 @@ +'use strict'; + +var $defineProperty = require('es-define-property'); + +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); + +var gopd = require('gopd'); + +/** @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.'); + } +}; diff --git a/node_modules/define-data-property/package.json b/node_modules/define-data-property/package.json new file mode 100644 index 0000000..eec4097 --- /dev/null +++ b/node_modules/define-data-property/package.json @@ -0,0 +1,106 @@ +{ + "name": "define-data-property", + "version": "1.1.4", + "description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.", + "main": "index.js", + "types": "./index.d.ts", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "tsc": "tsc -p .", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "npm run tsc", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/define-data-property.git" + }, + "keywords": [ + "define", + "data", + "property", + "object", + "accessor", + "javascript", + "ecmascript", + "enumerable", + "configurable", + "writable" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/define-data-property/issues" + }, + "homepage": "https://github.com/ljharb/define-data-property#readme", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/call-bind": "^1.0.5", + "@types/define-properties": "^1.1.5", + "@types/es-value-fixtures": "^1.4.4", + "@types/for-each": "^0.3.3", + "@types/get-intrinsic": "^1.2.2", + "@types/gopd": "^1.0.3", + "@types/has-property-descriptors": "^1.0.3", + "@types/object-inspect": "^1.8.4", + "@types/object.getownpropertydescriptors": "^2.1.4", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "hasown": "^2.0.1", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "object.getownpropertydescriptors": "^2.1.7", + "reflect.ownkeys": "^1.1.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "types/reflect.ownkeys" + ] + } +} diff --git a/node_modules/define-data-property/test/index.js b/node_modules/define-data-property/test/index.js new file mode 100644 index 0000000..68204c6 --- /dev/null +++ b/node_modules/define-data-property/test/index.js @@ -0,0 +1,392 @@ +'use strict'; + +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var hasOwn = require('hasown'); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var getOwnPropertyDescriptors = require('object.getownpropertydescriptors'); +var ownKeys = require('reflect.ownkeys'); + +var defineDataProperty = require('../'); + +test('defineDataProperty', function (t) { + t.test('argument validation', function (st) { + forEach(v.primitives, function (nonObject) { + st['throws']( + // @ts-expect-error + function () { defineDataProperty(nonObject, 'key', 'value'); }, + TypeError, + 'throws on non-object input: ' + inspect(nonObject) + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, nonPropertyKey, 'value'); }, + TypeError, + 'throws on non-PropertyKey input: ' + inspect(nonPropertyKey) + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + if (nonBoolean !== null) { + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, 'key', 'value', nonBoolean); }, + TypeError, + 'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean) + ); + + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); }, + TypeError, + 'throws on non-boolean nonWritable: ' + inspect(nonBoolean) + ); + + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); }, + TypeError, + 'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean) + ); + } + }); + + st.end(); + }); + + t.test('normal data property', function (st) { + /** @type {Record} */ + var obj = { existing: 'existing property' }; + st.ok(hasOwn(obj, 'existing'), 'has initial own property'); + st.equal(obj.existing, 'existing property', 'has expected initial value'); + + var res = defineDataProperty(obj, 'added', 'added property'); + st.equal(res, void undefined, 'returns `undefined`'); + st.ok(hasOwn(obj, 'added'), 'has expected own property'); + st.equal(obj.added, 'added property', 'has expected value'); + + defineDataProperty(obj, 'existing', 'new value'); + st.ok(hasOwn(obj, 'existing'), 'still has expected own property'); + st.equal(obj.existing, 'new value', 'has new expected value'); + + defineDataProperty(obj, 'explicit1', 'new value', false); + st.ok(hasOwn(obj, 'explicit1'), 'has expected own property (explicit enumerable)'); + st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)'); + + defineDataProperty(obj, 'explicit2', 'new value', false, false); + st.ok(hasOwn(obj, 'explicit2'), 'has expected own property (explicit writable)'); + st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)'); + + defineDataProperty(obj, 'explicit3', 'new value', false, false, false); + st.ok(hasOwn(obj, 'explicit3'), 'has expected own property (explicit configurable)'); + st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)'); + + st.end(); + }); + + t.test('loose mode', { skip: !hasPropertyDescriptors }, function (st) { + var obj = { existing: 'existing property' }; + + defineDataProperty(obj, 'added', 'added value 1', true, null, null, true); + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + added: { + configurable: true, + enumerable: !hasPropertyDescriptors, + value: 'added value 1', + writable: true + } + }, + 'in loose mode, obj still adds property 1' + ); + + defineDataProperty(obj, 'added', 'added value 2', false, true, null, true); + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + added: { + configurable: true, + enumerable: true, + value: 'added value 2', + writable: !hasPropertyDescriptors + } + }, + 'in loose mode, obj still adds property 2' + ); + + defineDataProperty(obj, 'added', 'added value 3', false, false, true, true); + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + added: { + configurable: !hasPropertyDescriptors, + enumerable: true, + value: 'added value 3', + writable: true + } + }, + 'in loose mode, obj still adds property 3' + ); + + st.end(); + }); + + t.test('non-normal data property, ES3', { skip: hasPropertyDescriptors }, function (st) { + /** @type {Record} */ + var obj = { existing: 'existing property' }; + + st['throws']( + function () { defineDataProperty(obj, 'added', 'added value', true); }, + SyntaxError, + 'nonEnumerable throws a Syntax Error' + ); + + st['throws']( + function () { defineDataProperty(obj, 'added', 'added value', false, true); }, + SyntaxError, + 'nonWritable throws a Syntax Error' + ); + + st['throws']( + function () { defineDataProperty(obj, 'added', 'added value', false, false, true); }, + SyntaxError, + 'nonWritable throws a Syntax Error' + ); + + st.deepEqual( + ownKeys(obj), + ['existing'], + 'obj still has expected keys' + ); + st.equal(obj.existing, 'existing property', 'obj still has expected values'); + + st.end(); + }); + + t.test('new non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + /** @type {Record} */ + var obj = { existing: 'existing property' }; + + defineDataProperty(obj, 'nonEnum', null, true); + defineDataProperty(obj, 'nonWrit', null, false, true); + defineDataProperty(obj, 'nonConf', null, false, false, true); + + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + nonEnum: { + configurable: true, + enumerable: false, + value: null, + writable: true + }, + nonWrit: { + configurable: true, + enumerable: true, + value: null, + writable: false + }, + nonConf: { + configurable: false, + enumerable: true, + value: null, + writable: true + } + }, + 'obj has expected property descriptors' + ); + + st.end(); + }); + + t.test('existing non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + // test case changing an existing non-normal property + + /** @type {Record} */ + var obj = {}; + Object.defineProperty(obj, 'nonEnum', { configurable: true, enumerable: false, value: null, writable: true }); + Object.defineProperty(obj, 'nonWrit', { configurable: true, enumerable: true, value: null, writable: false }); + Object.defineProperty(obj, 'nonConf', { configurable: false, enumerable: true, value: null, writable: true }); + + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + nonEnum: { + configurable: true, + enumerable: false, + value: null, + writable: true + }, + nonWrit: { + configurable: true, + enumerable: true, + value: null, + writable: false + }, + nonConf: { + configurable: false, + enumerable: true, + value: null, + writable: true + } + }, + 'obj initially has expected property descriptors' + ); + + defineDataProperty(obj, 'nonEnum', 'new value', false); + defineDataProperty(obj, 'nonWrit', 'new value', false, false); + st['throws']( + function () { defineDataProperty(obj, 'nonConf', 'new value', false, false, false); }, + TypeError, + 'can not alter a nonconfigurable property' + ); + + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + nonEnum: { + configurable: true, + enumerable: true, + value: 'new value', + writable: true + }, + nonWrit: { + configurable: true, + enumerable: true, + value: 'new value', + writable: true + }, + nonConf: { + configurable: false, + enumerable: true, + value: null, + writable: true + } + }, + 'obj ends up with expected property descriptors' + ); + + st.end(); + }); + + t.test('frozen object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + var frozen = Object.freeze({ existing: true }); + + st['throws']( + function () { defineDataProperty(frozen, 'existing', 'new value'); }, + TypeError, + 'frozen object can not modify an existing property' + ); + + st['throws']( + function () { defineDataProperty(frozen, 'new', 'new property'); }, + TypeError, + 'frozen object can not add a new property' + ); + + st.end(); + }); + + t.test('sealed object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + var sealed = Object.seal({ existing: true }); + st.deepEqual( + Object.getOwnPropertyDescriptor(sealed, 'existing'), + { + configurable: false, + enumerable: true, + value: true, + writable: true + }, + 'existing value on sealed object has expected descriptor' + ); + + defineDataProperty(sealed, 'existing', 'new value'); + + st.deepEqual( + Object.getOwnPropertyDescriptor(sealed, 'existing'), + { + configurable: false, + enumerable: true, + value: 'new value', + writable: true + }, + 'existing value on sealed object has changed descriptor' + ); + + st['throws']( + function () { defineDataProperty(sealed, 'new', 'new property'); }, + TypeError, + 'sealed object can not add a new property' + ); + + st.end(); + }); + + t.test('nonextensible object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + var nonExt = Object.preventExtensions({ existing: true }); + + st.deepEqual( + Object.getOwnPropertyDescriptor(nonExt, 'existing'), + { + configurable: true, + enumerable: true, + value: true, + writable: true + }, + 'existing value on non-extensible object has expected descriptor' + ); + + defineDataProperty(nonExt, 'existing', 'new value', true); + + st.deepEqual( + Object.getOwnPropertyDescriptor(nonExt, 'existing'), + { + configurable: true, + enumerable: false, + value: 'new value', + writable: true + }, + 'existing value on non-extensible object has changed descriptor' + ); + + st['throws']( + function () { defineDataProperty(nonExt, 'new', 'new property'); }, + TypeError, + 'non-extensible object can not add a new property' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/define-data-property/tsconfig.json b/node_modules/define-data-property/tsconfig.json new file mode 100644 index 0000000..69f060d --- /dev/null +++ b/node_modules/define-data-property/tsconfig.json @@ -0,0 +1,59 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + + /* Completeness */ + // "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage" + ] +} diff --git a/node_modules/dependency-graph/CHANGELOG.md b/node_modules/dependency-graph/CHANGELOG.md new file mode 100755 index 0000000..5e6c4d9 --- /dev/null +++ b/node_modules/dependency-graph/CHANGELOG.md @@ -0,0 +1,82 @@ +# Dependency Graph Changelog + +## 0.11.0 (March 5, 2021) + +- Add `entryNodes` method that returns the nodes that nothing depends on - thanks [amcdnl](https://github.com/amcdnl)! + +## 0.10.0 (January 9, 2021) + +- Add `directDependenciesOf` and `directDependantsOf` methods for retrieving direct dependency information. (Fixes #40) +- Add aliases `dependentsOf` and `directDependentsOf`. + +## 0.9.0 (February 10, 2020) + +- Rewrite the topological sort DFS to be more efficient (and work!) on large graphs. + - No longer uses recursion to avoid stack overflows with large/deep graphs + - No longer is accidentally `O(N^2)` (thanks [willtennien](https://github.com/willtennien) for pointing this out!) + +## 0.8.1 (December 3, 2019) + +- Ensure all nodes are included in overallOrder when cycles are allowed. (Fixes #33) + +## 0.8.0 (December 11, 2018) + +- Add a `DepGraphCycleError` with cyclePath property - thanks [jhugman](https://github.com/jhugman)! + +## 0.7.2 (August 30, 2018) + +- Make constructor parameter optional in Typescript definition. (Fixes #26) + +## 0.7.1 (June 5, 2018) + +- Fix Typescript definition to include the new constructor arguments added in `0.7.0` - thanks [tbranyen](https://github.com/tbranyen)! + +## 0.7.0 (January 17, 2018) + +- Allow circular dependencies by passing in `{circular: true}` into the constructor - thanks [tbranyen](https://github.com/tbranyen)! + +## 0.6.0 (October 22, 2017) + +- Add a `size` method that will return the number of nodes in the graph. +- Add a `clone` method that will clone the graph. Any custom node data will only be shallow-copied. (Fixes #14) + +## 0.5.2 (October 22, 2017) + +- Add missing parameter in TypeScript definition. (Fixes #19) + +## 0.5.1 (October 7, 2017) + +- Now exposes Typescript type definition - thanks [vangorra](https://github.com/vangorra)! + +## 0.5.0 (April 26, 2016) + +- Add optional data parameter for the addNode method. (Fixes #12) +- Add methods getNodeData and setNodeData to manipulate the data associated with a node name. (Fixes #12) +- Change the hasNode method to be able to cope with falsy node data. (Fixes #12) + +## 0.4.1 (Sept 3, 2015) + +- Check all nodes for potential cycles when calculating overall order. (Fixes #8) + +## 0.4.0 (Aug 1, 2015) + +- Better error messages + - When a cycle is detected, the error message will now include the cycle in it. E.g `Dependency Cycle Found: a -> b -> c -> a` (Fixes #7) + - When calling `addDependency` if one of the nodes does not exist, the error will say which one it was (instead of saying that "one" of the two nodes did not exist and making you manually determine which one) +- Calling `overallOrder` on an empty graph will no longer throw an error about a dependency cycle. It will return an empty array. + +## 0.3.0 (July 24, 2015) + +- Fix issue where if you call `addNode` twice with the same name, it would clear all edges for that node. Now it will do nothing if a node with the specified name already exists. (Fixes #3) + +## 0.2.1 (July 3, 2015) + +- Fixed removeNode leaving references in outgoingEdges and reference to non-existent var edges - thanks [juhoha](https://github.com/juhoha)! (Fixes #2) + +## 0.2.0 (May 1, 2015) + +- Removed dependency on Underscore - thanks [myndzi](https://github.com/myndzi)! (Fixes #1) + +## 0.1.0 (May 18, 2013) + +- Initial Release - extracted out of asset-smasher diff --git a/node_modules/dependency-graph/LICENSE b/node_modules/dependency-graph/LICENSE new file mode 100755 index 0000000..6ebe5b6 --- /dev/null +++ b/node_modules/dependency-graph/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2020 by Jim Riecken + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/dependency-graph/README.md b/node_modules/dependency-graph/README.md new file mode 100755 index 0000000..763aaf8 --- /dev/null +++ b/node_modules/dependency-graph/README.md @@ -0,0 +1,78 @@ +# Dependency Graph + +Simple dependency graph + +## Overview + +This is a simple dependency graph useful for determining the order to do a list of things that depend on certain items being done before they are. + +To use, `npm install dependency-graph` and then `require('dependency-graph').DepGraph` + +## API + +### DepGraph + +Nodes in the graph are just simple strings with optional data associated with them. + + - `addNode(name, data)` - add a node in the graph with optional data. If `data` is not given, `name` will be used as data + - `removeNode(name)` - remove a node from the graph + - `hasNode(name)` - check if a node exists in the graph + - `size()` - return the number of nodes in the graph + - `getNodeData(name)` - get the data associated with a node (will throw an `Error` if the node does not exist) + - `setNodeData(name, data)` - set the data for an existing node (will throw an `Error` if the node does not exist) + - `addDependency(from, to)` - add a dependency between two nodes (will throw an `Error` if one of the nodes does not exist) + - `removeDependency(from, to)` - remove a dependency between two nodes + - `clone()` - return a clone of the graph. Any data attached to the nodes will only be *shallow-copied* + - `dependenciesOf(name, leavesOnly)` - get an array containing the nodes that the specified node depends on (transitively). If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned in the array. + - `dependantsOf(name, leavesOnly)` (aliased as `dependentsOf`) - get an array containing the nodes that depend on the specified node (transitively). If `leavesOnly` is true, only nodes that do not have any dependants will be returned in the array. + - `directDependenciesOf(name)` - get an array containing the direct dependencies of the specified node + - `directDependantsOf(name)` (aliased as `directDependentsOf`) - get an array containing the nodes that directly depend on the specified node + - `overallOrder(leavesOnly)` - construct the overall processing order for the dependency graph. If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned. + - `entryNodes()` - array of nodes that have no dependants (i.e. nothing depends on them). + +Dependency Cycles are detected when running `dependenciesOf`, `dependantsOf`, and `overallOrder` and if one is found, a `DepGraphCycleError` will be thrown that includes what the cycle was in the message as well as the `cyclePath` property: e.g. `Dependency Cycle Found: a -> b -> c -> a`. If you wish to silence this error, pass `circular: true` when instantiating `DepGraph` (more below). + +## Examples + + var DepGraph = require('dependency-graph').DepGraph; + + var graph = new DepGraph(); + graph.addNode('a'); + graph.addNode('b'); + graph.addNode('c'); + + graph.size() // 3 + + graph.addDependency('a', 'b'); + graph.addDependency('b', 'c'); + + graph.dependenciesOf('a'); // ['c', 'b'] + graph.dependenciesOf('b'); // ['c'] + graph.dependantsOf('c'); // ['a', 'b'] + + graph.overallOrder(); // ['c', 'b', 'a'] + graph.overallOrder(true); // ['c'] + graph.entryNodes(); // ['a'] + + graph.addNode('d', 'data'); + + graph.getNodeData('d'); // 'data' + + graph.setNodeData('d', 'newData'); + + graph.getNodeData('d'); // 'newData' + + var circularGraph = new DepGraph({ circular: true }); + + circularGraph.addNode('a'); + circularGraph.addNode('b'); + circularGraph.addNode('c'); + circularGraph.addNode('d'); + + circularGraph.addDependency('a', 'b'); + circularGraph.addDependency('b', 'c'); // b depends on c + circularGraph.addDependency('c', 'a'); // c depends on a, which depends on b + circularGraph.addDependency('d', 'a'); + + circularGraph.dependenciesOf('b'); // ['a', 'c'] + circularGraph.overallOrder(); // ['c', 'b', 'a', 'd'] diff --git a/node_modules/dependency-graph/lib/dep_graph.js b/node_modules/dependency-graph/lib/dep_graph.js new file mode 100755 index 0000000..a64f801 --- /dev/null +++ b/node_modules/dependency-graph/lib/dep_graph.js @@ -0,0 +1,364 @@ +/** + * A simple dependency graph + */ + +/** + * Helper for creating a Topological Sort using Depth-First-Search on a set of edges. + * + * Detects cycles and throws an Error if one is detected (unless the "circular" + * parameter is "true" in which case it ignores them). + * + * @param edges The set of edges to DFS through + * @param leavesOnly Whether to only return "leaf" nodes (ones who have no edges) + * @param result An array in which the results will be populated + * @param circular A boolean to allow circular dependencies + */ +function createDFS(edges, leavesOnly, result, circular) { + var visited = {}; + return function (start) { + if (visited[start]) { + return; + } + var inCurrentPath = {}; + var currentPath = []; + var todo = []; // used as a stack + todo.push({ node: start, processed: false }); + while (todo.length > 0) { + var current = todo[todo.length - 1]; // peek at the todo stack + var processed = current.processed; + var node = current.node; + if (!processed) { + // Haven't visited edges yet (visiting phase) + if (visited[node]) { + todo.pop(); + continue; + } else if (inCurrentPath[node]) { + // It's not a DAG + if (circular) { + todo.pop(); + // If we're tolerating cycles, don't revisit the node + continue; + } + currentPath.push(node); + throw new DepGraphCycleError(currentPath); + } + + inCurrentPath[node] = true; + currentPath.push(node); + var nodeEdges = edges[node]; + // (push edges onto the todo stack in reverse order to be order-compatible with the old DFS implementation) + for (var i = nodeEdges.length - 1; i >= 0; i--) { + todo.push({ node: nodeEdges[i], processed: false }); + } + current.processed = true; + } else { + // Have visited edges (stack unrolling phase) + todo.pop(); + currentPath.pop(); + inCurrentPath[node] = false; + visited[node] = true; + if (!leavesOnly || edges[node].length === 0) { + result.push(node); + } + } + } + }; +} + +/** + * Simple Dependency Graph + */ +var DepGraph = (exports.DepGraph = function DepGraph(opts) { + this.nodes = {}; // Node -> Node/Data (treated like a Set) + this.outgoingEdges = {}; // Node -> [Dependency Node] + this.incomingEdges = {}; // Node -> [Dependant Node] + this.circular = opts && !!opts.circular; // Allows circular deps +}); +DepGraph.prototype = { + /** + * The number of nodes in the graph. + */ + size: function () { + return Object.keys(this.nodes).length; + }, + /** + * Add a node to the dependency graph. If a node already exists, this method will do nothing. + */ + addNode: function (node, data) { + if (!this.hasNode(node)) { + // Checking the arguments length allows the user to add a node with undefined data + if (arguments.length === 2) { + this.nodes[node] = data; + } else { + this.nodes[node] = node; + } + this.outgoingEdges[node] = []; + this.incomingEdges[node] = []; + } + }, + /** + * Remove a node from the dependency graph. If a node does not exist, this method will do nothing. + */ + removeNode: function (node) { + if (this.hasNode(node)) { + delete this.nodes[node]; + delete this.outgoingEdges[node]; + delete this.incomingEdges[node]; + [this.incomingEdges, this.outgoingEdges].forEach(function (edgeList) { + Object.keys(edgeList).forEach(function (key) { + var idx = edgeList[key].indexOf(node); + if (idx >= 0) { + edgeList[key].splice(idx, 1); + } + }, this); + }); + } + }, + /** + * Check if a node exists in the graph + */ + hasNode: function (node) { + return this.nodes.hasOwnProperty(node); + }, + /** + * Get the data associated with a node name + */ + getNodeData: function (node) { + if (this.hasNode(node)) { + return this.nodes[node]; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Set the associated data for a given node name. If the node does not exist, this method will throw an error + */ + setNodeData: function (node, data) { + if (this.hasNode(node)) { + this.nodes[node] = data; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Add a dependency between two nodes. If either of the nodes does not exist, + * an Error will be thrown. + */ + addDependency: function (from, to) { + if (!this.hasNode(from)) { + throw new Error("Node does not exist: " + from); + } + if (!this.hasNode(to)) { + throw new Error("Node does not exist: " + to); + } + if (this.outgoingEdges[from].indexOf(to) === -1) { + this.outgoingEdges[from].push(to); + } + if (this.incomingEdges[to].indexOf(from) === -1) { + this.incomingEdges[to].push(from); + } + return true; + }, + /** + * Remove a dependency between two nodes. + */ + removeDependency: function (from, to) { + var idx; + if (this.hasNode(from)) { + idx = this.outgoingEdges[from].indexOf(to); + if (idx >= 0) { + this.outgoingEdges[from].splice(idx, 1); + } + } + + if (this.hasNode(to)) { + idx = this.incomingEdges[to].indexOf(from); + if (idx >= 0) { + this.incomingEdges[to].splice(idx, 1); + } + } + }, + /** + * Return a clone of the dependency graph. If any custom data is attached + * to the nodes, it will only be shallow copied. + */ + clone: function () { + var source = this; + var result = new DepGraph(); + var keys = Object.keys(source.nodes); + keys.forEach(function (n) { + result.nodes[n] = source.nodes[n]; + result.outgoingEdges[n] = source.outgoingEdges[n].slice(0); + result.incomingEdges[n] = source.incomingEdges[n].slice(0); + }); + return result; + }, + /** + * Get an array containing the direct dependencies of the specified node. + * + * Throws an Error if the specified node does not exist. + */ + directDependenciesOf: function (node) { + if (this.hasNode(node)) { + return this.outgoingEdges[node].slice(0); + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Get an array containing the nodes that directly depend on the specified node. + * + * Throws an Error if the specified node does not exist. + */ + directDependantsOf: function (node) { + if (this.hasNode(node)) { + return this.incomingEdges[node].slice(0); + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Get an array containing the nodes that the specified node depends on (transitively). + * + * Throws an Error if the graph has a cycle, or the specified node does not exist. + * + * If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned + * in the array. + */ + dependenciesOf: function (node, leavesOnly) { + if (this.hasNode(node)) { + var result = []; + var DFS = createDFS( + this.outgoingEdges, + leavesOnly, + result, + this.circular + ); + DFS(node); + var idx = result.indexOf(node); + if (idx >= 0) { + result.splice(idx, 1); + } + return result; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * get an array containing the nodes that depend on the specified node (transitively). + * + * Throws an Error if the graph has a cycle, or the specified node does not exist. + * + * If `leavesOnly` is true, only nodes that do not have any dependants will be returned in the array. + */ + dependantsOf: function (node, leavesOnly) { + if (this.hasNode(node)) { + var result = []; + var DFS = createDFS( + this.incomingEdges, + leavesOnly, + result, + this.circular + ); + DFS(node); + var idx = result.indexOf(node); + if (idx >= 0) { + result.splice(idx, 1); + } + return result; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Construct the overall processing order for the dependency graph. + * + * Throws an Error if the graph has a cycle. + * + * If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned. + */ + overallOrder: function (leavesOnly) { + var self = this; + var result = []; + var keys = Object.keys(this.nodes); + if (keys.length === 0) { + return result; // Empty graph + } else { + if (!this.circular) { + // Look for cycles - we run the DFS starting at all the nodes in case there + // are several disconnected subgraphs inside this dependency graph. + var CycleDFS = createDFS(this.outgoingEdges, false, [], this.circular); + keys.forEach(function (n) { + CycleDFS(n); + }); + } + + var DFS = createDFS( + this.outgoingEdges, + leavesOnly, + result, + this.circular + ); + // Find all potential starting points (nodes with nothing depending on them) an + // run a DFS starting at these points to get the order + keys + .filter(function (node) { + return self.incomingEdges[node].length === 0; + }) + .forEach(function (n) { + DFS(n); + }); + + // If we're allowing cycles - we need to run the DFS against any remaining + // nodes that did not end up in the initial result (as they are part of a + // subgraph that does not have a clear starting point) + if (this.circular) { + keys + .filter(function (node) { + return result.indexOf(node) === -1; + }) + .forEach(function (n) { + DFS(n); + }); + } + + return result; + } + }, + /** + * Get an array of nodes that have no dependants (i.e. nothing depends on them). + */ + entryNodes: function () { + var self = this; + return Object.keys(this.nodes).filter(function (node) { + return self.incomingEdges[node].length === 0; + }); + } +}; + +// Create some aliases +DepGraph.prototype.directDependentsOf = DepGraph.prototype.directDependantsOf; +DepGraph.prototype.dependentsOf = DepGraph.prototype.dependantsOf; + +/** + * Cycle error, including the path of the cycle. + */ +var DepGraphCycleError = (exports.DepGraphCycleError = function (cyclePath) { + var message = "Dependency Cycle Found: " + cyclePath.join(" -> "); + var instance = new Error(message); + instance.cyclePath = cyclePath; + Object.setPrototypeOf(instance, Object.getPrototypeOf(this)); + if (Error.captureStackTrace) { + Error.captureStackTrace(instance, DepGraphCycleError); + } + return instance; +}); +DepGraphCycleError.prototype = Object.create(Error.prototype, { + constructor: { + value: Error, + enumerable: false, + writable: true, + configurable: true + } +}); +Object.setPrototypeOf(DepGraphCycleError, Error); diff --git a/node_modules/dependency-graph/lib/index.d.ts b/node_modules/dependency-graph/lib/index.d.ts new file mode 100755 index 0000000..6ed8de5 --- /dev/null +++ b/node_modules/dependency-graph/lib/index.d.ts @@ -0,0 +1,127 @@ +declare module 'dependency-graph' { + export interface Options { + circular?: boolean; + } + + export class DepGraph { + /** + * Creates an instance of DepGraph with optional Options. + */ + constructor(opts?: Options); + + /** + * The number of nodes in the graph. + */ + size(): number; + + /** + * Add a node in the graph with optional data. If data is not given, name will be used as data. + * @param {string} name + * @param data + */ + addNode(name: string, data?: T): void; + + /** + * Remove a node from the graph. + * @param {string} name + */ + removeNode(name: string): void; + + /** + * Check if a node exists in the graph. + * @param {string} name + */ + hasNode(name: string): boolean; + + /** + * Get the data associated with a node (will throw an Error if the node does not exist). + * @param {string} name + */ + getNodeData(name: string): T; + + /** + * Set the data for an existing node (will throw an Error if the node does not exist). + * @param {string} name + * @param data + */ + setNodeData(name: string, data?: T): void; + + /** + * Add a dependency between two nodes (will throw an Error if one of the nodes does not exist). + * @param {string} from + * @param {string} to + */ + addDependency(from: string, to: string): void; + + /** + * Remove a dependency between two nodes. + * @param {string} from + * @param {string} to + */ + removeDependency(from: string, to: string): void; + + /** + * Return a clone of the dependency graph (If any custom data is attached + * to the nodes, it will only be shallow copied). + */ + clone(): DepGraph; + + /** + * Get an array containing the direct dependency nodes of the specified node. + * @param name + */ + directDependenciesOf(name: string): string[]; + + /** + * Get an array containing the nodes that directly depend on the specified node. + * @param name + */ + directDependantsOf(name: string): string[]; + + /** + * Alias of `directDependantsOf` + * + * @see directDependantsOf + * @param {string} name + */ + directDependentsOf(name: string): string[]; + + /** + * Get an array containing the nodes that the specified node depends on (transitively). If leavesOnly is true, only nodes that do not depend on any other nodes will be returned in the array. + * @param {string} name + * @param {boolean} leavesOnly + */ + dependenciesOf(name: string, leavesOnly?: boolean): string[]; + + /** + * Get an array containing the nodes that depend on the specified node (transitively). If leavesOnly is true, only nodes that do not have any dependants will be returned in the array. + * @param {string} name + * @param {boolean} leavesOnly + */ + dependantsOf(name: string, leavesOnly?: boolean): string[]; + + /** + * Alias of `dependantsOf` + * + * @see dependantsOf + * @param name + * @param leavesOnly + */ + dependentsOf(name: string, leavesOnly?: boolean): string[]; + + /** + * Get an array of nodes that have no dependants (i.e. nothing depends on them). + */ + entryNodes(): string[]; + + /** + * Construct the overall processing order for the dependency graph. If leavesOnly is true, only nodes that do not depend on any other nodes will be returned. + * @param {boolean} leavesOnly + */ + overallOrder(leavesOnly?: boolean): string[]; + } + + export class DepGraphCycleError extends Error { + cyclePath: string[]; + } +} diff --git a/node_modules/dependency-graph/package.json b/node_modules/dependency-graph/package.json new file mode 100755 index 0000000..d965899 --- /dev/null +++ b/node_modules/dependency-graph/package.json @@ -0,0 +1,31 @@ +{ + "name": "dependency-graph", + "description": "Simple dependency graph.", + "version": "0.11.0", + "author": "Jim Riecken ", + "keywords": [ + "dependency", + "graph" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/jriecken/dependency-graph.git" + }, + "bugs": { + "url": "http://github.com/jriecken/dependency-graph/issues" + }, + "main": "./lib/dep_graph.js", + "scripts": { + "test": "jasmine specs/**/*.js" + }, + "dependencies": {}, + "optionalDependencies": {}, + "devDependencies": { + "jasmine": "3.5.0" + }, + "engines": { + "node": ">= 0.6.0" + }, + "types": "./lib/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/dependency-graph/specs/dep_graph_spec.js b/node_modules/dependency-graph/specs/dep_graph_spec.js new file mode 100755 index 0000000..07aa68e --- /dev/null +++ b/node_modules/dependency-graph/specs/dep_graph_spec.js @@ -0,0 +1,542 @@ +var dep_graph = require("../lib/dep_graph"); +var DepGraph = dep_graph.DepGraph; + +describe("DepGraph", function () { + it("should be able to add/remove nodes", function () { + var graph = new DepGraph(); + + graph.addNode("Foo"); + graph.addNode("Bar"); + + expect(graph.hasNode("Foo")).toBeTrue(); + expect(graph.hasNode("Bar")).toBeTrue(); + expect(graph.hasNode("NotThere")).toBeFalse(); + + graph.removeNode("Bar"); + + expect(graph.hasNode("Bar")).toBeFalse(); + }); + + it("should calculate its size", function () { + var graph = new DepGraph(); + + expect(graph.size()).toBe(0); + + graph.addNode("Foo"); + graph.addNode("Bar"); + + expect(graph.size()).toBe(2); + + graph.removeNode("Bar"); + + expect(graph.size()).toBe(1); + }); + + it("should treat the node data parameter as optional and use the node name as data if node data was not given", function () { + var graph = new DepGraph(); + + graph.addNode("Foo"); + + expect(graph.getNodeData("Foo")).toBe("Foo"); + }); + + it("should be able to associate a node name with data on node add", function () { + var graph = new DepGraph(); + + graph.addNode("Foo", "data"); + + expect(graph.getNodeData("Foo")).toBe("data"); + }); + + it("should be able to add undefined as node data", function () { + var graph = new DepGraph(); + + graph.addNode("Foo", undefined); + + expect(graph.getNodeData("Foo")).toBeUndefined(); + }); + + it("should return true when using hasNode with a node which has falsy data", function () { + var graph = new DepGraph(); + + var falsyData = ["", 0, null, undefined, false]; + graph.addNode("Foo"); + + falsyData.forEach(function (data) { + graph.setNodeData("Foo", data); + + expect(graph.hasNode("Foo")).toBeTrue(); + + // Just an extra check to make sure that the saved data is correct + expect(graph.getNodeData("Foo")).toBe(data); + }); + }); + + it("should be able to set data after a node was added", function () { + var graph = new DepGraph(); + + graph.addNode("Foo", "data"); + graph.setNodeData("Foo", "data2"); + + expect(graph.getNodeData("Foo")).toBe("data2"); + }); + + it("should throw an error if we try to set data for a non-existing node", function () { + var graph = new DepGraph(); + + expect(function () { + graph.setNodeData("Foo", "data"); + }).toThrow(new Error("Node does not exist: Foo")); + }); + + it("should throw an error if the node does not exists and we try to get data", function () { + var graph = new DepGraph(); + + expect(function () { + graph.getNodeData("Foo"); + }).toThrow(new Error("Node does not exist: Foo")); + }); + + it("should do nothing if creating a node that already exists", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + + graph.addDependency("a", "b"); + + graph.addNode("a"); + + expect(graph.dependenciesOf("a")).toEqual(["b"]); + }); + + it("should do nothing if removing a node that does not exist", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + expect(graph.hasNode("a")).toBeTrue(); + + graph.removeNode("a"); + expect(graph.hasNode("Foo")).toBeFalse(); + + graph.removeNode("a"); + expect(graph.hasNode("Foo")).toBeFalse(); + }); + + it("should be able to add dependencies between nodes", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + + graph.addDependency("a", "b"); + graph.addDependency("a", "c"); + + expect(graph.dependenciesOf("a")).toEqual(["b", "c"]); + }); + + it("should find entry nodes", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + + graph.addDependency("a", "b"); + graph.addDependency("a", "c"); + + expect(graph.entryNodes()).toEqual(["a"]); + }); + + it("should throw an error if a node does not exist and a dependency is added", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + + expect(function () { + graph.addDependency("a", "b"); + }).toThrow(new Error("Node does not exist: b")); + }); + + it("should detect cycles", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addNode("d"); + + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + graph.addDependency("c", "a"); + graph.addDependency("d", "a"); + + expect(function () { + graph.dependenciesOf("b"); + }).toThrow(new dep_graph.DepGraphCycleError(["b", "c", "a", "b"])); + }); + + it("should allow cycles when configured", function () { + var graph = new DepGraph({ circular: true }); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addNode("d"); + + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + graph.addDependency("c", "a"); + graph.addDependency("d", "a"); + + expect(graph.dependenciesOf("b")).toEqual(["a", "c"]); + expect(graph.overallOrder()).toEqual(["c", "b", "a", "d"]); + }); + + it( + "should include all nodes in overall order even from " + + "cycles in disconnected subgraphs when circular is true", + function () { + var graph = new DepGraph({ circular: true }); + + graph.addNode("2a"); + graph.addNode("2b"); + graph.addNode("2c"); + graph.addDependency("2a", "2b"); + graph.addDependency("2b", "2c"); + graph.addDependency("2c", "2a"); + + graph.addNode("1a"); + graph.addNode("1b"); + graph.addNode("1c"); + graph.addNode("1d"); + graph.addNode("1e"); + + graph.addDependency("1a", "1b"); + graph.addDependency("1a", "1c"); + graph.addDependency("1b", "1c"); + graph.addDependency("1c", "1d"); + + expect(graph.overallOrder()).toEqual([ + "1d", + "1c", + "1b", + "1a", + "1e", + "2c", + "2b", + "2a" + ]); + } + ); + + it("should detect cycles in overall order", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addNode("d"); + + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + graph.addDependency("c", "a"); + graph.addDependency("d", "a"); + + expect(function () { + graph.overallOrder(); + }).toThrow(new dep_graph.DepGraphCycleError(["a", "b", "c", "a"])); + }); + + it("should detect cycles in overall order when all nodes have dependants (incoming edges)", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + graph.addDependency("c", "a"); + + expect(function () { + graph.overallOrder(); + }).toThrow(new dep_graph.DepGraphCycleError(["a", "b", "c", "a"])); + }); + + it( + "should detect cycles in overall order when there are several " + + "disconnected subgraphs (with one that does not have a cycle", + function () { + var graph = new DepGraph(); + + graph.addNode("a_1"); + graph.addNode("a_2"); + graph.addNode("b_1"); + graph.addNode("b_2"); + graph.addNode("b_3"); + + graph.addDependency("a_1", "a_2"); + graph.addDependency("b_1", "b_2"); + graph.addDependency("b_2", "b_3"); + graph.addDependency("b_3", "b_1"); + + expect(function () { + graph.overallOrder(); + }).toThrow( + new dep_graph.DepGraphCycleError(["b_1", "b_2", "b_3", "b_1"]) + ); + } + ); + + it("should retrieve dependencies and dependants in the correct order", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addNode("d"); + + graph.addDependency("a", "d"); + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + graph.addDependency("d", "b"); + + expect(graph.dependenciesOf("a")).toEqual(["c", "b", "d"]); + expect(graph.dependenciesOf("b")).toEqual(["c"]); + expect(graph.dependenciesOf("c")).toEqual([]); + expect(graph.dependenciesOf("d")).toEqual(["c", "b"]); + + expect(graph.dependantsOf("a")).toEqual([]); + expect(graph.dependantsOf("b")).toEqual(["a", "d"]); + expect(graph.dependantsOf("c")).toEqual(["a", "d", "b"]); + expect(graph.dependantsOf("d")).toEqual(["a"]); + + // check the alias "dependentsOf" + expect(graph.dependentsOf("a")).toEqual([]); + expect(graph.dependentsOf("b")).toEqual(["a", "d"]); + expect(graph.dependentsOf("c")).toEqual(["a", "d", "b"]); + expect(graph.dependentsOf("d")).toEqual(["a"]); + }); + + it("should be able to retrieve direct dependencies/dependants", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addNode("d"); + + graph.addDependency("a", "d"); + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + graph.addDependency("d", "b"); + + expect(graph.directDependenciesOf("a")).toEqual(["d", "b"]); + expect(graph.directDependenciesOf("b")).toEqual(["c"]); + expect(graph.directDependenciesOf("c")).toEqual([]); + expect(graph.directDependenciesOf("d")).toEqual(["b"]); + + expect(graph.directDependantsOf("a")).toEqual([]); + expect(graph.directDependantsOf("b")).toEqual(["a", "d"]); + expect(graph.directDependantsOf("c")).toEqual(["b"]); + expect(graph.directDependantsOf("d")).toEqual(["a"]); + + // check the alias "directDependentsOf" + expect(graph.directDependentsOf("a")).toEqual([]); + expect(graph.directDependentsOf("b")).toEqual(["a", "d"]); + expect(graph.directDependentsOf("c")).toEqual(["b"]); + expect(graph.directDependentsOf("d")).toEqual(["a"]); + }); + + it("should be able to resolve the overall order of things", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addNode("d"); + graph.addNode("e"); + + graph.addDependency("a", "b"); + graph.addDependency("a", "c"); + graph.addDependency("b", "c"); + graph.addDependency("c", "d"); + + expect(graph.overallOrder()).toEqual(["d", "c", "b", "a", "e"]); + }); + + it('should be able to only retrieve the "leaves" in the overall order', function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addNode("d"); + graph.addNode("e"); + + graph.addDependency("a", "b"); + graph.addDependency("a", "c"); + graph.addDependency("b", "c"); + graph.addDependency("c", "d"); + + expect(graph.overallOrder(true)).toEqual(["d", "e"]); + }); + + it("should be able to give the overall order for a graph with several disconnected subgraphs", function () { + var graph = new DepGraph(); + + graph.addNode("a_1"); + graph.addNode("a_2"); + graph.addNode("b_1"); + graph.addNode("b_2"); + graph.addNode("b_3"); + + graph.addDependency("a_1", "a_2"); + graph.addDependency("b_1", "b_2"); + graph.addDependency("b_2", "b_3"); + + expect(graph.overallOrder()).toEqual(["a_2", "a_1", "b_3", "b_2", "b_1"]); + }); + + it("should give an empty overall order for an empty graph", function () { + var graph = new DepGraph(); + + expect(graph.overallOrder()).toEqual([]); + }); + + it("should still work after nodes are removed", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + + expect(graph.dependenciesOf("a")).toEqual(["c", "b"]); + + graph.removeNode("c"); + + expect(graph.dependenciesOf("a")).toEqual(["b"]); + }); + + it("should clone an empty graph", function () { + var graph = new DepGraph(); + expect(graph.size()).toEqual(0); + var cloned = graph.clone(); + expect(cloned.size()).toEqual(0); + + expect(graph === cloned).toBeFalse(); + }); + + it("should clone a non-empty graph", function () { + var graph = new DepGraph(); + + graph.addNode("a"); + graph.addNode("b"); + graph.addNode("c"); + graph.addDependency("a", "b"); + graph.addDependency("b", "c"); + + var cloned = graph.clone(); + + expect(graph === cloned).toBeFalse(); + expect(cloned.hasNode("a")).toBeTrue(); + expect(cloned.hasNode("b")).toBeTrue(); + expect(cloned.hasNode("c")).toBeTrue(); + expect(cloned.dependenciesOf("a")).toEqual(["c", "b"]); + expect(cloned.dependantsOf("c")).toEqual(["a", "b"]); + + // Changes to the original graph shouldn't affect the clone + graph.removeNode("c"); + expect(graph.dependenciesOf("a")).toEqual(["b"]); + expect(cloned.dependenciesOf("a")).toEqual(["c", "b"]); + + graph.addNode("d"); + graph.addDependency("b", "d"); + expect(graph.dependenciesOf("a")).toEqual(["d", "b"]); + expect(cloned.dependenciesOf("a")).toEqual(["c", "b"]); + }); + + it("should only be a shallow clone", function () { + var graph = new DepGraph(); + + var data = { a: 42 }; + graph.addNode("a", data); + + var cloned = graph.clone(); + expect(graph === cloned).toBeFalse(); + expect(graph.getNodeData("a") === cloned.getNodeData("a")).toBeTrue(); + + graph.getNodeData("a").a = 43; + expect(cloned.getNodeData("a").a).toBe(43); + + cloned.setNodeData("a", { a: 42 }); + expect(cloned.getNodeData("a").a).toBe(42); + expect(graph.getNodeData("a") === cloned.getNodeData("a")).toBeFalse(); + }); +}); + +describe("DepGraph Performance", function () { + it("should not exceed max call stack with a very deep graph", function () { + var g = new DepGraph(); + var expected = []; + for (var i = 0; i < 100000; i++) { + var istr = i.toString(); + g.addNode(istr); + expected.push(istr); + if (i > 0) { + g.addDependency(istr, (i - 1).toString()); + } + } + var order = g.overallOrder(); + expect(order).toEqual(expected); + }); + + it("should run an a reasonable amount of time for a very large graph", function () { + var randInt = function (min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; + }; + var g = new DepGraph(); + var nodes = []; + // Create a graph with 100000 nodes in it with 10 random connections to + // lower numbered nodes + for (var i = 0; i < 100000; i++) { + nodes.push(i.toString()); + g.addNode(i.toString()); + for (var j = 0; j < 10; j++) { + var dep = randInt(0, i); + if (i !== dep) { + g.addDependency(i.toString(), dep.toString()); + } + } + } + var start = new Date().getTime(); + g.overallOrder(); + var end = new Date().getTime(); + expect(start - end).toBeLessThan(1000); + }); +}); + +describe("DepGraphCycleError", function () { + var DepGraphCycleError = dep_graph.DepGraphCycleError; + + it("should have a message", function () { + var err = new DepGraphCycleError(["a", "b", "c", "a"]); + expect(err.message).toEqual("Dependency Cycle Found: a -> b -> c -> a"); + }); + + it("should be an instanceof DepGraphCycleError", function () { + var err = new DepGraphCycleError(["a", "b", "c", "a"]); + expect(err instanceof DepGraphCycleError).toBeTrue(); + expect(err instanceof Error).toBeTrue(); + }); + + it("should have a cyclePath", function () { + var cyclePath = ["a", "b", "c", "a"]; + var err = new DepGraphCycleError(cyclePath); + expect(err.cyclePath).toEqual(cyclePath); + }); +}); diff --git a/node_modules/dev-ip/.jshintrc b/node_modules/dev-ip/.jshintrc new file mode 100644 index 0000000..93c9eeb --- /dev/null +++ b/node_modules/dev-ip/.jshintrc @@ -0,0 +1,26 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "laxbreak": false, + "latedef": "nofunc", + "newcap": true, + "noarg": true, + "plusplus": true, + "sub": true, + "undef": true, + "quotmark": "double", + "unused": true, + "indent": 4, + "eqnull": true, + "node": true, + "strict": true, + "mocha": true, + "jasmine": true, + "globals": { + "browser": false, + "by": false, + "element": false, + "protractor": false + } +} diff --git a/node_modules/dev-ip/.npmignore b/node_modules/dev-ip/.npmignore new file mode 100644 index 0000000..f454dec --- /dev/null +++ b/node_modules/dev-ip/.npmignore @@ -0,0 +1,3 @@ +node_modules +.idea +npm-debug.log \ No newline at end of file diff --git a/node_modules/dev-ip/.travis.yml b/node_modules/dev-ip/.travis.yml new file mode 100644 index 0000000..17b81ec --- /dev/null +++ b/node_modules/dev-ip/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - '0.10' +before_script: + - npm install -g gulp diff --git a/node_modules/dev-ip/LICENSE-MIT b/node_modules/dev-ip/LICENSE-MIT new file mode 100644 index 0000000..49491e1 --- /dev/null +++ b/node_modules/dev-ip/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Shane Osbourne + +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. diff --git a/node_modules/dev-ip/README.md b/node_modules/dev-ip/README.md new file mode 100644 index 0000000..aecf108 --- /dev/null +++ b/node_modules/dev-ip/README.md @@ -0,0 +1,32 @@ +# dev-ip [![Build Status](https://travis-ci.org/shakyShane/dev-ip.png?branch=master)](https://travis-ci.org/shakyShane/dev-ip) + +Find a suitable IP host to view local websites on. + +## Command line +Install it globally to use on the command line: + +`sudo npm install -g dev-ip` + +then run: + +`dev-ip` + +> "http://192.168.1.46" + +## In your project +`npm install dev-ip` + +```javascript +var devip = require('dev-ip'); +devip(); // "192.168.1.76" or false if nothing found (ie, offline user) +``` + +## Contributing +In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Run lint & tests with `gulp`. + +## Release History +_(Nothing yet)_ + +## License +Copyright (c) 2013 Shane Osbourne +Licensed under the MIT license. diff --git a/node_modules/dev-ip/example.js b/node_modules/dev-ip/example.js new file mode 100644 index 0000000..3bf9920 --- /dev/null +++ b/node_modules/dev-ip/example.js @@ -0,0 +1,4 @@ +var devip = require("./lib/dev-ip"); + +var ip = devip(); +console.log(ip); \ No newline at end of file diff --git a/node_modules/dev-ip/lib/dev-ip.js b/node_modules/dev-ip/lib/dev-ip.js new file mode 100755 index 0000000..7f5500f --- /dev/null +++ b/node_modules/dev-ip/lib/dev-ip.js @@ -0,0 +1,44 @@ +#! /usr/bin/env node +/* + * dev-ip + * https://github.com/shakyshane/dev-ip + * + * Copyright (c) 2013 Shane Osbourne + * Licensed under the MIT license. + */ + +"use strict"; + +var messages = { + error: "Couldn't find a suitable IP for you to use. (You're probably offline!)" +}; + +/** + * @returns {Array} + */ +function getIp() { + + var networkInterfaces = require("os").networkInterfaces(); + var matches = []; + + Object.keys(networkInterfaces).forEach(function (item) { + networkInterfaces[item].forEach(function (address) { + if (address.internal === false && address.family === "IPv4") { + matches.push(address.address); + } + }); + }); + + return matches; +}; + +module.exports = getIp; + +if (require.main === module) { + + var out = getIp(); + if (!out.length) { + return console.log(messages.error); + } + console.log(getIp("cli")); +} \ No newline at end of file diff --git a/node_modules/dev-ip/package.json b/node_modules/dev-ip/package.json new file mode 100644 index 0000000..25d76bc --- /dev/null +++ b/node_modules/dev-ip/package.json @@ -0,0 +1,43 @@ +{ + "name": "dev-ip", + "description": "Find a suitable IP host to view local websites on.", + "version": "1.0.1", + "homepage": "https://github.com/shakyshane/dev-ip", + "author": { + "name": "Shane Osbourne", + "email": "shane.osbourne8@gmail.com" + }, + "repository": { + "type": "git", + "url": "git://github.com/shakyshane/dev-ip.git" + }, + "bugs": { + "url": "https://github.com/shakyshane/dev-ip/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/shakyshane/dev-ip/blob/master/LICENSE-MIT" + } + ], + "main": "lib/dev-ip", + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "lint": "jshint lib/*.js test/*.js", + "unit": "mocha", + "test": "npm run lint && npm run unit" + }, + "devDependencies": { + "chai": "^1.10.0", + "jshint": "^2.5.11", + "mocha": "^2.1.0", + "sinon": "^1.12.2" + }, + "keywords": [], + "bin": { + "dev-ip": "lib/dev-ip.js" + }, + "dependencies": {} +} diff --git a/node_modules/dev-ip/test/.jshintrc b/node_modules/dev-ip/test/.jshintrc new file mode 100644 index 0000000..cd69a62 --- /dev/null +++ b/node_modules/dev-ip/test/.jshintrc @@ -0,0 +1,26 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": "nofunc", + "newcap": true, + "noarg": true, + "sub": true, + "undef": false, + "unused": false, + "quotmark": "double", + "boss": true, + "eqnull": true, + "node": true, + "globals": { + "describe" : false, + "it" : false, + "expect" : false, + "runs" : false, + "waitsFor" : false, + "beforeEach" : false, + "afterEach" : false, + "before" : false, + "after" : false + } +} diff --git a/node_modules/dev-ip/test/devip.js b/node_modules/dev-ip/test/devip.js new file mode 100644 index 0000000..cb7ee65 --- /dev/null +++ b/node_modules/dev-ip/test/devip.js @@ -0,0 +1,77 @@ +"use strict"; + +var devIp = require("../lib/dev-ip"); +var respNone = require("./fixtures/resp-none"); +var respSingle = require("./fixtures/resp-single"); +var respMultiple = require("./fixtures/resp-multiple"); +var sinon = require("sinon"); +var assert = require("chai").assert; +var os = require("os"); + +// From the resp files +var match1 = "10.104.103.181"; +var match2 = "10.104.100.12"; + +var regex = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; + +describe("Getting the IP with a single result", function () { + var osStub; + var result; + before(function () { + osStub = sinon.stub(os, "networkInterfaces").returns(respSingle); + }); + beforeEach(function () { + result = devIp(null); + }); + after(function () { + osStub.restore(); + }); + it("should return the IP when a single match found", function () { + var expected = match1; + assert.deepEqual(result, [expected]); + }); + it("should return a string matching the regex", function () { + var actual = regex.exec(result); + assert.isNotNull(actual); + }); +}); + +describe("Getting the IP with Multiple results", function () { + var osStub; + var result; + before(function () { + osStub = sinon.stub(os, "networkInterfaces").returns(respMultiple); + }); + beforeEach(function () { + result = devIp(null); + }); + after(function () { + osStub.restore(); + }); + it("should return an array of results", function () { + assert.equal(result[0], match1); + assert.equal(result[1], match2); + }); + it("should return a string matching the regex", function () { + var actual = regex.exec(result[0]); + assert.isNotNull(actual); + actual = regex.exec(result[1]); + assert.isNotNull(actual); + }); +}); + +describe("Getting the IP with no results", function () { + var osStub; + var result; + before(function () { + osStub = sinon.stub(os, "networkInterfaces").returns(respNone); + }); + after(function () { + osStub.restore(); + }); + it("should return empty array", function () { + var actual = devIp(); + assert.isArray(actual); + assert.equal(actual.length, 0); + }); +}); diff --git a/node_modules/dev-ip/test/fixtures/resp-multiple.js b/node_modules/dev-ip/test/fixtures/resp-multiple.js new file mode 100644 index 0000000..97d7db1 --- /dev/null +++ b/node_modules/dev-ip/test/fixtures/resp-multiple.js @@ -0,0 +1,35 @@ +module.exports = { + lo0: [ + { + address: 'fe80::1', + family: 'IPv6', + internal: true + }, + { + address: '127.0.0.1', + family: 'IPv4', + internal: true + }, + { + address: '::1', + family: 'IPv6', + internal: true + } + ], + en0: [ + { + address: 'fe80::22c9:d0ff:fe44:6415', + family: 'IPv6', + internal: false }, + { + address: '10.104.103.181', + family: 'IPv4', + internal: false + }, + { + address: '10.104.100.12', + family: 'IPv4', + internal: false + } + ] +} \ No newline at end of file diff --git a/node_modules/dev-ip/test/fixtures/resp-none.js b/node_modules/dev-ip/test/fixtures/resp-none.js new file mode 100644 index 0000000..7a39b62 --- /dev/null +++ b/node_modules/dev-ip/test/fixtures/resp-none.js @@ -0,0 +1,19 @@ +module.exports = { + lo0: [ + { + address: 'fe80::1', + family: 'IPv6', + internal: true + }, + { + address: '127.0.0.1', + family: 'IPv4', + internal: true + }, + { + address: '::1', + family: 'IPv6', + internal: true + } + ] +} \ No newline at end of file diff --git a/node_modules/dev-ip/test/fixtures/resp-single.js b/node_modules/dev-ip/test/fixtures/resp-single.js new file mode 100644 index 0000000..fccb9ce --- /dev/null +++ b/node_modules/dev-ip/test/fixtures/resp-single.js @@ -0,0 +1,30 @@ +module.exports = { + lo0: [ + { + address: 'fe80::1', + family: 'IPv6', + internal: true + }, + { + address: '127.0.0.1', + family: 'IPv4', + internal: true + }, + { + address: '::1', + family: 'IPv6', + internal: true + } + ], + en0: [ + { + address: 'fe80::22c9:d0ff:fe44:6415', + family: 'IPv6', + internal: false }, + { + address: '10.104.103.181', + family: 'IPv4', + internal: false + } + ] +} \ No newline at end of file diff --git a/node_modules/didyoumean/LICENSE b/node_modules/didyoumean/LICENSE new file mode 100644 index 0000000..32c23db --- /dev/null +++ b/node_modules/didyoumean/LICENSE @@ -0,0 +1,14 @@ +## License + +didYouMean.js copyright (c) 2013 Dave Porter. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License +[here](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/didyoumean/README.md b/node_modules/didyoumean/README.md new file mode 100644 index 0000000..cd16698 --- /dev/null +++ b/node_modules/didyoumean/README.md @@ -0,0 +1,134 @@ +didYouMean.js - A simple JavaScript matching engine +=================================================== + +[Available on GitHub](https://github.com/dcporter/didyoumean.js). + +A super-simple, highly optimized JS library for matching human-quality input to a list of potential +matches. You can use it to suggest a misspelled command-line utility option to a user, or to offer +links to nearby valid URLs on your 404 page. (The examples below are taken from a personal project, +my [HTML5 business card](http://dcporter.aws.af.cm/me), which uses didYouMean.js to suggest correct +URLs from misspelled ones, such as [dcporter.aws.af.cm/me/instagarm](http://dcporter.aws.af.cm/me/instagarm).) +Uses the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance). + +didYouMean.js works in the browser as well as in node.js. To install it for use in node: + +``` +npm install didyoumean +``` + + +Examples +-------- + +Matching against a list of strings: +``` +var input = 'insargrm' +var list = ['facebook', 'twitter', 'instagram', 'linkedin']; +console.log(didYouMean(input, list)); +> 'instagram' +// The method matches 'insargrm' to 'instagram'. + +input = 'google plus'; +console.log(didYouMean(input, list)); +> null +// The method was unable to find 'google plus' in the list of options. +``` + +Matching against a list of objects: +``` +var input = 'insargrm'; +var list = [ { id: 'facebook' }, { id: 'twitter' }, { id: 'instagram' }, { id: 'linkedin' } ]; +var key = 'id'; +console.log(didYouMean(input, list, key)); +> 'instagram' +// The method returns the matching value. + +didYouMean.returnWinningObject = true; +console.log(didYouMean(input, list, key)); +> { id: 'instagram' } +// The method returns the matching object. +``` + + +didYouMean(str, list, [key]) +---------------------------- + +- str: The string input to match. +- list: An array of strings or objects to match against. +- key (OPTIONAL): If your list array contains objects, you must specify the key which contains the string + to match against. + +Returns: the closest matching string, or null if no strings exceed the threshold. + + +Options +------- + +Options are set on the didYouMean function object. You may change them at any time. + +### threshold + + By default, the method will only return strings whose edit distance is less than 40% (0.4x) of their length. + For example, if a ten-letter string is five edits away from its nearest match, the method will return null. + + You can control this by setting the "threshold" value on the didYouMean function. For example, to set the + edit distance threshold to 50% of the input string's length: + + ``` + didYouMean.threshold = 0.5; + ``` + + To return the nearest match no matter the threshold, set this value to null. + +### thresholdAbsolute + + This option behaves the same as threshold, but instead takes an integer number of edit steps. For example, + if thresholdAbsolute is set to 20 (the default), then the method will only return strings whose edit distance + is less than 20. Both options apply. + +### caseSensitive + + By default, the method will perform case-insensitive comparisons. If you wish to force case sensitivity, set + the "caseSensitive" value to true: + + ``` + didYouMean.caseSensitive = true; + ``` + +### nullResultValue + + By default, the method will return null if there is no sufficiently close match. You can change this value here. + +### returnWinningObject + + By default, the method will return the winning string value (if any). If your list contains objects rather + than strings, you may set returnWinningObject to true. + + ``` + didYouMean.returnWinningObject = true; + ``` + + This option has no effect on lists of strings. + +### returnFirstMatch + + By default, the method will search all values and return the closest match. If you're simply looking for a "good- + enough" match, you can set your thresholds appropriately and set returnFirstMatch to true to substantially speed + things up. + + +License +------- + +didYouMean copyright (c) 2013-2014 Dave Porter. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License +[here](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/didyoumean/didYouMean-1.2.1.js b/node_modules/didyoumean/didYouMean-1.2.1.js new file mode 100644 index 0000000..febb30e --- /dev/null +++ b/node_modules/didyoumean/didYouMean-1.2.1.js @@ -0,0 +1,274 @@ +/* + +didYouMean.js - A simple JavaScript matching engine +=================================================== + +[Available on GitHub](https://github.com/dcporter/didyoumean.js). + +A super-simple, highly optimized JS library for matching human-quality input to a list of potential +matches. You can use it to suggest a misspelled command-line utility option to a user, or to offer +links to nearby valid URLs on your 404 page. (The examples below are taken from a personal project, +my [HTML5 business card](http://dcporter.aws.af.cm/me), which uses didYouMean.js to suggest correct +URLs from misspelled ones, such as [dcporter.aws.af.cm/me/instagarm](http://dcporter.aws.af.cm/me/instagarm).) +Uses the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance). + +didYouMean.js works in the browser as well as in node.js. To install it for use in node: + +``` +npm install didyoumean +``` + + +Examples +-------- + +Matching against a list of strings: +``` +var input = 'insargrm' +var list = ['facebook', 'twitter', 'instagram', 'linkedin']; +console.log(didYouMean(input, list)); +> 'instagram' +// The method matches 'insargrm' to 'instagram'. + +input = 'google plus'; +console.log(didYouMean(input, list)); +> null +// The method was unable to find 'google plus' in the list of options. +``` + +Matching against a list of objects: +``` +var input = 'insargrm'; +var list = [ { id: 'facebook' }, { id: 'twitter' }, { id: 'instagram' }, { id: 'linkedin' } ]; +var key = 'id'; +console.log(didYouMean(input, list, key)); +> 'instagram' +// The method returns the matching value. + +didYouMean.returnWinningObject = true; +console.log(didYouMean(input, list, key)); +> { id: 'instagram' } +// The method returns the matching object. +``` + + +didYouMean(str, list, [key]) +---------------------------- + +- str: The string input to match. +- list: An array of strings or objects to match against. +- key (OPTIONAL): If your list array contains objects, you must specify the key which contains the string + to match against. + +Returns: the closest matching string, or null if no strings exceed the threshold. + + +Options +------- + +Options are set on the didYouMean function object. You may change them at any time. + +### threshold + + By default, the method will only return strings whose edit distance is less than 40% (0.4x) of their length. + For example, if a ten-letter string is five edits away from its nearest match, the method will return null. + + You can control this by setting the "threshold" value on the didYouMean function. For example, to set the + edit distance threshold to 50% of the input string's length: + + ``` + didYouMean.threshold = 0.5; + ``` + + To return the nearest match no matter the threshold, set this value to null. + +### thresholdAbsolute + + This option behaves the same as threshold, but instead takes an integer number of edit steps. For example, + if thresholdAbsolute is set to 20 (the default), then the method will only return strings whose edit distance + is less than 20. Both options apply. + +### caseSensitive + + By default, the method will perform case-insensitive comparisons. If you wish to force case sensitivity, set + the "caseSensitive" value to true: + + ``` + didYouMean.caseSensitive = true; + ``` + +### nullResultValue + + By default, the method will return null if there is no sufficiently close match. You can change this value here. + +### returnWinningObject + + By default, the method will return the winning string value (if any). If your list contains objects rather + than strings, you may set returnWinningObject to true. + + ``` + didYouMean.returnWinningObject = true; + ``` + + This option has no effect on lists of strings. + +### returnFirstMatch + + By default, the method will search all values and return the closest match. If you're simply looking for a "good- + enough" match, you can set your thresholds appropriately and set returnFirstMatch to true to substantially speed + things up. + + +License +------- + +didYouMean copyright (c) 2013-2014 Dave Porter. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License +[here](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +*/ +(function() { + "use strict"; + + // The didYouMean method. + function didYouMean(str, list, key) { + if (!str) return null; + + // If we're running a case-insensitive search, smallify str. + if (!didYouMean.caseSensitive) { str = str.toLowerCase(); } + + // Calculate the initial value (the threshold) if present. + var thresholdRelative = didYouMean.threshold === null ? null : didYouMean.threshold * str.length, + thresholdAbsolute = didYouMean.thresholdAbsolute, + winningVal; + if (thresholdRelative !== null && thresholdAbsolute !== null) winningVal = Math.min(thresholdRelative, thresholdAbsolute); + else if (thresholdRelative !== null) winningVal = thresholdRelative; + else if (thresholdAbsolute !== null) winningVal = thresholdAbsolute; + else winningVal = null; + + // Get the edit distance to each option. If the closest one is less than 40% (by default) of str's length, + // then return it. + var winner, candidate, testCandidate, val, + i, len = list.length; + for (i = 0; i < len; i++) { + // Get item. + candidate = list[i]; + // If there's a key, get the candidate value out of the object. + if (key) { candidate = candidate[key]; } + // Gatekeep. + if (!candidate) { continue; } + // If we're running a case-insensitive search, smallify the candidate. + if (!didYouMean.caseSensitive) { testCandidate = candidate.toLowerCase(); } + else { testCandidate = candidate; } + // Get and compare edit distance. + val = getEditDistance(str, testCandidate, winningVal); + // If this value is smaller than our current winning value, OR if we have no winning val yet (i.e. the + // threshold option is set to null, meaning the caller wants a match back no matter how bad it is), then + // this is our new winner. + if (winningVal === null || val < winningVal) { + winningVal = val; + // Set the winner to either the value or its object, depending on the returnWinningObject option. + if (key && didYouMean.returnWinningObject) winner = list[i]; + else winner = candidate; + // If we're returning the first match, return it now. + if (didYouMean.returnFirstMatch) return winner; + } + } + + // If we have a winner, return it. + return winner || didYouMean.nullResultValue; + } + + // Set default options. + didYouMean.threshold = 0.4; + didYouMean.thresholdAbsolute = 20; + didYouMean.caseSensitive = false; + didYouMean.nullResultValue = null; + didYouMean.returnWinningObject = null; + didYouMean.returnFirstMatch = false; + + // Expose. + // In node... + if (typeof module !== 'undefined' && module.exports) { + module.exports = didYouMean; + } + // Otherwise... + else { + window.didYouMean = didYouMean; + } + + var MAX_INT = Math.pow(2,32) - 1; // We could probably go higher than this, but for practical reasons let's not. + function getEditDistance(a, b, max) { + // Handle null or undefined max. + max = max || max === 0 ? max : MAX_INT; + + var lena = a.length; + var lenb = b.length; + + // Fast path - no A or B. + if (lena === 0) return Math.min(max + 1, lenb); + if (lenb === 0) return Math.min(max + 1, lena); + + // Fast path - length diff larger than max. + if (Math.abs(lena - lenb) > max) return max + 1; + + // Slow path. + var matrix = [], + i, j, colMin, minJ, maxJ; + + // Set up the first row ([0, 1, 2, 3, etc]). + for (i = 0; i <= lenb; i++) { matrix[i] = [i]; } + + // Set up the first column (same). + for (j = 0; j <= lena; j++) { matrix[0][j] = j; } + + // Loop over the rest of the columns. + for (i = 1; i <= lenb; i++) { + colMin = MAX_INT; + minJ = 1; + if (i > max) minJ = i - max; + maxJ = lenb + 1; + if (maxJ > max + i) maxJ = max + i; + // Loop over the rest of the rows. + for (j = 1; j <= lena; j++) { + // If j is out of bounds, just put a large value in the slot. + if (j < minJ || j > maxJ) { + matrix[i][j] = max + 1; + } + + // Otherwise do the normal Levenshtein thing. + else { + // If the characters are the same, there's no change in edit distance. + if (b.charAt(i - 1) === a.charAt(j - 1)) { + matrix[i][j] = matrix[i - 1][j - 1]; + } + // Otherwise, see if we're substituting, inserting or deleting. + else { + matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // Substitute + Math.min(matrix[i][j - 1] + 1, // Insert + matrix[i - 1][j] + 1)); // Delete + } + } + + // Either way, update colMin. + if (matrix[i][j] < colMin) colMin = matrix[i][j]; + } + + // If this column's minimum is greater than the allowed maximum, there's no point + // in going on with life. + if (colMin > max) return max + 1; + } + // If we made it this far without running into the max, then return the final matrix value. + return matrix[lenb][lena]; + } + +})(); diff --git a/node_modules/didyoumean/didYouMean-1.2.1.min.js b/node_modules/didyoumean/didYouMean-1.2.1.min.js new file mode 100644 index 0000000..c41abd8 --- /dev/null +++ b/node_modules/didyoumean/didYouMean-1.2.1.min.js @@ -0,0 +1,17 @@ +/* + didYouMean.js copyright (c) 2013-2014 Dave Porter. + + [Available on GitHub](https://github.com/dcporter/didyoumean.js). + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License + [here](http://www.apache.org/licenses/LICENSE-2.0). + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +(function(){"use strict";function e(t,r,i){if(!t)return null;if(!e.caseSensitive){t=t.toLowerCase()}var s=e.threshold===null?null:e.threshold*t.length,o=e.thresholdAbsolute,u;if(s!==null&&o!==null)u=Math.min(s,o);else if(s!==null)u=s;else if(o!==null)u=o;else u=null;var a,f,l,c,h,p=r.length;for(h=0;hr)return r+1;var o=[],u,a,f,l,c;for(u=0;u<=s;u++){o[u]=[u]}for(a=0;a<=i;a++){o[0][a]=a}for(u=1;u<=s;u++){f=t;l=1;if(u>r)l=u-r;c=s+1;if(c>r+u)c=r+u;for(a=1;a<=i;a++){if(ac){o[u][a]=r+1}else{if(n.charAt(u-1)===e.charAt(a-1)){o[u][a]=o[u-1][a-1]}else{o[u][a]=Math.min(o[u-1][a-1]+1,Math.min(o[u][a-1]+1,o[u-1][a]+1))}}if(o[u][a]r)return r+1}return o[s][i]}e.threshold=.4;e.thresholdAbsolute=20;e.caseSensitive=false;e.nullResultValue=null;e.returnWinningObject=null;e.returnFirstMatch=false;if(typeof module!=="undefined"&&module.exports){module.exports=e}else{window.didYouMean=e}var t=Math.pow(2,32)-1})(); \ No newline at end of file diff --git a/node_modules/didyoumean/package.json b/node_modules/didyoumean/package.json new file mode 100755 index 0000000..1301d03 --- /dev/null +++ b/node_modules/didyoumean/package.json @@ -0,0 +1,27 @@ +{ + "name": "didyoumean", + "version": "1.2.2", + "description": "Match human-quality input to potential matches by edit distance.", + "homepage": "https://github.com/dcporter/didyoumean.js", + "author": { + "name": "Dave Porter", + "email": "dcporter@gmail.com", + "url": "http://dcporter.net/" + }, + "keywords": [ + "didyoumean", + "mean", + "edit", + "distance", + "levenshtein" + ], + "main": "./didYouMean-1.2.1.js", + "repository": { + "type": "git", + "url": "https://github.com/dcporter/didyoumean.js.git" + }, + "bugs": { + "url": "https://github.com/dcporter/didyoumean.js/issues" + }, + "license": "Apache-2.0" +} diff --git a/node_modules/dlv/README.md b/node_modules/dlv/README.md new file mode 100644 index 0000000..6a8429d --- /dev/null +++ b/node_modules/dlv/README.md @@ -0,0 +1,76 @@ +# `dlv(obj, keypath)` [![NPM](https://img.shields.io/npm/v/dlv.svg)](https://npmjs.com/package/dlv) [![Build](https://travis-ci.org/developit/dlv.svg?branch=master)](https://travis-ci.org/developit/dlv) + +> Safely get a dot-notated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined + + +### Why? + +Smallest possible implementation: only **130 bytes.** + +You could write this yourself, but then you'd have to write [tests]. + +Supports ES Modules, CommonJS and globals. + + +### Installation + +`npm install --save dlv` + + +### Usage + +`delve(object, keypath, [default])` + +```js +import delve from 'dlv'; + +let obj = { + a: { + b: { + c: 1, + d: undefined, + e: null + } + } +}; + +//use string dot notation for keys +delve(obj, 'a.b.c') === 1; + +//or use an array key +delve(obj, ['a', 'b', 'c']) === 1; + +delve(obj, 'a.b') === obj.a.b; + +//returns undefined if the full key path does not exist and no default is specified +delve(obj, 'a.b.f') === undefined; + +//optional third parameter for default if the full key in path is missing +delve(obj, 'a.b.f', 'foo') === 'foo'; + +//or if the key exists but the value is undefined +delve(obj, 'a.b.d', 'foo') === 'foo'; + +//Non-truthy defined values are still returned if they exist at the full keypath +delve(obj, 'a.b.e', 'foo') === null; + +//undefined obj or key returns undefined, unless a default is supplied +delve(undefined, 'a.b.c') === undefined; +delve(undefined, 'a.b.c', 'foo') === 'foo'; +delve(obj, undefined, 'foo') === 'foo'; +``` + + +### Setter Counterparts + +- [dset](https://github.com/lukeed/dset) by [@lukeed](https://github.com/lukeed) is the spiritual "set" counterpart of `dlv` and very fast. +- [bury](https://github.com/kalmbach/bury) by [@kalmbach](https://github.com/kalmbach) does the opposite of `dlv` and is implemented in a very similar manner. + + +### License + +[MIT](https://oss.ninja/mit/developit/) + + +[preact]: https://github.com/developit/preact +[tests]: https://github.com/developit/dlv/blob/master/test.js diff --git a/node_modules/dlv/dist/dlv.es.js b/node_modules/dlv/dist/dlv.es.js new file mode 100644 index 0000000..06b981b --- /dev/null +++ b/node_modules/dlv/dist/dlv.es.js @@ -0,0 +1,2 @@ +export default function(t,e,l,n,r){for(e=e.split?e.split("."):e,n=0;n (http://jasonformat.com)", + "repository": "developit/dlv", + "license": "MIT", + "devDependencies": { + "microbundle": "^0.11.0" + } +} diff --git a/node_modules/doctypes/.npmignore b/node_modules/doctypes/.npmignore new file mode 100644 index 0000000..b83202d --- /dev/null +++ b/node_modules/doctypes/.npmignore @@ -0,0 +1,13 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz +pids +logs +results +npm-debug.log +node_modules diff --git a/node_modules/doctypes/.travis.yml b/node_modules/doctypes/.travis.yml new file mode 100644 index 0000000..6e5919d --- /dev/null +++ b/node_modules/doctypes/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" diff --git a/node_modules/doctypes/HISTORY.md b/node_modules/doctypes/HISTORY.md new file mode 100644 index 0000000..d99fd34 --- /dev/null +++ b/node_modules/doctypes/HISTORY.md @@ -0,0 +1,14 @@ +# Change log + +## 1.1.0 / 2016-08-10 + +- Bump minor (to fix a packaging error in 1.0.1) +- Update plist doctype + +## 1.0.1 / 2016-08-09 + +- Add property list doctype + +## 1.0.0 / 2015-01-22 + +- Initial release diff --git a/node_modules/doctypes/LICENSE b/node_modules/doctypes/LICENSE new file mode 100644 index 0000000..a1421ff --- /dev/null +++ b/node_modules/doctypes/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/doctypes/README.md b/node_modules/doctypes/README.md new file mode 100644 index 0000000..08013ab --- /dev/null +++ b/node_modules/doctypes/README.md @@ -0,0 +1,24 @@ +# doctypes + +Shorthands for commonly used doctypes + +[![Build Status](https://img.shields.io/travis/pugjs/doctypes/master.svg)](https://travis-ci.org/pugjs/doctypes) +[![NPM version](https://img.shields.io/npm/v/doctypes.svg)](https://www.npmjs.org/package/doctypes) + +## Installation + + npm install doctypes + +## Usage + +```js +var assert = require('assert'); +var doctypes = require('doctypes'); + +assert(doctypes['html'] === ''); +assert(doctypes['xml'] === ''); +``` + +## License + + MIT diff --git a/node_modules/doctypes/index.js b/node_modules/doctypes/index.js new file mode 100644 index 0000000..9e0f52d --- /dev/null +++ b/node_modules/doctypes/index.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = { + 'html': '', + 'xml': '', + 'transitional': '', + 'strict': '', + 'frameset': '', + '1.1': '', + 'basic': '', + 'mobile': '', + 'plist': '' +}; diff --git a/node_modules/doctypes/package.json b/node_modules/doctypes/package.json new file mode 100644 index 0000000..704b9d5 --- /dev/null +++ b/node_modules/doctypes/package.json @@ -0,0 +1,19 @@ +{ + "name": "doctypes", + "version": "1.1.0", + "description": "Shorthands for commonly used doctypes", + "keywords": [ + "doctype" + ], + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "node test" + }, + "repository": { + "type": "git", + "url": "https://github.com/pugjs/doctypes.git" + }, + "author": "ForbesLindesay", + "license": "MIT" +} diff --git a/node_modules/doctypes/test.js b/node_modules/doctypes/test.js new file mode 100644 index 0000000..7ef4b09 --- /dev/null +++ b/node_modules/doctypes/test.js @@ -0,0 +1,9 @@ +'use strict'; + +var assert = require('assert'); +var doctypes = require('./'); + +assert(doctypes['html'] === ''); +assert(doctypes['xml'] === ''); + +console.log('tests passed'); diff --git a/node_modules/dom-serializer/LICENSE b/node_modules/dom-serializer/LICENSE new file mode 100644 index 0000000..3d241a8 --- /dev/null +++ b/node_modules/dom-serializer/LICENSE @@ -0,0 +1,11 @@ +License + +(The MIT License) + +Copyright (c) 2014 The cheeriojs 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. diff --git a/node_modules/dom-serializer/README.md b/node_modules/dom-serializer/README.md new file mode 100644 index 0000000..9ef0eec --- /dev/null +++ b/node_modules/dom-serializer/README.md @@ -0,0 +1,97 @@ +# dom-serializer [![Build Status](https://travis-ci.com/cheeriojs/dom-serializer.svg?branch=master)](https://travis-ci.com/cheeriojs/dom-serializer) + +Renders a [domhandler](https://github.com/fb55/domhandler) DOM node or an array of domhandler DOM nodes to a string. + +```js +import render from "dom-serializer"; + +// OR + +const render = require("dom-serializer").default; +``` + +# API + +## `render` + +▸ **render**(`node`: Node \| Node[], `options?`: [_Options_](#Options)): _string_ + +Renders a DOM node or an array of DOM nodes to a string. + +Can be thought of as the equivalent of the `outerHTML` of the passed node(s). + +#### Parameters: + +| Name | Type | Default value | Description | +| :-------- | :--------------------------------- | :------------ | :----------------------------- | +| `node` | Node \| Node[] | - | Node to be rendered. | +| `options` | [_DomSerializerOptions_](#Options) | {} | Changes serialization behavior | + +**Returns:** _string_ + +## Options + +### `decodeEntities` + +• `Optional` **decodeEntities**: _boolean_ + +Encode characters that are either reserved in HTML or XML, or are outside of the ASCII range. + +**`default`** true + +--- + +### `emptyAttrs` + +• `Optional` **emptyAttrs**: _boolean_ + +Print an empty attribute's value. + +**`default`** xmlMode + +**`example`** With emptyAttrs: false: <input checked> + +**`example`** With emptyAttrs: true: <input checked=""> + +--- + +### `selfClosingTags` + +• `Optional` **selfClosingTags**: _boolean_ + +Print self-closing tags for tags without contents. + +**`default`** xmlMode + +**`example`** With selfClosingTags: false: <foo></foo> + +**`example`** With selfClosingTags: true: <foo /> + +--- + +### `xmlMode` + +• `Optional` **xmlMode**: _boolean_ \| _"foreign"_ + +Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options. + +If the value is `"foreign"`, it will try to correct mixed-case attribute names. + +**`default`** false + +--- + +## Ecosystem + +| Name | Description | +| ------------------------------------------------------------- | ------------------------------------------------------- | +| [htmlparser2](https://github.com/fb55/htmlparser2) | Fast & forgiving HTML/XML parser | +| [domhandler](https://github.com/fb55/domhandler) | Handler for htmlparser2 that turns documents into a DOM | +| [domutils](https://github.com/fb55/domutils) | Utilities for working with domhandler's DOM | +| [css-select](https://github.com/fb55/css-select) | CSS selector engine, compatible with domhandler's DOM | +| [cheerio](https://github.com/cheeriojs/cheerio) | The jQuery API for domhandler's DOM | +| [dom-serializer](https://github.com/cheeriojs/dom-serializer) | Serializer for domhandler's DOM | + +--- + +LICENSE: MIT diff --git a/node_modules/dom-serializer/lib/esm/foreignNames.d.ts b/node_modules/dom-serializer/lib/esm/foreignNames.d.ts new file mode 100644 index 0000000..a8b0938 --- /dev/null +++ b/node_modules/dom-serializer/lib/esm/foreignNames.d.ts @@ -0,0 +1,3 @@ +export declare const elementNames: Map; +export declare const attributeNames: Map; +//# sourceMappingURL=foreignNames.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map b/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map new file mode 100644 index 0000000..f471fd0 --- /dev/null +++ b/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAwCxB,CAAC;AACF,eAAO,MAAM,cAAc,qBA8D1B,CAAC"} \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/esm/foreignNames.js b/node_modules/dom-serializer/lib/esm/foreignNames.js new file mode 100644 index 0000000..ebd6272 --- /dev/null +++ b/node_modules/dom-serializer/lib/esm/foreignNames.js @@ -0,0 +1,100 @@ +export const elementNames = new Map([ + "altGlyph", + "altGlyphDef", + "altGlyphItem", + "animateColor", + "animateMotion", + "animateTransform", + "clipPath", + "feBlend", + "feColorMatrix", + "feComponentTransfer", + "feComposite", + "feConvolveMatrix", + "feDiffuseLighting", + "feDisplacementMap", + "feDistantLight", + "feDropShadow", + "feFlood", + "feFuncA", + "feFuncB", + "feFuncG", + "feFuncR", + "feGaussianBlur", + "feImage", + "feMerge", + "feMergeNode", + "feMorphology", + "feOffset", + "fePointLight", + "feSpecularLighting", + "feSpotLight", + "feTile", + "feTurbulence", + "foreignObject", + "glyphRef", + "linearGradient", + "radialGradient", + "textPath", +].map((val) => [val.toLowerCase(), val])); +export const attributeNames = new Map([ + "definitionURL", + "attributeName", + "attributeType", + "baseFrequency", + "baseProfile", + "calcMode", + "clipPathUnits", + "diffuseConstant", + "edgeMode", + "filterUnits", + "glyphRef", + "gradientTransform", + "gradientUnits", + "kernelMatrix", + "kernelUnitLength", + "keyPoints", + "keySplines", + "keyTimes", + "lengthAdjust", + "limitingConeAngle", + "markerHeight", + "markerUnits", + "markerWidth", + "maskContentUnits", + "maskUnits", + "numOctaves", + "pathLength", + "patternContentUnits", + "patternTransform", + "patternUnits", + "pointsAtX", + "pointsAtY", + "pointsAtZ", + "preserveAlpha", + "preserveAspectRatio", + "primitiveUnits", + "refX", + "refY", + "repeatCount", + "repeatDur", + "requiredExtensions", + "requiredFeatures", + "specularConstant", + "specularExponent", + "spreadMethod", + "startOffset", + "stdDeviation", + "stitchTiles", + "surfaceScale", + "systemLanguage", + "tableValues", + "targetX", + "targetY", + "textLength", + "viewBox", + "viewTarget", + "xChannelSelector", + "yChannelSelector", + "zoomAndPan", +].map((val) => [val.toLowerCase(), val])); diff --git a/node_modules/dom-serializer/lib/esm/index.d.ts b/node_modules/dom-serializer/lib/esm/index.d.ts new file mode 100644 index 0000000..cdf04f0 --- /dev/null +++ b/node_modules/dom-serializer/lib/esm/index.d.ts @@ -0,0 +1,52 @@ +import type { AnyNode } from "domhandler"; +export interface DomSerializerOptions { + /** + * Print an empty attribute's value. + * + * @default xmlMode + * @example With emptyAttrs: false: <input checked> + * @example With emptyAttrs: true: <input checked=""> + */ + emptyAttrs?: boolean; + /** + * Print self-closing tags for tags without contents. + * + * @default xmlMode + * @example With selfClosingTags: false: <foo></foo> + * @example With selfClosingTags: true: <foo /> + */ + selfClosingTags?: boolean; + /** + * Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options. + * + * If the value is `"foreign"`, it will try to correct mixed-case attribute names. + * + * @default false + */ + xmlMode?: boolean | "foreign"; + /** + * Encode characters that are either reserved in HTML or XML. + * + * If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well. + * + * @default `decodeEntities` + */ + encodeEntities?: boolean | "utf8"; + /** + * Option inherited from parsing; will be used as the default value for `encodeEntities`. + * + * @default true + */ + decodeEntities?: boolean; +} +/** + * Renders a DOM node or an array of DOM nodes to a string. + * + * Can be thought of as the equivalent of the `outerHTML` of the passed node(s). + * + * @param node Node to be rendered. + * @param options Changes serialization behavior + */ +export declare function render(node: AnyNode | ArrayLike, options?: DomSerializerOptions): string; +export default render; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/esm/index.d.ts.map b/node_modules/dom-serializer/lib/esm/index.d.ts.map new file mode 100644 index 0000000..0476a46 --- /dev/null +++ b/node_modules/dom-serializer/lib/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA4ED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,EAClC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/esm/index.js b/node_modules/dom-serializer/lib/esm/index.js new file mode 100644 index 0000000..1ccc9d5 --- /dev/null +++ b/node_modules/dom-serializer/lib/esm/index.js @@ -0,0 +1,190 @@ +/* + * Module dependencies + */ +import * as ElementType from "domelementtype"; +import { encodeXML, escapeAttribute, escapeText } from "entities"; +/** + * Mixed-case SVG and MathML tags & attributes + * recognized by the HTML parser. + * + * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign + */ +import { elementNames, attributeNames } from "./foreignNames.js"; +const unencodedElements = new Set([ + "style", + "script", + "xmp", + "iframe", + "noembed", + "noframes", + "plaintext", + "noscript", +]); +function replaceQuotes(value) { + return value.replace(/"/g, """); +} +/** + * Format attributes + */ +function formatAttributes(attributes, opts) { + var _a; + if (!attributes) + return; + const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false + ? replaceQuotes + : opts.xmlMode || opts.encodeEntities !== "utf8" + ? encodeXML + : escapeAttribute; + return Object.keys(attributes) + .map((key) => { + var _a, _b; + const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : ""; + if (opts.xmlMode === "foreign") { + /* Fix up mixed-case attribute names */ + key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key; + } + if (!opts.emptyAttrs && !opts.xmlMode && value === "") { + return key; + } + return `${key}="${encode(value)}"`; + }) + .join(" "); +} +/** + * Self-enclosing tags + */ +const singleTag = new Set([ + "area", + "base", + "basefont", + "br", + "col", + "command", + "embed", + "frame", + "hr", + "img", + "input", + "isindex", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr", +]); +/** + * Renders a DOM node or an array of DOM nodes to a string. + * + * Can be thought of as the equivalent of the `outerHTML` of the passed node(s). + * + * @param node Node to be rendered. + * @param options Changes serialization behavior + */ +export function render(node, options = {}) { + const nodes = "length" in node ? node : [node]; + let output = ""; + for (let i = 0; i < nodes.length; i++) { + output += renderNode(nodes[i], options); + } + return output; +} +export default render; +function renderNode(node, options) { + switch (node.type) { + case ElementType.Root: + return render(node.children, options); + // @ts-expect-error We don't use `Doctype` yet + case ElementType.Doctype: + case ElementType.Directive: + return renderDirective(node); + case ElementType.Comment: + return renderComment(node); + case ElementType.CDATA: + return renderCdata(node); + case ElementType.Script: + case ElementType.Style: + case ElementType.Tag: + return renderTag(node, options); + case ElementType.Text: + return renderText(node, options); + } +} +const foreignModeIntegrationPoints = new Set([ + "mi", + "mo", + "mn", + "ms", + "mtext", + "annotation-xml", + "foreignObject", + "desc", + "title", +]); +const foreignElements = new Set(["svg", "math"]); +function renderTag(elem, opts) { + var _a; + // Handle SVG / MathML in HTML + if (opts.xmlMode === "foreign") { + /* Fix up mixed-case element names */ + elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name; + /* Exit foreign mode at integration points */ + if (elem.parent && + foreignModeIntegrationPoints.has(elem.parent.name)) { + opts = { ...opts, xmlMode: false }; + } + } + if (!opts.xmlMode && foreignElements.has(elem.name)) { + opts = { ...opts, xmlMode: "foreign" }; + } + let tag = `<${elem.name}`; + const attribs = formatAttributes(elem.attribs, opts); + if (attribs) { + tag += ` ${attribs}`; + } + if (elem.children.length === 0 && + (opts.xmlMode + ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags + opts.selfClosingTags !== false + : // User explicitly asked for self-closing tags, even in HTML mode + opts.selfClosingTags && singleTag.has(elem.name))) { + if (!opts.xmlMode) + tag += " "; + tag += "/>"; + } + else { + tag += ">"; + if (elem.children.length > 0) { + tag += render(elem.children, opts); + } + if (opts.xmlMode || !singleTag.has(elem.name)) { + tag += ``; + } + } + return tag; +} +function renderDirective(elem) { + return `<${elem.data}>`; +} +function renderText(elem, opts) { + var _a; + let data = elem.data || ""; + // If entities weren't decoded, no need to encode them back + if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false && + !(!opts.xmlMode && + elem.parent && + unencodedElements.has(elem.parent.name))) { + data = + opts.xmlMode || opts.encodeEntities !== "utf8" + ? encodeXML(data) + : escapeText(data); + } + return data; +} +function renderCdata(elem) { + return ``; +} +function renderComment(elem) { + return ``; +} diff --git a/node_modules/dom-serializer/lib/esm/package.json b/node_modules/dom-serializer/lib/esm/package.json new file mode 100644 index 0000000..089153b --- /dev/null +++ b/node_modules/dom-serializer/lib/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} diff --git a/node_modules/dom-serializer/lib/foreignNames.d.ts b/node_modules/dom-serializer/lib/foreignNames.d.ts new file mode 100644 index 0000000..a8b0938 --- /dev/null +++ b/node_modules/dom-serializer/lib/foreignNames.d.ts @@ -0,0 +1,3 @@ +export declare const elementNames: Map; +export declare const attributeNames: Map; +//# sourceMappingURL=foreignNames.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/foreignNames.d.ts.map b/node_modules/dom-serializer/lib/foreignNames.d.ts.map new file mode 100644 index 0000000..50e4f26 --- /dev/null +++ b/node_modules/dom-serializer/lib/foreignNames.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAsCvB,CAAC;AACH,eAAO,MAAM,cAAc,qBA4DzB,CAAC"} \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/foreignNames.js b/node_modules/dom-serializer/lib/foreignNames.js new file mode 100644 index 0000000..966253e --- /dev/null +++ b/node_modules/dom-serializer/lib/foreignNames.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.attributeNames = exports.elementNames = void 0; +exports.elementNames = new Map([ + ["altglyph", "altGlyph"], + ["altglyphdef", "altGlyphDef"], + ["altglyphitem", "altGlyphItem"], + ["animatecolor", "animateColor"], + ["animatemotion", "animateMotion"], + ["animatetransform", "animateTransform"], + ["clippath", "clipPath"], + ["feblend", "feBlend"], + ["fecolormatrix", "feColorMatrix"], + ["fecomponenttransfer", "feComponentTransfer"], + ["fecomposite", "feComposite"], + ["feconvolvematrix", "feConvolveMatrix"], + ["fediffuselighting", "feDiffuseLighting"], + ["fedisplacementmap", "feDisplacementMap"], + ["fedistantlight", "feDistantLight"], + ["fedropshadow", "feDropShadow"], + ["feflood", "feFlood"], + ["fefunca", "feFuncA"], + ["fefuncb", "feFuncB"], + ["fefuncg", "feFuncG"], + ["fefuncr", "feFuncR"], + ["fegaussianblur", "feGaussianBlur"], + ["feimage", "feImage"], + ["femerge", "feMerge"], + ["femergenode", "feMergeNode"], + ["femorphology", "feMorphology"], + ["feoffset", "feOffset"], + ["fepointlight", "fePointLight"], + ["fespecularlighting", "feSpecularLighting"], + ["fespotlight", "feSpotLight"], + ["fetile", "feTile"], + ["feturbulence", "feTurbulence"], + ["foreignobject", "foreignObject"], + ["glyphref", "glyphRef"], + ["lineargradient", "linearGradient"], + ["radialgradient", "radialGradient"], + ["textpath", "textPath"], +]); +exports.attributeNames = new Map([ + ["definitionurl", "definitionURL"], + ["attributename", "attributeName"], + ["attributetype", "attributeType"], + ["basefrequency", "baseFrequency"], + ["baseprofile", "baseProfile"], + ["calcmode", "calcMode"], + ["clippathunits", "clipPathUnits"], + ["diffuseconstant", "diffuseConstant"], + ["edgemode", "edgeMode"], + ["filterunits", "filterUnits"], + ["glyphref", "glyphRef"], + ["gradienttransform", "gradientTransform"], + ["gradientunits", "gradientUnits"], + ["kernelmatrix", "kernelMatrix"], + ["kernelunitlength", "kernelUnitLength"], + ["keypoints", "keyPoints"], + ["keysplines", "keySplines"], + ["keytimes", "keyTimes"], + ["lengthadjust", "lengthAdjust"], + ["limitingconeangle", "limitingConeAngle"], + ["markerheight", "markerHeight"], + ["markerunits", "markerUnits"], + ["markerwidth", "markerWidth"], + ["maskcontentunits", "maskContentUnits"], + ["maskunits", "maskUnits"], + ["numoctaves", "numOctaves"], + ["pathlength", "pathLength"], + ["patterncontentunits", "patternContentUnits"], + ["patterntransform", "patternTransform"], + ["patternunits", "patternUnits"], + ["pointsatx", "pointsAtX"], + ["pointsaty", "pointsAtY"], + ["pointsatz", "pointsAtZ"], + ["preservealpha", "preserveAlpha"], + ["preserveaspectratio", "preserveAspectRatio"], + ["primitiveunits", "primitiveUnits"], + ["refx", "refX"], + ["refy", "refY"], + ["repeatcount", "repeatCount"], + ["repeatdur", "repeatDur"], + ["requiredextensions", "requiredExtensions"], + ["requiredfeatures", "requiredFeatures"], + ["specularconstant", "specularConstant"], + ["specularexponent", "specularExponent"], + ["spreadmethod", "spreadMethod"], + ["startoffset", "startOffset"], + ["stddeviation", "stdDeviation"], + ["stitchtiles", "stitchTiles"], + ["surfacescale", "surfaceScale"], + ["systemlanguage", "systemLanguage"], + ["tablevalues", "tableValues"], + ["targetx", "targetX"], + ["targety", "targetY"], + ["textlength", "textLength"], + ["viewbox", "viewBox"], + ["viewtarget", "viewTarget"], + ["xchannelselector", "xChannelSelector"], + ["ychannelselector", "yChannelSelector"], + ["zoomandpan", "zoomAndPan"], +]); diff --git a/node_modules/dom-serializer/lib/index.d.ts b/node_modules/dom-serializer/lib/index.d.ts new file mode 100644 index 0000000..84f6d16 --- /dev/null +++ b/node_modules/dom-serializer/lib/index.d.ts @@ -0,0 +1,43 @@ +import type { Node } from "domhandler"; +export interface DomSerializerOptions { + /** + * Print an empty attribute's value. + * + * @default xmlMode + * @example With emptyAttrs: false: <input checked> + * @example With emptyAttrs: true: <input checked=""> + */ + emptyAttrs?: boolean; + /** + * Print self-closing tags for tags without contents. + * + * @default xmlMode + * @example With selfClosingTags: false: <foo></foo> + * @example With selfClosingTags: true: <foo /> + */ + selfClosingTags?: boolean; + /** + * Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options. + * + * If the value is `"foreign"`, it will try to correct mixed-case attribute names. + * + * @default false + */ + xmlMode?: boolean | "foreign"; + /** + * Encode characters that are either reserved in HTML or XML, or are outside of the ASCII range. + * + * @default true + */ + decodeEntities?: boolean; +} +/** + * Renders a DOM node or an array of DOM nodes to a string. + * + * Can be thought of as the equivalent of the `outerHTML` of the passed node(s). + * + * @param node Node to be rendered. + * @param options Changes serialization behavior + */ +export default function render(node: Node | ArrayLike, options?: DomSerializerOptions): string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/index.d.ts.map b/node_modules/dom-serializer/lib/index.d.ts.map new file mode 100644 index 0000000..c04bdd4 --- /dev/null +++ b/node_modules/dom-serializer/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAuC,MAAM,YAAY,CAAC;AAW5E,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAqED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,EAC5B,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR"} \ No newline at end of file diff --git a/node_modules/dom-serializer/lib/index.js b/node_modules/dom-serializer/lib/index.js new file mode 100644 index 0000000..a5e1f93 --- /dev/null +++ b/node_modules/dom-serializer/lib/index.js @@ -0,0 +1,211 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/* + * Module dependencies + */ +var ElementType = __importStar(require("domelementtype")); +var entities_1 = require("entities"); +/** + * Mixed-case SVG and MathML tags & attributes + * recognized by the HTML parser. + * + * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign + */ +var foreignNames_1 = require("./foreignNames"); +var unencodedElements = new Set([ + "style", + "script", + "xmp", + "iframe", + "noembed", + "noframes", + "plaintext", + "noscript", +]); +/** + * Format attributes + */ +function formatAttributes(attributes, opts) { + if (!attributes) + return; + return Object.keys(attributes) + .map(function (key) { + var _a, _b; + var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : ""; + if (opts.xmlMode === "foreign") { + /* Fix up mixed-case attribute names */ + key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key; + } + if (!opts.emptyAttrs && !opts.xmlMode && value === "") { + return key; + } + return key + "=\"" + (opts.decodeEntities !== false + ? entities_1.encodeXML(value) + : value.replace(/"/g, """)) + "\""; + }) + .join(" "); +} +/** + * Self-enclosing tags + */ +var singleTag = new Set([ + "area", + "base", + "basefont", + "br", + "col", + "command", + "embed", + "frame", + "hr", + "img", + "input", + "isindex", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr", +]); +/** + * Renders a DOM node or an array of DOM nodes to a string. + * + * Can be thought of as the equivalent of the `outerHTML` of the passed node(s). + * + * @param node Node to be rendered. + * @param options Changes serialization behavior + */ +function render(node, options) { + if (options === void 0) { options = {}; } + var nodes = "length" in node ? node : [node]; + var output = ""; + for (var i = 0; i < nodes.length; i++) { + output += renderNode(nodes[i], options); + } + return output; +} +exports.default = render; +function renderNode(node, options) { + switch (node.type) { + case ElementType.Root: + return render(node.children, options); + case ElementType.Directive: + case ElementType.Doctype: + return renderDirective(node); + case ElementType.Comment: + return renderComment(node); + case ElementType.CDATA: + return renderCdata(node); + case ElementType.Script: + case ElementType.Style: + case ElementType.Tag: + return renderTag(node, options); + case ElementType.Text: + return renderText(node, options); + } +} +var foreignModeIntegrationPoints = new Set([ + "mi", + "mo", + "mn", + "ms", + "mtext", + "annotation-xml", + "foreignObject", + "desc", + "title", +]); +var foreignElements = new Set(["svg", "math"]); +function renderTag(elem, opts) { + var _a; + // Handle SVG / MathML in HTML + if (opts.xmlMode === "foreign") { + /* Fix up mixed-case element names */ + elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name; + /* Exit foreign mode at integration points */ + if (elem.parent && + foreignModeIntegrationPoints.has(elem.parent.name)) { + opts = __assign(__assign({}, opts), { xmlMode: false }); + } + } + if (!opts.xmlMode && foreignElements.has(elem.name)) { + opts = __assign(__assign({}, opts), { xmlMode: "foreign" }); + } + var tag = "<" + elem.name; + var attribs = formatAttributes(elem.attribs, opts); + if (attribs) { + tag += " " + attribs; + } + if (elem.children.length === 0 && + (opts.xmlMode + ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags + opts.selfClosingTags !== false + : // User explicitly asked for self-closing tags, even in HTML mode + opts.selfClosingTags && singleTag.has(elem.name))) { + if (!opts.xmlMode) + tag += " "; + tag += "/>"; + } + else { + tag += ">"; + if (elem.children.length > 0) { + tag += render(elem.children, opts); + } + if (opts.xmlMode || !singleTag.has(elem.name)) { + tag += ""; + } + } + return tag; +} +function renderDirective(elem) { + return "<" + elem.data + ">"; +} +function renderText(elem, opts) { + var data = elem.data || ""; + // If entities weren't decoded, no need to encode them back + if (opts.decodeEntities !== false && + !(!opts.xmlMode && + elem.parent && + unencodedElements.has(elem.parent.name))) { + data = entities_1.encodeXML(data); + } + return data; +} +function renderCdata(elem) { + return ""; +} +function renderComment(elem) { + return ""; +} diff --git a/node_modules/dom-serializer/node_modules/entities/LICENSE b/node_modules/dom-serializer/node_modules/entities/LICENSE new file mode 100644 index 0000000..c464f86 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/LICENSE @@ -0,0 +1,11 @@ +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts b/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts new file mode 100644 index 0000000..4d3df42 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts @@ -0,0 +1,5 @@ +export declare const decodeXML: (str: string) => string; +export declare const decodeHTMLStrict: (str: string) => string; +export declare type MapType = Record; +export declare const decodeHTML: (str: string) => string; +//# sourceMappingURL=decode.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map b/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map new file mode 100644 index 0000000..ebcf133 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS,QAOL,MAAM,WAP0B,CAAC;AAClD,eAAO,MAAM,gBAAgB,QAMZ,MAAM,WANoC,CAAC;AAE5D,oBAAY,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAS7C,eAAO,MAAM,UAAU,QAyBN,MAAM,WACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/decode.js b/node_modules/dom-serializer/node_modules/entities/lib/decode.js new file mode 100644 index 0000000..5f9c1f2 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/decode.js @@ -0,0 +1,53 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0; +var entities_json_1 = __importDefault(require("./maps/entities.json")); +var legacy_json_1 = __importDefault(require("./maps/legacy.json")); +var xml_json_1 = __importDefault(require("./maps/xml.json")); +var decode_codepoint_1 = __importDefault(require("./decode_codepoint")); +var strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g; +exports.decodeXML = getStrictDecoder(xml_json_1.default); +exports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default); +function getStrictDecoder(map) { + var replace = getReplacer(map); + return function (str) { return String(str).replace(strictEntityRe, replace); }; +} +var sorter = function (a, b) { return (a < b ? 1 : -1); }; +exports.decodeHTML = (function () { + var legacy = Object.keys(legacy_json_1.default).sort(sorter); + var keys = Object.keys(entities_json_1.default).sort(sorter); + for (var i = 0, j = 0; i < keys.length; i++) { + if (legacy[j] === keys[i]) { + keys[i] += ";?"; + j++; + } + else { + keys[i] += ";"; + } + } + var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"); + var replace = getReplacer(entities_json_1.default); + function replacer(str) { + if (str.substr(-1) !== ";") + str += ";"; + return replace(str); + } + // TODO consider creating a merged map + return function (str) { return String(str).replace(re, replacer); }; +})(); +function getReplacer(map) { + return function replace(str) { + if (str.charAt(1) === "#") { + var secondChar = str.charAt(2); + if (secondChar === "X" || secondChar === "x") { + return decode_codepoint_1.default(parseInt(str.substr(3), 16)); + } + return decode_codepoint_1.default(parseInt(str.substr(2), 10)); + } + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + return map[str.slice(1, -1)] || str; + }; +} diff --git a/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts b/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts new file mode 100644 index 0000000..6b72eaa --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts @@ -0,0 +1,2 @@ +export default function decodeCodePoint(codePoint: number): string; +//# sourceMappingURL=decode_codepoint.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map b/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map new file mode 100644 index 0000000..b765ae0 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"","sources":["../src/decode_codepoint.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAUjE"} \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js b/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js new file mode 100644 index 0000000..63efe19 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js @@ -0,0 +1,30 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var decode_json_1 = __importDefault(require("./maps/decode.json")); +// Adapted from https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119 +var fromCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition +String.fromCodePoint || + function (codePoint) { + var output = ""; + if (codePoint > 0xffff) { + codePoint -= 0x10000; + output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); + codePoint = 0xdc00 | (codePoint & 0x3ff); + } + output += String.fromCharCode(codePoint); + return output; + }; +function decodeCodePoint(codePoint) { + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return "\uFFFD"; + } + if (codePoint in decode_json_1.default) { + codePoint = decode_json_1.default[codePoint]; + } + return fromCodePoint(codePoint); +} +exports.default = decodeCodePoint; diff --git a/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts b/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts new file mode 100644 index 0000000..8e346d8 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts @@ -0,0 +1,47 @@ +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using XML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +export declare const encodeXML: (data: string) => string; +/** + * Encodes all entities and non-ASCII characters in the input. + * + * This includes characters that are valid ASCII characters in HTML documents. + * For example `#` will be encoded as `#`. To get a more compact output, + * consider using the `encodeNonAsciiHTML` function. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +export declare const encodeHTML: (data: string) => string; +/** + * Encodes all non-ASCII characters, as well as characters not valid in HTML + * documents using HTML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +export declare const encodeNonAsciiHTML: (data: string) => string; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using numeric hexadecimal reference (eg. `ü`). + * + * Have a look at `escapeUTF8` if you want a more concise output at the expense + * of reduced transportability. + * + * @param data String to escape. + */ +export declare function escape(data: string): string; +/** + * Encodes all characters not valid in XML documents using numeric hexadecimal + * reference (eg. `ü`). + * + * Note that the output will be character-set dependent. + * + * @param data String to escape. + */ +export declare function escapeUTF8(data: string): string; +//# sourceMappingURL=encode.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map b/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map new file mode 100644 index 0000000..0b075fd --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,SAwIJ,MAAM,WAxI4B,CAAC;AAOrD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,SAkFL,MAAM,WAlFuC,CAAC;AAChE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SA+Gb,MAAM,WA/GsC,CAAC;AAqF/D;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C"} \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/encode.js b/node_modules/dom-serializer/node_modules/entities/lib/encode.js new file mode 100644 index 0000000..d11b238 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/encode.js @@ -0,0 +1,136 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0; +var xml_json_1 = __importDefault(require("./maps/xml.json")); +var inverseXML = getInverseObj(xml_json_1.default); +var xmlReplacer = getInverseReplacer(inverseXML); +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using XML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +exports.encodeXML = getASCIIEncoder(inverseXML); +var entities_json_1 = __importDefault(require("./maps/entities.json")); +var inverseHTML = getInverseObj(entities_json_1.default); +var htmlReplacer = getInverseReplacer(inverseHTML); +/** + * Encodes all entities and non-ASCII characters in the input. + * + * This includes characters that are valid ASCII characters in HTML documents. + * For example `#` will be encoded as `#`. To get a more compact output, + * consider using the `encodeNonAsciiHTML` function. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +exports.encodeHTML = getInverse(inverseHTML, htmlReplacer); +/** + * Encodes all non-ASCII characters, as well as characters not valid in HTML + * documents using HTML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +exports.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML); +function getInverseObj(obj) { + return Object.keys(obj) + .sort() + .reduce(function (inverse, name) { + inverse[obj[name]] = "&" + name + ";"; + return inverse; + }, {}); +} +function getInverseReplacer(inverse) { + var single = []; + var multiple = []; + for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) { + var k = _a[_i]; + if (k.length === 1) { + // Add value to single array + single.push("\\" + k); + } + else { + // Add value to multiple array + multiple.push(k); + } + } + // Add ranges to single characters. + single.sort(); + for (var start = 0; start < single.length - 1; start++) { + // Find the end of a run of characters + var end = start; + while (end < single.length - 1 && + single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) { + end += 1; + } + var count = 1 + end - start; + // We want to replace at least three characters + if (count < 3) + continue; + single.splice(start, count, single[start] + "-" + single[end]); + } + multiple.unshift("[" + single.join("") + "]"); + return new RegExp(multiple.join("|"), "g"); +} +// /[^\0-\x7F]/gu +var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g; +var getCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition +String.prototype.codePointAt != null + ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + function (str) { return str.codePointAt(0); } + : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + function (c) { + return (c.charCodeAt(0) - 0xd800) * 0x400 + + c.charCodeAt(1) - + 0xdc00 + + 0x10000; + }; +function singleCharReplacer(c) { + return "&#x" + (c.length > 1 ? getCodePoint(c) : c.charCodeAt(0)) + .toString(16) + .toUpperCase() + ";"; +} +function getInverse(inverse, re) { + return function (data) { + return data + .replace(re, function (name) { return inverse[name]; }) + .replace(reNonASCII, singleCharReplacer); + }; +} +var reEscapeChars = new RegExp(xmlReplacer.source + "|" + reNonASCII.source, "g"); +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using numeric hexadecimal reference (eg. `ü`). + * + * Have a look at `escapeUTF8` if you want a more concise output at the expense + * of reduced transportability. + * + * @param data String to escape. + */ +function escape(data) { + return data.replace(reEscapeChars, singleCharReplacer); +} +exports.escape = escape; +/** + * Encodes all characters not valid in XML documents using numeric hexadecimal + * reference (eg. `ü`). + * + * Note that the output will be character-set dependent. + * + * @param data String to escape. + */ +function escapeUTF8(data) { + return data.replace(xmlReplacer, singleCharReplacer); +} +exports.escapeUTF8 = escapeUTF8; +function getASCIIEncoder(obj) { + return function (data) { + return data.replace(reEscapeChars, function (c) { return obj[c] || singleCharReplacer(c); }); + }; +} diff --git a/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts b/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts new file mode 100644 index 0000000..68c8cd5 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts @@ -0,0 +1,27 @@ +/** + * Decodes a string with entities. + * + * @param data String to decode. + * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0. + * @deprecated Use `decodeXML` or `decodeHTML` directly. + */ +export declare function decode(data: string, level?: number): string; +/** + * Decodes a string with entities. Does not allow missing trailing semicolons for entities. + * + * @param data String to decode. + * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0. + * @deprecated Use `decodeHTMLStrict` or `decodeXML` directly. + */ +export declare function decodeStrict(data: string, level?: number): string; +/** + * Encodes a string with entities. + * + * @param data String to encode. + * @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0. + * @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly. + */ +export declare function encode(data: string, level?: number): string; +export { encodeXML, encodeHTML, encodeNonAsciiHTML, escape, escapeUTF8, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode"; +export { decodeXML, decodeHTML, decodeHTMLStrict, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map b/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map new file mode 100644 index 0000000..24b32ca --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,OAAO,EACH,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,UAAU,EAEV,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,UAAU,CAAC;AAElB,OAAO,EACH,SAAS,EACT,UAAU,EACV,gBAAgB,EAEhB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/dom-serializer/node_modules/entities/lib/index.js b/node_modules/dom-serializer/node_modules/entities/lib/index.js new file mode 100644 index 0000000..1b8c3da --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/index.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = void 0; +var decode_1 = require("./decode"); +var encode_1 = require("./encode"); +/** + * Decodes a string with entities. + * + * @param data String to decode. + * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0. + * @deprecated Use `decodeXML` or `decodeHTML` directly. + */ +function decode(data, level) { + return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data); +} +exports.decode = decode; +/** + * Decodes a string with entities. Does not allow missing trailing semicolons for entities. + * + * @param data String to decode. + * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0. + * @deprecated Use `decodeHTMLStrict` or `decodeXML` directly. + */ +function decodeStrict(data, level) { + return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data); +} +exports.decodeStrict = decodeStrict; +/** + * Encodes a string with entities. + * + * @param data String to encode. + * @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0. + * @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly. + */ +function encode(data, level) { + return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data); +} +exports.encode = encode; +var encode_2 = require("./encode"); +Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return encode_2.encodeXML; } }); +Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_2.encodeHTML; } }); +Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } }); +Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return encode_2.escape; } }); +Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return encode_2.escapeUTF8; } }); +// Legacy aliases (deprecated) +Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_2.encodeHTML; } }); +Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_2.encodeHTML; } }); +var decode_2 = require("./decode"); +Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_2.decodeXML; } }); +Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_2.decodeHTML; } }); +Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } }); +// Legacy aliases (deprecated) +Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_2.decodeHTML; } }); +Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_2.decodeHTML; } }); +Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } }); +Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } }); +Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_2.decodeXML; } }); diff --git a/node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json b/node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json new file mode 100644 index 0000000..80ef449 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json @@ -0,0 +1 @@ +{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376} diff --git a/node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json b/node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json new file mode 100644 index 0000000..c5b1c4e --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json @@ -0,0 +1 @@ +{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\"","QUOT":"\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"} diff --git a/node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json b/node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json new file mode 100644 index 0000000..43dbea6 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json @@ -0,0 +1 @@ +{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\"","QUOT":"\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"} diff --git a/node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json b/node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json new file mode 100644 index 0000000..de8db10 --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json @@ -0,0 +1 @@ +{"amp":"&","apos":"'","gt":">","lt":"<","quot":"\""} diff --git a/node_modules/dom-serializer/node_modules/entities/package.json b/node_modules/dom-serializer/node_modules/entities/package.json new file mode 100644 index 0000000..cb9aedd --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/package.json @@ -0,0 +1,64 @@ +{ + "name": "entities", + "version": "2.2.0", + "description": "Encode & decode XML and HTML entities with ease", + "author": "Felix Boehm ", + "funding": "https://github.com/fb55/entities?sponsor=1", + "sideEffects": false, + "keywords": [ + "entity", + "decoding", + "encoding", + "html", + "xml", + "html entities" + ], + "directories": { + "lib": "lib/" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib/**/*" + ], + "devDependencies": { + "@types/jest": "^26.0.0", + "@types/node": "^14.11.8", + "@typescript-eslint/eslint-plugin": "^4.4.1", + "@typescript-eslint/parser": "^4.4.1", + "coveralls": "*", + "eslint": "^7.11.0", + "eslint-config-prettier": "^7.0.0", + "eslint-plugin-node": "^11.1.0", + "jest": "^26.5.3", + "prettier": "^2.0.5", + "ts-jest": "^26.1.0", + "typescript": "^4.0.2" + }, + "scripts": { + "test": "jest --coverage && npm run lint", + "coverage": "cat coverage/lcov.info | coveralls", + "lint": "npm run lint:es && npm run lint:prettier", + "lint:es": "eslint .", + "lint:prettier": "npm run prettier -- --check", + "format": "npm run format:es && npm run format:prettier", + "format:es": "npm run lint:es -- --fix", + "format:prettier": "npm run prettier -- --write", + "prettier": "prettier '**/*.{ts,md,json,yml}'", + "build": "tsc && cp -r src/maps lib", + "prepare": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/fb55/entities.git" + }, + "license": "BSD-2-Clause", + "jest": { + "preset": "ts-jest", + "testEnvironment": "node" + }, + "prettier": { + "tabWidth": 4, + "proseWrap": "always" + } +} diff --git a/node_modules/dom-serializer/node_modules/entities/readme.md b/node_modules/dom-serializer/node_modules/entities/readme.md new file mode 100644 index 0000000..f69264a --- /dev/null +++ b/node_modules/dom-serializer/node_modules/entities/readme.md @@ -0,0 +1,57 @@ +# entities [![NPM version](http://img.shields.io/npm/v/entities.svg)](https://npmjs.org/package/entities) [![Downloads](https://img.shields.io/npm/dm/entities.svg)](https://npmjs.org/package/entities) [![Build Status](http://img.shields.io/travis/fb55/entities.svg)](http://travis-ci.org/fb55/entities) [![Coverage](http://img.shields.io/coveralls/fb55/entities.svg)](https://coveralls.io/r/fb55/entities) + +Encode & decode HTML & XML entities with ease & speed. + +## How to… + +### …install `entities` + + npm install entities + +### …use `entities` + +```javascript +const entities = require("entities"); + +//encoding +entities.escape("&"); // "&#38;" +entities.encodeXML("&"); // "&#38;" +entities.encodeHTML("&"); // "&#38;" + +//decoding +entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '" +entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '" +``` + +## Performance + +This is how `entities` compares to other libraries on a very basic benchmark +(see `scripts/benchmark.ts`, for 10,000,000 iterations): + +| Library | `decode` performance | `encode` performance | Bundle size | +| -------------- | -------------------- | -------------------- | -------------------------------------------------------------------------- | +| entities | 10.809s | 17.683s | ![npm bundle size](https://img.shields.io/bundlephobia/min/entities) | +| html-entities | 14.029s | 22.670s | ![npm bundle size](https://img.shields.io/bundlephobia/min/html-entities) | +| he | 16.163s | 44.010s | ![npm bundle size](https://img.shields.io/bundlephobia/min/he) | +| parse-entities | 28.507s | N/A | ![npm bundle size](https://img.shields.io/bundlephobia/min/parse-entities) | + +--- + +License: BSD-2-Clause + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). Tidelift will +coordinate the fix and disclosure. + +## `entities` for enterprise + +Available as part of the Tidelift Subscription + +The maintainers of `entities` and thousands of other packages are working with +Tidelift to deliver commercial support and maintenance for the open source +dependencies you use to build your applications. Save time, reduce risk, and +improve code health, while paying the maintainers of the exact dependencies you +use. +[Learn more.](https://tidelift.com/subscription/pkg/npm-entities?utm_source=npm-entities&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/dom-serializer/package.json b/node_modules/dom-serializer/package.json new file mode 100644 index 0000000..219922d --- /dev/null +++ b/node_modules/dom-serializer/package.json @@ -0,0 +1,55 @@ +{ + "name": "dom-serializer", + "version": "1.4.1", + "description": "render domhandler DOM nodes to a string", + "author": "Felix Boehm ", + "sideEffects": false, + "keywords": [ + "html", + "xml", + "render" + ], + "repository": { + "type": "git", + "url": "git://github.com/cheeriojs/dom-renderer.git" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib/**/*" + ], + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + }, + "devDependencies": { + "@types/jest": "^26.0.23", + "@types/node": "^15.3.0", + "@typescript-eslint/eslint-plugin": "^4.23.0", + "@typescript-eslint/parser": "^4.23.0", + "cheerio": "^1.0.0-rc.9", + "coveralls": "^3.0.5", + "eslint": "^7.26.0", + "eslint-config-prettier": "^8.3.0", + "htmlparser2": "^6.1.0", + "jest": "^26.0.1", + "prettier": "^2.3.0", + "ts-jest": "^26.5.6", + "typescript": "^4.0.2" + }, + "scripts": { + "test": "jest --coverage && npm run lint", + "coverage": "cat coverage/lcov.info | coveralls", + "lint": "eslint src", + "format": "prettier --write '**/*.{ts,md,json}'", + "build": "tsc", + "prepare": "npm run build" + }, + "jest": { + "preset": "ts-jest", + "testEnvironment": "node" + }, + "funding": "https://github.com/cheeriojs/dom-serializer?sponsor=1", + "license": "MIT" +} diff --git a/node_modules/domelementtype/LICENSE b/node_modules/domelementtype/LICENSE new file mode 100644 index 0000000..c464f86 --- /dev/null +++ b/node_modules/domelementtype/LICENSE @@ -0,0 +1,11 @@ +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/domelementtype/lib/esm/index.d.ts b/node_modules/domelementtype/lib/esm/index.d.ts new file mode 100644 index 0000000..72fa4f8 --- /dev/null +++ b/node_modules/domelementtype/lib/esm/index.d.ts @@ -0,0 +1,48 @@ +/** Types of elements found in htmlparser2's DOM */ +export declare enum ElementType { + /** Type for the root element of a document */ + Root = "root", + /** Type for Text */ + Text = "text", + /** Type for */ + Directive = "directive", + /** Type for */ + Comment = "comment", + /** Type for "; +const handler = new DomHandler((error, dom) => { + if (error) { + // Handle error + } else { + // Parsing completed, do something + console.log(dom); + } +}); +const parser = new Parser(handler); +parser.write(rawHtml); +parser.end(); +``` + +Output: + +```javascript +[ + { + data: "Xyz ", + type: "text", + }, + { + type: "script", + name: "script", + attribs: { + language: "javascript", + }, + children: [ + { + data: "var foo = '';<", + type: "text", + }, + ], + }, + { + data: "' is a single-line comment + this.index += 3; + var comment = this.skipSingleLineComment(3); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (ch === 0x3C && !this.isModule) { + if (this.source.slice(this.index + 1, this.index + 4) === '!--') { + this.index += 4; // ` regexps + set = set.map((s, si, set) => s.map(this.parse, this)) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(s => s.indexOf(false) === -1) + + this.debug(this.pattern, set) + + this.set = set + } + + parseNegate () { + if (this.options.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) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: 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. + /* istanbul ignore if */ + if (p === false) return false + + 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. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + 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 /* istanbul ignore 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] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') + } + + braceExpand () { + return braceExpand(this.pattern, this.options) + } + + parse (pattern, isSub) { + assertValidPattern(pattern) + + const options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + let re = '' + let hasMagic = false + let escaping = false + // ? => one single character + const patternListStack = [] + const negativeLists = [] + let stateChar + let inClass = false + let reClassStart = -1 + let classStart = -1 + let cs + let pl + let sp + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. However, if the pattern + // starts with ., then traversal patterns can match. + let dotTravAllowed = pattern.charAt(0) === '.' + let dotFileAllowed = options.dot || dotTravAllowed + const patternStart = () => + dotTravAllowed + ? '' + : dotFileAllowed + ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' + : '(?!\\.)' + const subPatternStart = (p) => + p.charAt(0) === '.' + ? '' + : options.dot + ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' + : '(?!\\.)' + + + const clearStateChar = () => { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + this.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping) { + /* istanbul ignore next - completely not allowed, even escaped. */ + if (c === '/') { + return false + } + + if (reSpecials[c]) { + re += '\\' + } + re += c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // Should already be path-split by now. + return false + } + + case '\\': + if (inClass && pattern.charAt(i + 1) === '-') { + re += c + continue + } + + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + this.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': { + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + const plEntry = { + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close, + } + this.debug(this.pattern, '\t', plEntry) + patternListStack.push(plEntry) + // negation is (?:(?!(?:js)(?:))[^/]*) + re += plEntry.open + // next entry starts with a dot maybe? + if (plEntry.start === 0 && plEntry.type !== '!') { + dotTravAllowed = true + re += subPatternStart(pattern.slice(i + 1)) + } + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + } + + case ')': { + const plEntry = patternListStack[patternListStack.length - 1] + if (inClass || !plEntry) { + re += '\\)' + continue + } + patternListStack.pop() + + // closing an extglob + clearStateChar() + hasMagic = true + pl = plEntry + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(Object.assign(pl, { reEnd: re.length })) + } + continue + } + + case '|': { + const plEntry = patternListStack[patternListStack.length - 1] + if (inClass || !plEntry) { + re += '\\|' + continue + } + + clearStateChar() + re += '|' + // next subpattern can start with a dot? + if (plEntry.start === 0 && plEntry.type !== '!') { + dotTravAllowed = true + re += subPatternStart(pattern.slice(i + 1)) + } + continue + } + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + continue + } + + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + braExpEscape(charUnescape(cs)) + ']') + // looks good, finish up the class. + re += c + } catch (er) { + // out of order ranges in JS are errors, but in glob syntax, + // they're just a range that matches nothing. + re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever + } + hasMagic = true + inClass = false + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (reSpecials[c] && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + break + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.slice(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substring(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + let tail + tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { + /* istanbul ignore else - should already be done */ + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + const t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + const addPatternStart = addPatternStartSet[re.charAt(0)] + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (let n = negativeLists.length - 1; n > -1; n--) { + const nl = negativeLists[n] + + const nlBefore = re.slice(0, nl.reStart) + const nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + let nlAfter = re.slice(nl.reEnd) + const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + const closeParensBefore = nlBefore.split(')').length + const openParensBefore = nlBefore.split('(').length - closeParensBefore + let cleanAfter = nlAfter + for (let i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\/)' : '' + + re = nlBefore + nlFirst + nlAfter + dollar + nlLast + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart() + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // if it's nocase, and the lcase/uppercase don't match, it's magic + if (options.nocase && !hasMagic) { + hasMagic = pattern.toUpperCase() !== pattern.toLowerCase() + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + const flags = options.nocase ? 'i' : '' + try { + return Object.assign(new RegExp('^' + re + '$', flags), { + _glob: pattern, + _src: re, + }) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + } + + 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 ? star + : options.dot ? twoStarDot + : twoStarNoDot + const flags = options.nocase ? 'i' : '' + + // coalesce globstars and regexpify non-globstar patterns + // if it's the only item, then we just do one twoStar + // if it's the first, and there are more, prepend (\/|twoStar\/)? to next + // if it's the last, append (\/twoStar|) to previous + // if it's in the middle, append (\/|\/twoStar\/) to previous + // then filter out GLOBSTAR symbols + let re = set.map(pattern => { + pattern = pattern.map(p => + typeof p === 'string' ? regExpEscape(p) + : p === GLOBSTAR ? GLOBSTAR + : p._src + ).reduce((set, p) => { + if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) { + set.push(p) + } + return set + }, []) + pattern.forEach((p, i) => { + if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) { + return + } + if (i === 0) { + if (pattern.length > 1) { + pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1] + } else { + pattern[i] = twoStar + } + } else if (i === pattern.length - 1) { + pattern[i-1] += '(?:\\\/|' + twoStar + ')?' + } else { + pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1] + pattern[i+1] = GLOBSTAR + } + }) + return pattern.filter(p => p !== GLOBSTAR).join('/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp + } + + 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 (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // 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 + for (let i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (let i = 0; i < set.length; i++) { + const pattern = set[i] + let file = f + 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 + } +} + +minimatch.Minimatch = Minimatch diff --git a/node_modules/filelist/node_modules/minimatch/package.json b/node_modules/filelist/node_modules/minimatch/package.json new file mode 100644 index 0000000..c8809db --- /dev/null +++ b/node_modules/filelist/node_modules/minimatch/package.json @@ -0,0 +1,35 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "publishConfig": { + "tag": "legacy-v5" + }, + "version": "5.1.6", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "engines": { + "node": ">=10" + }, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "devDependencies": { + "tap": "^16.3.2" + }, + "license": "ISC", + "files": [ + "minimatch.js", + "lib" + ] +} diff --git a/node_modules/filelist/package.json b/node_modules/filelist/package.json new file mode 100644 index 0000000..8a90586 --- /dev/null +++ b/node_modules/filelist/package.json @@ -0,0 +1,28 @@ +{ + "name": "filelist", + "version": "1.0.4", + "description": "Lazy-evaluating list of files, based on globs or regex patterns", + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "test": "jake test" + }, + "repository": { + "type": "git", + "url": "git://github.com/mde/filelist.git" + }, + "keywords": [ + "file", + "utility", + "glob" + ], + "author": "Matthew Eernisse (http://fleegix.org)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/mde/filelist/issues" + }, + "homepage": "https://github.com/mde/filelist", + "dependencies": { + "minimatch": "^5.0.1" + } +} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE new file mode 100644 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/fill-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +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. diff --git a/node_modules/fill-range/README.md b/node_modules/fill-range/README.md new file mode 100644 index 0000000..8d756fe --- /dev/null +++ b/node_modules/fill-range/README.md @@ -0,0 +1,237 @@ +# fill-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) + +> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fill-range +``` + +## Usage + +Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_. + +```js +const fill = require('fill-range'); +// fill(from, to[, step, options]); + +console.log(fill('1', '10')); //=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] +console.log(fill('1', '10', { toRegex: true })); //=> [1-9]|10 +``` + +**Params** + +* `from`: **{String|Number}** the number or letter to start with +* `to`: **{String|Number}** the number or letter to end with +* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use. +* `options`: **{Object|Function}**: See all available [options](#options) + +## Examples + +By default, an array of values is returned. + +**Alphabetical ranges** + +```js +console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e'] +console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ] +``` + +**Numerical ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ] +``` + +**Negative ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ] +console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ] +``` + +**Steps (increments)** + +```js +// numerical ranges with increments +console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ] +console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ] +console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ] + +// alphabetical ranges with increments +console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ] +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ] +``` + +## Options + +### options.step + +**Type**: `number` (formatted as a string or number) + +**Default**: `undefined` + +**Description**: The increment to use for the range. Can be used with letters or numbers. + +**Example(s)** + +```js +// numbers +console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ] +console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ] +console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ] + +// letters +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ] +console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ] +``` + +### options.strictRanges + +**Type**: `boolean` + +**Default**: `false` + +**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges. + +**Example(s)** + +The following are all invalid: + +```js +fill('1.1', '2'); // decimals not supported in ranges +fill('a', '2'); // incompatible range values +fill(1, 10, 'foo'); // invalid "step" argument +``` + +### options.stringify + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Cast all returned values to strings. By default, integers are returned as numbers. + +**Example(s)** + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill(1, 5, { stringify: true })); //=> [ '1', '2', '3', '4', '5' ] +``` + +### options.toRegex + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Create a regex-compatible source string, instead of expanding values to an array. + +**Example(s)** + +```js +// alphabetical range +console.log(fill('a', 'e', { toRegex: true })); //=> '[a-e]' +// alphabetical with step +console.log(fill('a', 'z', 3, { toRegex: true })); //=> 'a|d|g|j|m|p|s|v|y' +// numerical range +console.log(fill('1', '100', { toRegex: true })); //=> '[1-9]|[1-9][0-9]|100' +// numerical range with zero padding +console.log(fill('000001', '100000', { toRegex: true })); +//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000' +``` + +### options.transform + +**Type**: `function` + +**Default**: `undefined` + +**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_. + +**Example(s)** + +```js +// add zero padding +console.log(fill(1, 5, value => String(value).padStart(4, '0'))); +//=> ['0001', '0002', '0003', '0004', '0005'] +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 116 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [paulmillr](https://github.com/paulmillr) | +| 2 | [realityking](https://github.com/realityking) | +| 2 | [bluelovers](https://github.com/bluelovers) | +| 1 | [edorivai](https://github.com/edorivai) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! + + + + + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js new file mode 100644 index 0000000..ddb212e --- /dev/null +++ b/node_modules/fill-range/index.js @@ -0,0 +1,248 @@ +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +const util = require('util'); +const toRegexRange = require('to-regex-range'); + +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; diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json new file mode 100644 index 0000000..582357f --- /dev/null +++ b/node_modules/fill-range/package.json @@ -0,0 +1,74 @@ +{ + "name": "fill-range", + "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", + "version": "7.1.1", + "homepage": "https://github.com/jonschlinkert/fill-range", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Edo Rivai (edo.rivai.nl)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Paul Miller (paulmillr.com)", + "Rouven Weßling (www.rouvenwessling.de)", + "(https://github.com/wtgtybhertgeghgtwtg)" + ], + "repository": "jonschlinkert/fill-range", + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "devDependencies": { + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1", + "nyc": "^15.1.0" + }, + "keywords": [ + "alpha", + "alphabetical", + "array", + "bash", + "brace", + "expand", + "expansion", + "fill", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "regex", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/finalhandler/HISTORY.md b/node_modules/finalhandler/HISTORY.md new file mode 100644 index 0000000..ec2d38b --- /dev/null +++ b/node_modules/finalhandler/HISTORY.md @@ -0,0 +1,195 @@ +1.2.0 / 2022-03-22 +================== + + * Remove set content headers that break response + * deps: on-finished@2.4.1 + * deps: statuses@2.0.1 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +1.1.2 / 2019-05-09 +================== + + * Set stricter `Content-Security-Policy` header + * deps: parseurl@~1.3.3 + * deps: statuses@~1.5.0 + +1.1.1 / 2018-03-06 +================== + + * Fix 404 output for bad / missing pathnames + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +1.1.0 / 2017-09-24 +================== + + * Use `res.headersSent` when available + +1.0.6 / 2017-09-22 +================== + + * deps: debug@2.6.9 + +1.0.5 / 2017-09-15 +================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + +1.0.4 / 2017-08-03 +================== + + * deps: debug@2.6.8 + +1.0.3 / 2017-05-16 +================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + +1.0.2 / 2017-04-22 +================== + + * deps: debug@2.6.4 + - deps: ms@0.7.3 + +1.0.1 / 2017-03-21 +================== + + * Fix missing `` in HTML document + * deps: debug@2.6.3 + - Fix: `DEBUG_MAX_ARRAY_LENGTH` + +1.0.0 / 2017-02-15 +================== + + * Fix exception when `err` cannot be converted to a string + * Fully URL-encode the pathname in the 404 message + * Only include the pathname in the 404 message + * Send complete HTML document + * Set `Content-Security-Policy: default-src 'self'` header + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +0.5.1 / 2016-11-12 +================== + + * Fix exception when `err.headers` is not an object + * deps: statuses@~1.3.1 + * perf: hoist regular expressions + * perf: remove duplicate validation path + +0.5.0 / 2016-06-15 +================== + + * Change invalid or non-numeric status code to 500 + * Overwrite status message to match set status code + * Prefer `err.statusCode` if `err.status` is invalid + * Set response headers from `err.headers` object + * Use `statuses` instead of `http` module for status messages + - Includes all defined status messages + +0.4.1 / 2015-12-02 +================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + +0.4.0 / 2015-06-14 +================== + + * Fix a false-positive when unpiping in Node.js 0.8 + * Support `statusCode` property on `Error` objects + * Use `unpipe` module for unpiping requests + * deps: escape-html@1.0.2 + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * perf: enable strict mode + * perf: remove argument reassignment + +0.3.6 / 2015-05-11 +================== + + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +0.3.5 / 2015-04-22 +================== + + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + +0.3.4 / 2015-03-15 +================== + + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +0.3.3 / 2015-01-01 +================== + + * deps: debug@~2.1.1 + * deps: on-finished@~2.2.0 + +0.3.2 / 2014-10-22 +================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + +0.3.1 / 2014-10-16 +================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + +0.3.0 / 2014-09-17 +================== + + * Terminate in progress response only on error + * Use `on-finished` to determine request status + +0.2.0 / 2014-09-03 +================== + + * Set `X-Content-Type-Options: nosniff` header + * deps: debug@~2.0.0 + +0.1.0 / 2014-07-16 +================== + + * Respond after request fully read + - prevents hung responses and socket hang ups + * deps: debug@1.0.4 + +0.0.3 / 2014-07-11 +================== + + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + +0.0.2 / 2014-06-19 +================== + + * Handle invalid status codes + +0.0.1 / 2014-06-05 +================== + + * deps: debug@1.0.2 + +0.0.0 / 2014-06-05 +================== + + * Extracted from connect/express diff --git a/node_modules/finalhandler/LICENSE b/node_modules/finalhandler/LICENSE new file mode 100644 index 0000000..6022106 --- /dev/null +++ b/node_modules/finalhandler/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2022 Douglas Christopher Wilson + +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. diff --git a/node_modules/finalhandler/README.md b/node_modules/finalhandler/README.md new file mode 100644 index 0000000..81f10ef --- /dev/null +++ b/node_modules/finalhandler/README.md @@ -0,0 +1,147 @@ +# finalhandler + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Node.js function to invoke as the final step to respond to HTTP request. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install finalhandler +``` + +## API + +```js +var finalhandler = require('finalhandler') +``` + +### finalhandler(req, res, [options]) + +Returns function to be invoked as the final step for the given `req` and `res`. +This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will +write out a 404 response to the `res`. If it is truthy, an error response will +be written out to the `res` or `res` will be terminated if a response has already +started. + +When an error is written, the following information is added to the response: + + * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If + this value is outside the 4xx or 5xx range, it will be set to 500. + * The `res.statusMessage` is set according to the status code. + * The body will be the HTML of the status code message if `env` is + `'production'`, otherwise will be `err.stack`. + * Any headers specified in an `err.headers` object. + +The final handler will also unpipe anything from `req` when it is invoked. + +#### options.env + +By default, the environment is determined by `NODE_ENV` variable, but it can be +overridden by this option. + +#### options.onerror + +Provide a function to be called with the `err` when it exists. Can be used for +writing errors to a central location without excessive function generation. Called +as `onerror(err, req, res)`. + +## Examples + +### always 404 + +```js +var finalhandler = require('finalhandler') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + done() +}) + +server.listen(3000) +``` + +### perform simple action + +```js +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + + fs.readFile('index.html', function (err, buf) { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) +``` + +### use with middleware-style functions + +```js +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') + +var serve = serveStatic('public') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + serve(req, res, done) +}) + +server.listen(3000) +``` + +### keep log of all errors + +```js +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res, { onerror: logerror }) + + fs.readFile('index.html', function (err, buf) { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) + +function logerror (err) { + console.error(err.stack || err.toString()) +} +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/finalhandler.svg +[npm-url]: https://npmjs.org/package/finalhandler +[node-image]: https://img.shields.io/node/v/finalhandler.svg +[node-url]: https://nodejs.org/en/download +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master +[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg +[downloads-url]: https://npmjs.org/package/finalhandler +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/pillarjs/finalhandler/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/pillarjs/finalhandler?query=workflow%3Aci diff --git a/node_modules/finalhandler/SECURITY.md b/node_modules/finalhandler/SECURITY.md new file mode 100644 index 0000000..6e23249 --- /dev/null +++ b/node_modules/finalhandler/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `finalhandler` team and community take all security bugs seriously. Thank +you for improving the security of Express. We appreciate your efforts and +responsible disclosure and will make every effort to acknowledge your +contributions. + +Report security bugs by emailing the current owner(s) of `finalhandler`. This +information can be found in the npm registry using the command +`npm owner ls finalhandler`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/pillarjs/finalhandler/issues) +asking for the current contact information. + +To ensure the timely response to your report, please ensure that the entirety +of the report is contained within the email body and not solely behind a web +link or an attachment. + +At least one owner will acknowledge your email within 48 hours, and will send a +more detailed response within 48 hours indicating the next steps in handling +your report. After the initial reply to your report, the owners will +endeavor to keep you informed of the progress towards a fix and full +announcement, and may ask for additional information or guidance. diff --git a/node_modules/finalhandler/index.js b/node_modules/finalhandler/index.js new file mode 100644 index 0000000..f628e42 --- /dev/null +++ b/node_modules/finalhandler/index.js @@ -0,0 +1,336 @@ +/*! + * finalhandler + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('finalhandler') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var onFinished = require('on-finished') +var parseUrl = require('parseurl') +var statuses = require('statuses') +var unpipe = require('unpipe') + +/** + * Module variables. + * @private + */ + +var DOUBLE_SPACE_REGEXP = /\x20{2}/g +var NEWLINE_REGEXP = /\n/g + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } +var isFinished = onFinished.isFinished + +/** + * Create a minimal HTML document. + * + * @param {string} message + * @private + */ + +function createHtmlDocument (message) { + var body = escapeHtml(message) + .replace(NEWLINE_REGEXP, '
') + .replace(DOUBLE_SPACE_REGEXP, '  ') + + return '\n' + + '\n' + + '\n' + + '\n' + + 'Error\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Module exports. + * @public + */ + +module.exports = finalhandler + +/** + * Create a function to handle the final response. + * + * @param {Request} req + * @param {Response} res + * @param {Object} [options] + * @return {Function} + * @public + */ + +function finalhandler (req, res, options) { + var opts = options || {} + + // get environment + var env = opts.env || process.env.NODE_ENV || 'development' + + // get error callback + var onerror = opts.onerror + + return function (err) { + var headers + var msg + var status + + // ignore 404 on in-flight response + if (!err && headersSent(res)) { + debug('cannot 404 after headers sent') + return + } + + // unhandled error + if (err) { + // respect status code from error + status = getErrorStatusCode(err) + + if (status === undefined) { + // fallback to status code on response + status = getResponseStatusCode(res) + } else { + // respect headers from error + headers = getErrorHeaders(err) + } + + // get error message + msg = getErrorMessage(err, status, env) + } else { + // not found + status = 404 + msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req)) + } + + debug('default %s', status) + + // schedule onerror callback + if (err && onerror) { + defer(onerror, err, req, res) + } + + // cannot actually respond + if (headersSent(res)) { + debug('cannot %d after headers sent', status) + req.socket.destroy() + return + } + + // send response + send(req, res, status, headers, msg) + } +} + +/** + * Get headers from Error object. + * + * @param {Error} err + * @return {object} + * @private + */ + +function getErrorHeaders (err) { + if (!err.headers || typeof err.headers !== 'object') { + return undefined + } + + var headers = Object.create(null) + var keys = Object.keys(err.headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + headers[key] = err.headers[key] + } + + return headers +} + +/** + * Get message from Error object, fallback to status message. + * + * @param {Error} err + * @param {number} status + * @param {string} env + * @return {string} + * @private + */ + +function getErrorMessage (err, status, env) { + var msg + + if (env !== 'production') { + // use err.stack, which typically includes err.message + msg = err.stack + + // fallback to err.toString() when possible + if (!msg && typeof err.toString === 'function') { + msg = err.toString() + } + } + + return msg || statuses.message[status] +} + +/** + * Get status code from Error object. + * + * @param {Error} err + * @return {number} + * @private + */ + +function getErrorStatusCode (err) { + // check err.status + if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { + return err.status + } + + // check err.statusCode + if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode + } + + return undefined +} + +/** + * Get resource name for the request. + * + * This is typically just the original pathname of the request + * but will fallback to "resource" is that cannot be determined. + * + * @param {IncomingMessage} req + * @return {string} + * @private + */ + +function getResourceName (req) { + try { + return parseUrl.original(req).pathname + } catch (e) { + return 'resource' + } +} + +/** + * Get status code from response. + * + * @param {OutgoingMessage} res + * @return {number} + * @private + */ + +function getResponseStatusCode (res) { + var status = res.statusCode + + // default status code to 500 if outside valid range + if (typeof status !== 'number' || status < 400 || status > 599) { + status = 500 + } + + return status +} + +/** + * Determine if the response headers have been sent. + * + * @param {object} res + * @returns {boolean} + * @private + */ + +function headersSent (res) { + return typeof res.headersSent !== 'boolean' + ? Boolean(res._header) + : res.headersSent +} + +/** + * Send response. + * + * @param {IncomingMessage} req + * @param {OutgoingMessage} res + * @param {number} status + * @param {object} headers + * @param {string} message + * @private + */ + +function send (req, res, status, headers, message) { + function write () { + // response body + var body = createHtmlDocument(message) + + // response status + res.statusCode = status + res.statusMessage = statuses.message[status] + + // remove any content headers + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Range') + + // response headers + setHeaders(res, headers) + + // security headers + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + + // standard headers + res.setHeader('Content-Type', 'text/html; charset=utf-8') + res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')) + + if (req.method === 'HEAD') { + res.end() + return + } + + res.end(body, 'utf8') + } + + if (isFinished(req)) { + write() + return + } + + // unpipe everything from the request + unpipe(req) + + // flush the request + onFinished(req, write) + req.resume() +} + +/** + * Set response headers from an object. + * + * @param {OutgoingMessage} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + if (!headers) { + return + } + + var keys = Object.keys(headers) + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/node_modules/finalhandler/node_modules/debug/.coveralls.yml b/node_modules/finalhandler/node_modules/debug/.coveralls.yml new file mode 100644 index 0000000..20a7068 --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/finalhandler/node_modules/debug/.eslintrc b/node_modules/finalhandler/node_modules/debug/.eslintrc new file mode 100644 index 0000000..8a37ae2 --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/finalhandler/node_modules/debug/.npmignore b/node_modules/finalhandler/node_modules/debug/.npmignore new file mode 100644 index 0000000..5f60eec --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/node_modules/finalhandler/node_modules/debug/.travis.yml b/node_modules/finalhandler/node_modules/debug/.travis.yml new file mode 100644 index 0000000..6c6090c --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/finalhandler/node_modules/debug/CHANGELOG.md b/node_modules/finalhandler/node_modules/debug/CHANGELOG.md new file mode 100644 index 0000000..eadaa18 --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/finalhandler/node_modules/debug/LICENSE b/node_modules/finalhandler/node_modules/debug/LICENSE new file mode 100644 index 0000000..658c933 --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +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. + diff --git a/node_modules/finalhandler/node_modules/debug/Makefile b/node_modules/finalhandler/node_modules/debug/Makefile new file mode 100644 index 0000000..584da8b --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/finalhandler/node_modules/debug/README.md b/node_modules/finalhandler/node_modules/debug/README.md new file mode 100644 index 0000000..f67be6b --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +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. diff --git a/node_modules/finalhandler/node_modules/debug/component.json b/node_modules/finalhandler/node_modules/debug/component.json new file mode 100644 index 0000000..9de2641 --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/finalhandler/node_modules/debug/karma.conf.js b/node_modules/finalhandler/node_modules/debug/karma.conf.js new file mode 100644 index 0000000..103a82d --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/finalhandler/node_modules/debug/node.js b/node_modules/finalhandler/node_modules/debug/node.js new file mode 100644 index 0000000..7fc36fe --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/finalhandler/node_modules/debug/package.json b/node_modules/finalhandler/node_modules/debug/package.json new file mode 100644 index 0000000..dc787ba --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/package.json @@ -0,0 +1,49 @@ +{ + "name": "debug", + "version": "2.6.9", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + }, + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + } +} diff --git a/node_modules/finalhandler/node_modules/debug/src/browser.js b/node_modules/finalhandler/node_modules/debug/src/browser.js new file mode 100644 index 0000000..7106924 --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * 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 + */ + +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') { + return true; + } + + // 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+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var 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 + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // 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() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // 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; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * 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 { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/finalhandler/node_modules/debug/src/debug.js b/node_modules/finalhandler/node_modules/debug/src/debug.js new file mode 100644 index 0000000..6a5e3fc --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.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". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var 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.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/finalhandler/node_modules/debug/src/index.js b/node_modules/finalhandler/node_modules/debug/src/index.js new file mode 100644 index 0000000..e12cf4d --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/finalhandler/node_modules/debug/src/inspector-log.js b/node_modules/finalhandler/node_modules/debug/src/inspector-log.js new file mode 100644 index 0000000..60ea6c0 --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/node_modules/finalhandler/node_modules/debug/src/node.js b/node_modules/finalhandler/node_modules/debug/src/node.js new file mode 100644 index 0000000..b15109c --- /dev/null +++ b/node_modules/finalhandler/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./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]; + +/** + * 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(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var 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; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // 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; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * 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 = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/finalhandler/package.json b/node_modules/finalhandler/package.json new file mode 100644 index 0000000..16bf11e --- /dev/null +++ b/node_modules/finalhandler/package.json @@ -0,0 +1,46 @@ +{ + "name": "finalhandler", + "description": "Node.js final http responder", + "version": "1.2.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "pillarjs/finalhandler", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0", + "readable-stream": "2.3.6", + "safe-buffer": "5.2.1", + "supertest": "6.2.2" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "SECURITY.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/foreground-child/LICENSE b/node_modules/foreground-child/LICENSE new file mode 100644 index 0000000..2d80720 --- /dev/null +++ b/node_modules/foreground-child/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015-2023 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/foreground-child/README.md b/node_modules/foreground-child/README.md new file mode 100644 index 0000000..477ca57 --- /dev/null +++ b/node_modules/foreground-child/README.md @@ -0,0 +1,128 @@ +# foreground-child + +Run a child as if it's the foreground process. Give it stdio. Exit +when it exits. + +Mostly this module is here to support some use cases around +wrapping child processes for test coverage and such. But it's +also generally useful any time you want one program to execute +another as if it's the "main" process, for example, if a program +takes a `--cmd` argument to execute in some way. + +## USAGE + +```js +import { foregroundChild } from 'foreground-child' +// hybrid module, this also works: +// const { foregroundChild } = require('foreground-child') + +// cats out this file +const child = foregroundChild('cat', [__filename]) + +// At this point, it's best to just do nothing else. +// return or whatever. +// If the child gets a signal, or just exits, then this +// parent process will exit in the same way. +``` + +You can provide custom spawn options by passing an object after +the program and arguments: + +```js +const child = foregroundChild(`cat ${__filename}`, { shell: true }) +``` + +A callback can optionally be provided, if you want to perform an +action before your foreground-child exits: + +```js +const child = foregroundChild('cat', [__filename], spawnOptions, () => { + doSomeActions() +}) +``` + +The callback can return a Promise in order to perform +asynchronous actions. If the callback does not return a promise, +then it must complete its actions within a single JavaScript +tick. + +```js +const child = foregroundChild('cat', [__filename], async () => { + await doSomeAsyncActions() +}) +``` + +If the callback throws or rejects, then it will be unhandled, and +node will exit in error. + +If the callback returns a string value, then that will be used as +the signal to exit the parent process. If it returns a number, +then that number will be used as the parent exit status code. If +it returns boolean `false`, then the parent process will not be +terminated. If it returns `undefined`, then it will exit with the +same signal/code as the child process. + +## Caveats + +The "normal" standard IO file descriptors (0, 1, and 2 for stdin, +stdout, and stderr respectively) are shared with the child process. +Additionally, if there is an IPC channel set up in the parent, then +messages are proxied to the child on file descriptor 3. + +In Node, it's possible to also map arbitrary file descriptors +into a child process. In these cases, foreground-child will not +map the file descriptors into the child. If file descriptors 0, +1, or 2 are used for the IPC channel, then strange behavior may +happen (like printing IPC messages to stderr, for example). + +Note that a SIGKILL will always kill the parent process, but +will not proxy the signal to the child process, because SIGKILL +cannot be caught. In order to address this, a special "watchdog" +child process is spawned which will send a SIGKILL to the child +process if it does not terminate within half a second after the +watchdog receives a SIGHUP due to its parent terminating. + +On Windows, issuing a `process.kill(process.pid, signal)` with a +fatal termination signal may cause the process to exit with a `1` +status code rather than reporting the signal properly. This +module tries to do the right thing, but on Windows systems, you +may see that incorrect result. There is as far as I'm aware no +workaround for this. + +## util: `foreground-child/proxy-signals` + +If you just want to proxy the signals to a child process that the +main process receives, you can use the `proxy-signals` export +from this package. + +```js +import { proxySignals } from 'foreground-child/proxy-signals' + +const childProcess = spawn('command', ['some', 'args']) +proxySignals(childProcess) +``` + +Now, any fatal signal received by the current process will be +proxied to the child process. + +It doesn't go in the other direction; ie, signals sent to the +child process will not affect the parent. For that, listen to the +child `exit` or `close` events, and handle them appropriately. + +## util: `foreground-child/watchdog` + +If you are spawning a child process, and want to ensure that it +isn't left dangling if the parent process exits, you can use the +watchdog utility exported by this module. + +```js +import { watchdog } from 'foreground-child/watchdog' + +const childProcess = spawn('command', ['some', 'args']) +const watchdogProcess = watchdog(childProcess) + +// watchdogProcess is a reference to the process monitoring the +// parent and child. There's usually no reason to do anything +// with it, as it's silent and will terminate +// automatically when it's no longer needed. +``` diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.d.ts b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts new file mode 100644 index 0000000..13c5af4 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts @@ -0,0 +1,3 @@ +/// +export declare const allSignals: NodeJS.Signals[]; +//# sourceMappingURL=all-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map new file mode 100644 index 0000000..400ce7b --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":";AACA,eAAO,MAAM,UAAU,kBASA,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.js b/node_modules/foreground-child/dist/commonjs/all-signals.js new file mode 100644 index 0000000..1692af0 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.js @@ -0,0 +1,58 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.allSignals = void 0; +const node_constants_1 = __importDefault(require("node:constants")); +exports.allSignals = +// this is the full list of signals that Node will let us do anything with +Object.keys(node_constants_1.default).filter(k => k.startsWith('SIG') && + // https://github.com/tapjs/signal-exit/issues/21 + k !== 'SIGPROF' && + // no sense trying to listen for SIGKILL, it's impossible + k !== 'SIGKILL'); +// These are some obscure signals that are reported by kill -l +// on macOS, Linux, or Windows, but which don't have any mapping +// in Node.js. No sense trying if they're just going to throw +// every time on every platform. +// +// 'SIGEMT', +// 'SIGLOST', +// 'SIGPOLL', +// 'SIGRTMAX', +// 'SIGRTMAX-1', +// 'SIGRTMAX-10', +// 'SIGRTMAX-11', +// 'SIGRTMAX-12', +// 'SIGRTMAX-13', +// 'SIGRTMAX-14', +// 'SIGRTMAX-15', +// 'SIGRTMAX-2', +// 'SIGRTMAX-3', +// 'SIGRTMAX-4', +// 'SIGRTMAX-5', +// 'SIGRTMAX-6', +// 'SIGRTMAX-7', +// 'SIGRTMAX-8', +// 'SIGRTMAX-9', +// 'SIGRTMIN', +// 'SIGRTMIN+1', +// 'SIGRTMIN+10', +// 'SIGRTMIN+11', +// 'SIGRTMIN+12', +// 'SIGRTMIN+13', +// 'SIGRTMIN+14', +// 'SIGRTMIN+15', +// 'SIGRTMIN+16', +// 'SIGRTMIN+2', +// 'SIGRTMIN+3', +// 'SIGRTMIN+4', +// 'SIGRTMIN+5', +// 'SIGRTMIN+6', +// 'SIGRTMIN+7', +// 'SIGRTMIN+8', +// 'SIGRTMIN+9', +// 'SIGSTKFLT', +// 'SIGUNUSED', +//# sourceMappingURL=all-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.js.map b/node_modules/foreground-child/dist/commonjs/all-signals.js.map new file mode 100644 index 0000000..51c056d --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.js","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":";;;;;;AAAA,oEAAsC;AACzB,QAAA,UAAU;AACrB,0EAA0E;AAC1E,MAAM,CAAC,IAAI,CAAC,wBAAS,CAAC,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,CACF,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;IACnB,iDAAiD;IACjD,CAAC,KAAK,SAAS;IACf,yDAAyD;IACzD,CAAC,KAAK,SAAS,CACE,CAAA;AAEvB,8DAA8D;AAC9D,gEAAgE;AAChE,6DAA6D;AAC7D,gCAAgC;AAChC,EAAE;AACF,YAAY;AACZ,aAAa;AACb,aAAa;AACb,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,eAAe;AACf,eAAe","sourcesContent":["import constants from 'node:constants'\nexport const allSignals =\n // this is the full list of signals that Node will let us do anything with\n Object.keys(constants).filter(\n k =>\n k.startsWith('SIG') &&\n // https://github.com/tapjs/signal-exit/issues/21\n k !== 'SIGPROF' &&\n // no sense trying to listen for SIGKILL, it's impossible\n k !== 'SIGKILL',\n ) as NodeJS.Signals[]\n\n// These are some obscure signals that are reported by kill -l\n// on macOS, Linux, or Windows, but which don't have any mapping\n// in Node.js. No sense trying if they're just going to throw\n// every time on every platform.\n//\n// 'SIGEMT',\n// 'SIGLOST',\n// 'SIGPOLL',\n// 'SIGRTMAX',\n// 'SIGRTMAX-1',\n// 'SIGRTMAX-10',\n// 'SIGRTMAX-11',\n// 'SIGRTMAX-12',\n// 'SIGRTMAX-13',\n// 'SIGRTMAX-14',\n// 'SIGRTMAX-15',\n// 'SIGRTMAX-2',\n// 'SIGRTMAX-3',\n// 'SIGRTMAX-4',\n// 'SIGRTMAX-5',\n// 'SIGRTMAX-6',\n// 'SIGRTMAX-7',\n// 'SIGRTMAX-8',\n// 'SIGRTMAX-9',\n// 'SIGRTMIN',\n// 'SIGRTMIN+1',\n// 'SIGRTMIN+10',\n// 'SIGRTMIN+11',\n// 'SIGRTMIN+12',\n// 'SIGRTMIN+13',\n// 'SIGRTMIN+14',\n// 'SIGRTMIN+15',\n// 'SIGRTMIN+16',\n// 'SIGRTMIN+2',\n// 'SIGRTMIN+3',\n// 'SIGRTMIN+4',\n// 'SIGRTMIN+5',\n// 'SIGRTMIN+6',\n// 'SIGRTMIN+7',\n// 'SIGRTMIN+8',\n// 'SIGRTMIN+9',\n// 'SIGSTKFLT',\n// 'SIGUNUSED',\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.d.ts b/node_modules/foreground-child/dist/commonjs/index.d.ts new file mode 100644 index 0000000..e2716ff --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.d.ts @@ -0,0 +1,63 @@ +/// +/// +import { ChildProcessByStdio, SpawnOptions } from 'child_process'; +/** + * The signature for the cleanup method. + * + * Arguments indicate the exit status of the child process. + * + * If a Promise is returned, then the process is not terminated + * until it resolves, and the resolution value is treated as the + * exit status (if a number) or signal exit (if a signal string). + * + * If `undefined` is returned, then no change is made, and the parent + * exits in the same way that the child exited. + * + * If boolean `false` is returned, then the parent's exit is canceled. + * + * If a number is returned, then the parent process exits with the number + * as its exitCode. + * + * If a signal string is returned, then the parent process is killed with + * the same signal that caused the child to exit. + */ +export type Cleanup = (code: number | null, signal: null | NodeJS.Signals) => void | undefined | number | NodeJS.Signals | false | Promise; +export type FgArgs = [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup] | [ + program: [cmd: string, ...args: string[]], + opts?: SpawnOptions, + cleanup?: Cleanup +] | [program: string, cleanup?: Cleanup] | [program: string, opts?: SpawnOptions, cleanup?: Cleanup] | [program: string, args?: string[], cleanup?: Cleanup] | [ + program: string, + args?: string[], + opts?: SpawnOptions, + cleanup?: Cleanup +]; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +export declare const normalizeFgArgs: (fgArgs: FgArgs) => [ + program: string, + args: string[], + spawnOpts: SpawnOptions, + cleanup: Cleanup +]; +/** + * Spawn the specified program as a "foreground" process, or at least as + * close as is possible given node's lack of exec-without-fork. + * + * Cleanup method may be used to modify or ignore the result of the child's + * exit code or signal. If cleanup returns undefined (or a Promise that + * resolves to undefined), then the parent will exit in the same way that + * the child did. + * + * Return boolean `false` to prevent the parent's exit entirely. + */ +export declare function foregroundChild(cmd: string | [cmd: string, ...args: string[]], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.d.ts.map b/node_modules/foreground-child/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..7b6416c --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,mBAAmB,EAInB,YAAY,EACb,M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;GAUG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.js b/node_modules/foreground-child/dist/commonjs/index.js new file mode 100644 index 0000000..8ea5413 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.js @@ -0,0 +1,121 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foregroundChild = exports.normalizeFgArgs = void 0; +const child_process_1 = require("child_process"); +const cross_spawn_1 = __importDefault(require("cross-spawn")); +const signal_exit_1 = require("signal-exit"); +const proxy_signals_js_1 = require("./proxy-signals.js"); +const watchdog_js_1 = require("./watchdog.js"); +/* c8 ignore start */ +const spawn = process?.platform === 'win32' ? cross_spawn_1.default : child_process_1.spawn; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +const normalizeFgArgs = (fgArgs) => { + let [program, args = [], spawnOpts = {}, cleanup = () => { }] = fgArgs; + if (typeof args === 'function') { + cleanup = args; + spawnOpts = {}; + args = []; + } + else if (!!args && typeof args === 'object' && !Array.isArray(args)) { + if (typeof spawnOpts === 'function') + cleanup = spawnOpts; + spawnOpts = args; + args = []; + } + else if (typeof spawnOpts === 'function') { + cleanup = spawnOpts; + spawnOpts = {}; + } + if (Array.isArray(program)) { + const [pp, ...pa] = program; + program = pp; + args = pa; + } + return [program, args, { ...spawnOpts }, cleanup]; +}; +exports.normalizeFgArgs = normalizeFgArgs; +function foregroundChild(...fgArgs) { + const [program, args, spawnOpts, cleanup] = (0, exports.normalizeFgArgs)(fgArgs); + spawnOpts.stdio = [0, 1, 2]; + if (process.send) { + spawnOpts.stdio.push('ipc'); + } + const child = spawn(program, args, spawnOpts); + const childHangup = () => { + try { + child.kill('SIGHUP'); + /* c8 ignore start */ + } + catch (_) { + // SIGHUP is weird on windows + child.kill('SIGTERM'); + } + /* c8 ignore stop */ + }; + const removeOnExit = (0, signal_exit_1.onExit)(childHangup); + (0, proxy_signals_js_1.proxySignals)(child); + (0, watchdog_js_1.watchdog)(child); + let done = false; + child.on('close', async (code, signal) => { + /* c8 ignore start */ + if (done) + return; + /* c8 ignore stop */ + done = true; + const result = cleanup(code, signal); + const res = isPromise(result) ? await result : result; + removeOnExit(); + if (res === false) + return; + else if (typeof res === 'string') { + signal = res; + code = null; + } + else if (typeof res === 'number') { + code = res; + signal = null; + } + if (signal) { + // If there is nothing else keeping the event loop alive, + // then there's a race between a graceful exit and getting + // the signal to this process. Put this timeout here to + // make sure we're still alive to get the signal, and thus + // exit with the intended signal code. + /* istanbul ignore next */ + setTimeout(() => { }, 2000); + try { + process.kill(process.pid, signal); + /* c8 ignore start */ + } + catch (_) { + process.kill(process.pid, 'SIGTERM'); + } + /* c8 ignore stop */ + } + else { + process.exit(code || 0); + } + }); + if (process.send) { + process.removeAllListeners('message'); + child.on('message', (message, sendHandle) => { + process.send?.(message, sendHandle); + }); + process.on('message', (message, sendHandle) => { + child.send(message, sendHandle); + }); + } + return child; +} +exports.foregroundChild = foregroundChild; +const isPromise = (o) => !!o && typeof o === 'object' && typeof o.then === 'function'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.js.map b/node_modules/foreground-child/dist/commonjs/index.js.map new file mode 100644 index 0000000..49e6619 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iDAMsB;AACtB,8DAAoC;AACpC,6CAAoC;AACpC,yDAAiD;AACjD,+CAAwC;AAExC,qBAAqB;AACrB,MAAM,KAAK,GAAG,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAU,CAAC,CAAC,CAAC,qBAAS,CAAA;AAmDpE;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAc,EAMd,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC,GAAG,MAAM,CAAA;IACrE,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,GAAG,IAAI,CAAA;QACd,SAAS,GAAG,EAAE,CAAA;QACd,IAAI,GAAG,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,IAAI,OAAO,SAAS,KAAK,UAAU;YAAE,OAAO,GAAG,SAAS,CAAA;QACxD,SAAS,GAAG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B;QACtB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAErC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC5C,KAAK,CAAC,IAAI,CACR,OAAuB,EACvB,UAAoC,CACrC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAvFD,0CAuFC;AAED,MAAM,SAAS,GAAG,CAAC,CAAM,EAAqB,EAAE,CAC9C,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAA","sourcesContent":["import {\n ChildProcessByStdio,\n SendHandle,\n Serializable,\n spawn as nodeSpawn,\n SpawnOptions,\n} from 'child_process'\nimport crossSpawn from 'cross-spawn'\nimport { onExit } from 'signal-exit'\nimport { proxySignals } from './proxy-signals.js'\nimport { watchdog } from './watchdog.js'\n\n/* c8 ignore start */\nconst spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn\n/* c8 ignore stop */\n\n/**\n * The signature for the cleanup method.\n *\n * Arguments indicate the exit status of the child process.\n *\n * If a Promise is returned, then the process is not terminated\n * until it resolves, and the resolution value is treated as the\n * exit status (if a number) or signal exit (if a signal string).\n *\n * If `undefined` is returned, then no change is made, and the parent\n * exits in the same way that the child exited.\n *\n * If boolean `false` is returned, then the parent's exit is canceled.\n *\n * If a number is returned, then the parent process exits with the number\n * as its exitCode.\n *\n * If a signal string is returned, then the parent process is killed with\n * the same signal that caused the child to exit.\n */\nexport type Cleanup = (\n code: number | null,\n signal: null | NodeJS.Signals,\n) =>\n | void\n | undefined\n | number\n | NodeJS.Signals\n | false\n | Promise\n\nexport type FgArgs =\n | [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup]\n | [\n program: [cmd: string, ...args: string[]],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n | [program: string, cleanup?: Cleanup]\n | [program: string, opts?: SpawnOptions, cleanup?: Cleanup]\n | [program: string, args?: string[], cleanup?: Cleanup]\n | [\n program: string,\n args?: string[],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n\n/**\n * Normalizes the arguments passed to `foregroundChild`.\n *\n * Exposed for testing.\n *\n * @internal\n */\nexport const normalizeFgArgs = (\n fgArgs: FgArgs,\n): [\n program: string,\n args: string[],\n spawnOpts: SpawnOptions,\n cleanup: Cleanup,\n] => {\n let [program, args = [], spawnOpts = {}, cleanup = () => {}] = fgArgs\n if (typeof args === 'function') {\n cleanup = args\n spawnOpts = {}\n args = []\n } else if (!!args && typeof args === 'object' && !Array.isArray(args)) {\n if (typeof spawnOpts === 'function') cleanup = spawnOpts\n spawnOpts = args\n args = []\n } else if (typeof spawnOpts === 'function') {\n cleanup = spawnOpts\n spawnOpts = {}\n }\n if (Array.isArray(program)) {\n const [pp, ...pa] = program\n program = pp\n args = pa\n }\n return [program, args, { ...spawnOpts }, cleanup]\n}\n\n/**\n * Spawn the specified program as a \"foreground\" process, or at least as\n * close as is possible given node's lack of exec-without-fork.\n *\n * Cleanup method may be used to modify or ignore the result of the child's\n * exit code or signal. If cleanup returns undefined (or a Promise that\n * resolves to undefined), then the parent will exit in the same way that\n * the child did.\n *\n * Return boolean `false` to prevent the parent's exit entirely.\n */\nexport function foregroundChild(\n cmd: string | [cmd: string, ...args: string[]],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n ...fgArgs: FgArgs\n): ChildProcessByStdio {\n const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs)\n\n spawnOpts.stdio = [0, 1, 2]\n if (process.send) {\n spawnOpts.stdio.push('ipc')\n }\n\n const child = spawn(program, args, spawnOpts) as ChildProcessByStdio<\n null,\n null,\n null\n >\n\n const childHangup = () => {\n try {\n child.kill('SIGHUP')\n\n /* c8 ignore start */\n } catch (_) {\n // SIGHUP is weird on windows\n child.kill('SIGTERM')\n }\n /* c8 ignore stop */\n }\n const removeOnExit = onExit(childHangup)\n\n proxySignals(child)\n watchdog(child)\n\n let done = false\n child.on('close', async (code, signal) => {\n /* c8 ignore start */\n if (done) return\n /* c8 ignore stop */\n done = true\n const result = cleanup(code, signal)\n const res = isPromise(result) ? await result : result\n removeOnExit()\n\n if (res === false) return\n else if (typeof res === 'string') {\n signal = res\n code = null\n } else if (typeof res === 'number') {\n code = res\n signal = null\n }\n\n if (signal) {\n // If there is nothing else keeping the event loop alive,\n // then there's a race between a graceful exit and getting\n // the signal to this process. Put this timeout here to\n // make sure we're still alive to get the signal, and thus\n // exit with the intended signal code.\n /* istanbul ignore next */\n setTimeout(() => {}, 2000)\n try {\n process.kill(process.pid, signal)\n /* c8 ignore start */\n } catch (_) {\n process.kill(process.pid, 'SIGTERM')\n }\n /* c8 ignore stop */\n } else {\n process.exit(code || 0)\n }\n })\n\n if (process.send) {\n process.removeAllListeners('message')\n\n child.on('message', (message, sendHandle) => {\n process.send?.(message, sendHandle)\n })\n\n process.on('message', (message, sendHandle) => {\n child.send(\n message as Serializable,\n sendHandle as SendHandle | undefined,\n )\n })\n }\n\n return child\n}\n\nconst isPromise = (o: any): o is Promise =>\n !!o && typeof o === 'object' && typeof o.then === 'function'\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/package.json b/node_modules/foreground-child/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts new file mode 100644 index 0000000..66090fd --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts @@ -0,0 +1,7 @@ +/// +import { type ChildProcess } from 'child_process'; +/** + * Starts forwarding signals to `child` through `parent`. + */ +export declare const proxySignals: (child: ChildProcess) => () => void; +//# sourceMappingURL=proxy-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map new file mode 100644 index 0000000..9c98b7f --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.js b/node_modules/foreground-child/dist/commonjs/proxy-signals.js new file mode 100644 index 0000000..3913e7b --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.proxySignals = void 0; +const all_signals_js_1 = require("./all-signals.js"); +/** + * Starts forwarding signals to `child` through `parent`. + */ +const proxySignals = (child) => { + const listeners = new Map(); + for (const sig of all_signals_js_1.allSignals) { + const listener = () => { + // some signals can only be received, not sent + try { + child.kill(sig); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }; + try { + // if it's a signal this system doesn't recognize, skip it + process.on(sig, listener); + listeners.set(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + } + const unproxy = () => { + for (const [sig, listener] of listeners) { + process.removeListener(sig, listener); + } + }; + child.on('exit', unproxy); + return unproxy; +}; +exports.proxySignals = proxySignals; +//# sourceMappingURL=proxy-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map b/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map new file mode 100644 index 0000000..1995822 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.js","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":";;;AACA,qDAA6C;AAE7C;;GAEG;AACI,MAAM,YAAY,GAAG,CAAC,KAAmB,EAAE,EAAE;IAClD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;IAE3B,KAAK,MAAM,GAAG,IAAI,2BAAU,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,8CAA8C;YAC9C,IAAI,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACf,qBAAqB;YACvB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;YACd,oBAAoB;QACtB,CAAC,CAAA;QACD,IAAI,CAAC;YACH,0DAA0D;YAC1D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YACzB,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC5B,qBAAqB;QACvB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;QACd,oBAAoB;IACtB,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,SAAS,EAAE,CAAC;YACxC,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QACvC,CAAC;IACH,CAAC,CAAA;IACD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzB,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AA5BY,QAAA,YAAY,gBA4BxB","sourcesContent":["import { type ChildProcess } from 'child_process'\nimport { allSignals } from './all-signals.js'\n\n/**\n * Starts forwarding signals to `child` through `parent`.\n */\nexport const proxySignals = (child: ChildProcess) => {\n const listeners = new Map()\n\n for (const sig of allSignals) {\n const listener = () => {\n // some signals can only be received, not sent\n try {\n child.kill(sig)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n try {\n // if it's a signal this system doesn't recognize, skip it\n process.on(sig, listener)\n listeners.set(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n\n const unproxy = () => {\n for (const [sig, listener] of listeners) {\n process.removeListener(sig, listener)\n }\n }\n child.on('exit', unproxy)\n return unproxy\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.d.ts b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts new file mode 100644 index 0000000..6038d39 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts @@ -0,0 +1,11 @@ +/// +import { ChildProcess } from 'child_process'; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +export declare const watchdog: (child: ChildProcess) => ChildProcess; +//# sourceMappingURL=watchdog.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map new file mode 100644 index 0000000..cc6a668 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.js b/node_modules/foreground-child/dist/commonjs/watchdog.js new file mode 100644 index 0000000..514e234 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.js @@ -0,0 +1,50 @@ +"use strict"; +// this spawns a child process that listens for SIGHUP when the +// parent process exits, and after 200ms, sends a SIGKILL to the +// child, in case it did not terminate. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.watchdog = void 0; +const child_process_1 = require("child_process"); +const watchdogCode = String.raw ` +const pid = parseInt(process.argv[1], 10) +process.title = 'node (foreground-child watchdog pid=' + pid + ')' +if (!isNaN(pid)) { + let barked = false + // keepalive + const interval = setInterval(() => {}, 60000) + const bark = () => { + clearInterval(interval) + if (barked) return + barked = true + process.removeListener('SIGHUP', bark) + setTimeout(() => { + try { + process.kill(pid, 'SIGKILL') + setTimeout(() => process.exit(), 200) + } catch (_) {} + }, 500) + }) + process.on('SIGHUP', bark) +} +`; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +const watchdog = (child) => { + let dogExited = false; + const dog = (0, child_process_1.spawn)(process.execPath, ['-e', watchdogCode, String(child.pid)], { + stdio: 'ignore', + }); + dog.on('exit', () => (dogExited = true)); + child.on('exit', () => { + if (!dogExited) + dog.kill('SIGKILL'); + }); + return dog; +}; +exports.watchdog = watchdog; +//# sourceMappingURL=watchdog.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.js.map b/node_modules/foreground-child/dist/commonjs/watchdog.js.map new file mode 100644 index 0000000..d486c97 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.js.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.js","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,gEAAgE;AAChE,uCAAuC;;;AAEvC,iDAAmD;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAA;AAED;;;;;;GAMG;AACI,MAAM,QAAQ,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC9C,IAAI,SAAS,GAAG,KAAK,CAAA;IACrB,MAAM,GAAG,GAAG,IAAA,qBAAK,EACf,OAAO,CAAC,QAAQ,EAChB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EACvC;QACE,KAAK,EAAE,QAAQ;KAChB,CACF,CAAA;IACD,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAA;IACxC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,IAAI,CAAC,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAdY,QAAA,QAAQ,YAcpB","sourcesContent":["// this spawns a child process that listens for SIGHUP when the\n// parent process exits, and after 200ms, sends a SIGKILL to the\n// child, in case it did not terminate.\n\nimport { ChildProcess, spawn } from 'child_process'\n\nconst watchdogCode = String.raw`\nconst pid = parseInt(process.argv[1], 10)\nprocess.title = 'node (foreground-child watchdog pid=' + pid + ')'\nif (!isNaN(pid)) {\n let barked = false\n // keepalive\n const interval = setInterval(() => {}, 60000)\n const bark = () => {\n clearInterval(interval)\n if (barked) return\n barked = true\n process.removeListener('SIGHUP', bark)\n setTimeout(() => {\n try {\n process.kill(pid, 'SIGKILL')\n setTimeout(() => process.exit(), 200)\n } catch (_) {}\n }, 500)\n })\n process.on('SIGHUP', bark)\n}\n`\n\n/**\n * Pass in a ChildProcess, and this will spawn a watchdog process that\n * will make sure it exits if the parent does, thus preventing any\n * dangling detached zombie processes.\n *\n * If the child ends before the parent, then the watchdog will terminate.\n */\nexport const watchdog = (child: ChildProcess) => {\n let dogExited = false\n const dog = spawn(\n process.execPath,\n ['-e', watchdogCode, String(child.pid)],\n {\n stdio: 'ignore',\n },\n )\n dog.on('exit', () => (dogExited = true))\n child.on('exit', () => {\n if (!dogExited) dog.kill('SIGKILL')\n })\n return dog\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.d.ts b/node_modules/foreground-child/dist/esm/all-signals.d.ts new file mode 100644 index 0000000..eefd0d2 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.d.ts @@ -0,0 +1,3 @@ +/// +export declare const allSignals: NodeJS.Signals[]; +//# sourceMappingURL=all-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.d.ts.map b/node_modules/foreground-child/dist/esm/all-signals.d.ts.map new file mode 100644 index 0000000..400ce7b --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":";AACA,eAAO,MAAM,UAAU,kBASA,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.js b/node_modules/foreground-child/dist/esm/all-signals.js new file mode 100644 index 0000000..7e8d54d --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.js @@ -0,0 +1,52 @@ +import constants from 'node:constants'; +export const allSignals = +// this is the full list of signals that Node will let us do anything with +Object.keys(constants).filter(k => k.startsWith('SIG') && + // https://github.com/tapjs/signal-exit/issues/21 + k !== 'SIGPROF' && + // no sense trying to listen for SIGKILL, it's impossible + k !== 'SIGKILL'); +// These are some obscure signals that are reported by kill -l +// on macOS, Linux, or Windows, but which don't have any mapping +// in Node.js. No sense trying if they're just going to throw +// every time on every platform. +// +// 'SIGEMT', +// 'SIGLOST', +// 'SIGPOLL', +// 'SIGRTMAX', +// 'SIGRTMAX-1', +// 'SIGRTMAX-10', +// 'SIGRTMAX-11', +// 'SIGRTMAX-12', +// 'SIGRTMAX-13', +// 'SIGRTMAX-14', +// 'SIGRTMAX-15', +// 'SIGRTMAX-2', +// 'SIGRTMAX-3', +// 'SIGRTMAX-4', +// 'SIGRTMAX-5', +// 'SIGRTMAX-6', +// 'SIGRTMAX-7', +// 'SIGRTMAX-8', +// 'SIGRTMAX-9', +// 'SIGRTMIN', +// 'SIGRTMIN+1', +// 'SIGRTMIN+10', +// 'SIGRTMIN+11', +// 'SIGRTMIN+12', +// 'SIGRTMIN+13', +// 'SIGRTMIN+14', +// 'SIGRTMIN+15', +// 'SIGRTMIN+16', +// 'SIGRTMIN+2', +// 'SIGRTMIN+3', +// 'SIGRTMIN+4', +// 'SIGRTMIN+5', +// 'SIGRTMIN+6', +// 'SIGRTMIN+7', +// 'SIGRTMIN+8', +// 'SIGRTMIN+9', +// 'SIGSTKFLT', +// 'SIGUNUSED', +//# sourceMappingURL=all-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.js.map b/node_modules/foreground-child/dist/esm/all-signals.js.map new file mode 100644 index 0000000..1c63c6b --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.js","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,MAAM,CAAC,MAAM,UAAU;AACrB,0EAA0E;AAC1E,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,CACF,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;IACnB,iDAAiD;IACjD,CAAC,KAAK,SAAS;IACf,yDAAyD;IACzD,CAAC,KAAK,SAAS,CACE,CAAA;AAEvB,8DAA8D;AAC9D,gEAAgE;AAChE,6DAA6D;AAC7D,gCAAgC;AAChC,EAAE;AACF,YAAY;AACZ,aAAa;AACb,aAAa;AACb,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,eAAe;AACf,eAAe","sourcesContent":["import constants from 'node:constants'\nexport const allSignals =\n // this is the full list of signals that Node will let us do anything with\n Object.keys(constants).filter(\n k =>\n k.startsWith('SIG') &&\n // https://github.com/tapjs/signal-exit/issues/21\n k !== 'SIGPROF' &&\n // no sense trying to listen for SIGKILL, it's impossible\n k !== 'SIGKILL',\n ) as NodeJS.Signals[]\n\n// These are some obscure signals that are reported by kill -l\n// on macOS, Linux, or Windows, but which don't have any mapping\n// in Node.js. No sense trying if they're just going to throw\n// every time on every platform.\n//\n// 'SIGEMT',\n// 'SIGLOST',\n// 'SIGPOLL',\n// 'SIGRTMAX',\n// 'SIGRTMAX-1',\n// 'SIGRTMAX-10',\n// 'SIGRTMAX-11',\n// 'SIGRTMAX-12',\n// 'SIGRTMAX-13',\n// 'SIGRTMAX-14',\n// 'SIGRTMAX-15',\n// 'SIGRTMAX-2',\n// 'SIGRTMAX-3',\n// 'SIGRTMAX-4',\n// 'SIGRTMAX-5',\n// 'SIGRTMAX-6',\n// 'SIGRTMAX-7',\n// 'SIGRTMAX-8',\n// 'SIGRTMAX-9',\n// 'SIGRTMIN',\n// 'SIGRTMIN+1',\n// 'SIGRTMIN+10',\n// 'SIGRTMIN+11',\n// 'SIGRTMIN+12',\n// 'SIGRTMIN+13',\n// 'SIGRTMIN+14',\n// 'SIGRTMIN+15',\n// 'SIGRTMIN+16',\n// 'SIGRTMIN+2',\n// 'SIGRTMIN+3',\n// 'SIGRTMIN+4',\n// 'SIGRTMIN+5',\n// 'SIGRTMIN+6',\n// 'SIGRTMIN+7',\n// 'SIGRTMIN+8',\n// 'SIGRTMIN+9',\n// 'SIGSTKFLT',\n// 'SIGUNUSED',\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.d.ts b/node_modules/foreground-child/dist/esm/index.d.ts new file mode 100644 index 0000000..ac8f1fc --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.d.ts @@ -0,0 +1,63 @@ +/// +/// +import { ChildProcessByStdio, SpawnOptions } from 'child_process'; +/** + * The signature for the cleanup method. + * + * Arguments indicate the exit status of the child process. + * + * If a Promise is returned, then the process is not terminated + * until it resolves, and the resolution value is treated as the + * exit status (if a number) or signal exit (if a signal string). + * + * If `undefined` is returned, then no change is made, and the parent + * exits in the same way that the child exited. + * + * If boolean `false` is returned, then the parent's exit is canceled. + * + * If a number is returned, then the parent process exits with the number + * as its exitCode. + * + * If a signal string is returned, then the parent process is killed with + * the same signal that caused the child to exit. + */ +export type Cleanup = (code: number | null, signal: null | NodeJS.Signals) => void | undefined | number | NodeJS.Signals | false | Promise; +export type FgArgs = [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup] | [ + program: [cmd: string, ...args: string[]], + opts?: SpawnOptions, + cleanup?: Cleanup +] | [program: string, cleanup?: Cleanup] | [program: string, opts?: SpawnOptions, cleanup?: Cleanup] | [program: string, args?: string[], cleanup?: Cleanup] | [ + program: string, + args?: string[], + opts?: SpawnOptions, + cleanup?: Cleanup +]; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +export declare const normalizeFgArgs: (fgArgs: FgArgs) => [ + program: string, + args: string[], + spawnOpts: SpawnOptions, + cleanup: Cleanup +]; +/** + * Spawn the specified program as a "foreground" process, or at least as + * close as is possible given node's lack of exec-without-fork. + * + * Cleanup method may be used to modify or ignore the result of the child's + * exit code or signal. If cleanup returns undefined (or a Promise that + * resolves to undefined), then the parent will exit in the same way that + * the child did. + * + * Return boolean `false` to prevent the parent's exit entirely. + */ +export declare function foregroundChild(cmd: string | [cmd: string, ...args: string[]], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.d.ts.map b/node_modules/foreground-child/dist/esm/index.d.ts.map new file mode 100644 index 0000000..7b6416c --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,mBAAmB,EAInB,YAAY,EACb,MAAM,eAAe,CAAA;AAUtB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,IAAI,GA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AAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.js b/node_modules/foreground-child/dist/esm/index.js new file mode 100644 index 0000000..d42ba8f --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.js @@ -0,0 +1,113 @@ +import { spawn as nodeSpawn, } from 'child_process'; +import crossSpawn from 'cross-spawn'; +import { onExit } from 'signal-exit'; +import { proxySignals } from './proxy-signals.js'; +import { watchdog } from './watchdog.js'; +/* c8 ignore start */ +const spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +export const normalizeFgArgs = (fgArgs) => { + let [program, args = [], spawnOpts = {}, cleanup = () => { }] = fgArgs; + if (typeof args === 'function') { + cleanup = args; + spawnOpts = {}; + args = []; + } + else if (!!args && typeof args === 'object' && !Array.isArray(args)) { + if (typeof spawnOpts === 'function') + cleanup = spawnOpts; + spawnOpts = args; + args = []; + } + else if (typeof spawnOpts === 'function') { + cleanup = spawnOpts; + spawnOpts = {}; + } + if (Array.isArray(program)) { + const [pp, ...pa] = program; + program = pp; + args = pa; + } + return [program, args, { ...spawnOpts }, cleanup]; +}; +export function foregroundChild(...fgArgs) { + const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs); + spawnOpts.stdio = [0, 1, 2]; + if (process.send) { + spawnOpts.stdio.push('ipc'); + } + const child = spawn(program, args, spawnOpts); + const childHangup = () => { + try { + child.kill('SIGHUP'); + /* c8 ignore start */ + } + catch (_) { + // SIGHUP is weird on windows + child.kill('SIGTERM'); + } + /* c8 ignore stop */ + }; + const removeOnExit = onExit(childHangup); + proxySignals(child); + watchdog(child); + let done = false; + child.on('close', async (code, signal) => { + /* c8 ignore start */ + if (done) + return; + /* c8 ignore stop */ + done = true; + const result = cleanup(code, signal); + const res = isPromise(result) ? await result : result; + removeOnExit(); + if (res === false) + return; + else if (typeof res === 'string') { + signal = res; + code = null; + } + else if (typeof res === 'number') { + code = res; + signal = null; + } + if (signal) { + // If there is nothing else keeping the event loop alive, + // then there's a race between a graceful exit and getting + // the signal to this process. Put this timeout here to + // make sure we're still alive to get the signal, and thus + // exit with the intended signal code. + /* istanbul ignore next */ + setTimeout(() => { }, 2000); + try { + process.kill(process.pid, signal); + /* c8 ignore start */ + } + catch (_) { + process.kill(process.pid, 'SIGTERM'); + } + /* c8 ignore stop */ + } + else { + process.exit(code || 0); + } + }); + if (process.send) { + process.removeAllListeners('message'); + child.on('message', (message, sendHandle) => { + process.send?.(message, sendHandle); + }); + process.on('message', (message, sendHandle) => { + child.send(message, sendHandle); + }); + } + return child; +} +const isPromise = (o) => !!o && typeof o === 'object' && typeof o.then === 'function'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.js.map b/node_modules/foreground-child/dist/esm/index.js.map new file mode 100644 index 0000000..0f244d1 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js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,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC5C,KAAK,CAAC,IAAI,CACR,OAAuB,EACvB,UAAoC,CACrC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,CAAM,EAAqB,EAAE,CAC9C,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAA","sourcesContent":["import {\n ChildProcessByStdio,\n SendHandle,\n Serializable,\n spawn as nodeSpawn,\n SpawnOptions,\n} from 'child_process'\nimport crossSpawn from 'cross-spawn'\nimport { onExit } from 'signal-exit'\nimport { proxySignals } from './proxy-signals.js'\nimport { watchdog } from './watchdog.js'\n\n/* c8 ignore start */\nconst spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn\n/* c8 ignore stop */\n\n/**\n * The signature for the cleanup method.\n *\n * Arguments indicate the exit status of the child process.\n *\n * If a Promise is returned, then the process is not terminated\n * until it resolves, and the resolution value is treated as the\n * exit status (if a number) or signal exit (if a signal string).\n *\n * If `undefined` is returned, then no change is made, and the parent\n * exits in the same way that the child exited.\n *\n * If boolean `false` is returned, then the parent's exit is canceled.\n *\n * If a number is returned, then the parent process exits with the number\n * as its exitCode.\n *\n * If a signal string is returned, then the parent process is killed with\n * the same signal that caused the child to exit.\n */\nexport type Cleanup = (\n code: number | null,\n signal: null | NodeJS.Signals,\n) =>\n | void\n | undefined\n | number\n | NodeJS.Signals\n | false\n | Promise\n\nexport type FgArgs =\n | [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup]\n | [\n program: [cmd: string, ...args: string[]],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n | [program: string, cleanup?: Cleanup]\n | [program: string, opts?: SpawnOptions, cleanup?: Cleanup]\n | [program: string, args?: string[], cleanup?: Cleanup]\n | [\n program: string,\n args?: string[],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n\n/**\n * Normalizes the arguments passed to `foregroundChild`.\n *\n * Exposed for testing.\n *\n * @internal\n */\nexport const normalizeFgArgs = (\n fgArgs: FgArgs,\n): [\n program: string,\n args: string[],\n spawnOpts: SpawnOptions,\n cleanup: Cleanup,\n] => {\n let [program, args = [], spawnOpts = {}, cleanup = () => {}] = fgArgs\n if (typeof args === 'function') {\n cleanup = args\n spawnOpts = {}\n args = []\n } else if (!!args && typeof args === 'object' && !Array.isArray(args)) {\n if (typeof spawnOpts === 'function') cleanup = spawnOpts\n spawnOpts = args\n args = []\n } else if (typeof spawnOpts === 'function') {\n cleanup = spawnOpts\n spawnOpts = {}\n }\n if (Array.isArray(program)) {\n const [pp, ...pa] = program\n program = pp\n args = pa\n }\n return [program, args, { ...spawnOpts }, cleanup]\n}\n\n/**\n * Spawn the specified program as a \"foreground\" process, or at least as\n * close as is possible given node's lack of exec-without-fork.\n *\n * Cleanup method may be used to modify or ignore the result of the child's\n * exit code or signal. If cleanup returns undefined (or a Promise that\n * resolves to undefined), then the parent will exit in the same way that\n * the child did.\n *\n * Return boolean `false` to prevent the parent's exit entirely.\n */\nexport function foregroundChild(\n cmd: string | [cmd: string, ...args: string[]],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n ...fgArgs: FgArgs\n): ChildProcessByStdio {\n const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs)\n\n spawnOpts.stdio = [0, 1, 2]\n if (process.send) {\n spawnOpts.stdio.push('ipc')\n }\n\n const child = spawn(program, args, spawnOpts) as ChildProcessByStdio<\n null,\n null,\n null\n >\n\n const childHangup = () => {\n try {\n child.kill('SIGHUP')\n\n /* c8 ignore start */\n } catch (_) {\n // SIGHUP is weird on windows\n child.kill('SIGTERM')\n }\n /* c8 ignore stop */\n }\n const removeOnExit = onExit(childHangup)\n\n proxySignals(child)\n watchdog(child)\n\n let done = false\n child.on('close', async (code, signal) => {\n /* c8 ignore start */\n if (done) return\n /* c8 ignore stop */\n done = true\n const result = cleanup(code, signal)\n const res = isPromise(result) ? await result : result\n removeOnExit()\n\n if (res === false) return\n else if (typeof res === 'string') {\n signal = res\n code = null\n } else if (typeof res === 'number') {\n code = res\n signal = null\n }\n\n if (signal) {\n // If there is nothing else keeping the event loop alive,\n // then there's a race between a graceful exit and getting\n // the signal to this process. Put this timeout here to\n // make sure we're still alive to get the signal, and thus\n // exit with the intended signal code.\n /* istanbul ignore next */\n setTimeout(() => {}, 2000)\n try {\n process.kill(process.pid, signal)\n /* c8 ignore start */\n } catch (_) {\n process.kill(process.pid, 'SIGTERM')\n }\n /* c8 ignore stop */\n } else {\n process.exit(code || 0)\n }\n })\n\n if (process.send) {\n process.removeAllListeners('message')\n\n child.on('message', (message, sendHandle) => {\n process.send?.(message, sendHandle)\n })\n\n process.on('message', (message, sendHandle) => {\n child.send(\n message as Serializable,\n sendHandle as SendHandle | undefined,\n )\n })\n }\n\n return child\n}\n\nconst isPromise = (o: any): o is Promise =>\n !!o && typeof o === 'object' && typeof o.then === 'function'\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/package.json b/node_modules/foreground-child/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/foreground-child/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.d.ts b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts new file mode 100644 index 0000000..aadb9f6 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts @@ -0,0 +1,7 @@ +/// +import { type ChildProcess } from 'child_process'; +/** + * Starts forwarding signals to `child` through `parent`. + */ +export declare const proxySignals: (child: ChildProcess) => () => void; +//# sourceMappingURL=proxy-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map new file mode 100644 index 0000000..9c98b7f --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.js b/node_modules/foreground-child/dist/esm/proxy-signals.js new file mode 100644 index 0000000..8e1efe3 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.js @@ -0,0 +1,34 @@ +import { allSignals } from './all-signals.js'; +/** + * Starts forwarding signals to `child` through `parent`. + */ +export const proxySignals = (child) => { + const listeners = new Map(); + for (const sig of allSignals) { + const listener = () => { + // some signals can only be received, not sent + try { + child.kill(sig); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }; + try { + // if it's a signal this system doesn't recognize, skip it + process.on(sig, listener); + listeners.set(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + } + const unproxy = () => { + for (const [sig, listener] of listeners) { + process.removeListener(sig, listener); + } + }; + child.on('exit', unproxy); + return unproxy; +}; +//# sourceMappingURL=proxy-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.js.map b/node_modules/foreground-child/dist/esm/proxy-signals.js.map new file mode 100644 index 0000000..978750f --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.js","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAmB,EAAE,EAAE;IAClD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;IAE3B,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,8CAA8C;YAC9C,IAAI,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACf,qBAAqB;YACvB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;YACd,oBAAoB;QACtB,CAAC,CAAA;QACD,IAAI,CAAC;YACH,0DAA0D;YAC1D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YACzB,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC5B,qBAAqB;QACvB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;QACd,oBAAoB;IACtB,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,SAAS,EAAE,CAAC;YACxC,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QACvC,CAAC;IACH,CAAC,CAAA;IACD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzB,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import { type ChildProcess } from 'child_process'\nimport { allSignals } from './all-signals.js'\n\n/**\n * Starts forwarding signals to `child` through `parent`.\n */\nexport const proxySignals = (child: ChildProcess) => {\n const listeners = new Map()\n\n for (const sig of allSignals) {\n const listener = () => {\n // some signals can only be received, not sent\n try {\n child.kill(sig)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n try {\n // if it's a signal this system doesn't recognize, skip it\n process.on(sig, listener)\n listeners.set(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n\n const unproxy = () => {\n for (const [sig, listener] of listeners) {\n process.removeListener(sig, listener)\n }\n }\n child.on('exit', unproxy)\n return unproxy\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.d.ts b/node_modules/foreground-child/dist/esm/watchdog.d.ts new file mode 100644 index 0000000..edfdf4d --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.d.ts @@ -0,0 +1,11 @@ +/// +import { ChildProcess } from 'child_process'; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +export declare const watchdog: (child: ChildProcess) => ChildProcess; +//# sourceMappingURL=watchdog.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.d.ts.map b/node_modules/foreground-child/dist/esm/watchdog.d.ts.map new file mode 100644 index 0000000..cc6a668 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.js b/node_modules/foreground-child/dist/esm/watchdog.js new file mode 100644 index 0000000..7aa184e --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.js @@ -0,0 +1,46 @@ +// this spawns a child process that listens for SIGHUP when the +// parent process exits, and after 200ms, sends a SIGKILL to the +// child, in case it did not terminate. +import { spawn } from 'child_process'; +const watchdogCode = String.raw ` +const pid = parseInt(process.argv[1], 10) +process.title = 'node (foreground-child watchdog pid=' + pid + ')' +if (!isNaN(pid)) { + let barked = false + // keepalive + const interval = setInterval(() => {}, 60000) + const bark = () => { + clearInterval(interval) + if (barked) return + barked = true + process.removeListener('SIGHUP', bark) + setTimeout(() => { + try { + process.kill(pid, 'SIGKILL') + setTimeout(() => process.exit(), 200) + } catch (_) {} + }, 500) + }) + process.on('SIGHUP', bark) +} +`; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +export const watchdog = (child) => { + let dogExited = false; + const dog = spawn(process.execPath, ['-e', watchdogCode, String(child.pid)], { + stdio: 'ignore', + }); + dog.on('exit', () => (dogExited = true)); + child.on('exit', () => { + if (!dogExited) + dog.kill('SIGKILL'); + }); + return dog; +}; +//# sourceMappingURL=watchdog.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.js.map b/node_modules/foreground-child/dist/esm/watchdog.js.map new file mode 100644 index 0000000..6f4e39f --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.js.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.js","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gEAAgE;AAChE,uCAAuC;AAEvC,OAAO,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAA;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC9C,IAAI,SAAS,GAAG,KAAK,CAAA;IACrB,MAAM,GAAG,GAAG,KAAK,CACf,OAAO,CAAC,QAAQ,EAChB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EACvC;QACE,KAAK,EAAE,QAAQ;KAChB,CACF,CAAA;IACD,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAA;IACxC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,IAAI,CAAC,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA","sourcesContent":["// this spawns a child process that listens for SIGHUP when the\n// parent process exits, and after 200ms, sends a SIGKILL to the\n// child, in case it did not terminate.\n\nimport { ChildProcess, spawn } from 'child_process'\n\nconst watchdogCode = String.raw`\nconst pid = parseInt(process.argv[1], 10)\nprocess.title = 'node (foreground-child watchdog pid=' + pid + ')'\nif (!isNaN(pid)) {\n let barked = false\n // keepalive\n const interval = setInterval(() => {}, 60000)\n const bark = () => {\n clearInterval(interval)\n if (barked) return\n barked = true\n process.removeListener('SIGHUP', bark)\n setTimeout(() => {\n try {\n process.kill(pid, 'SIGKILL')\n setTimeout(() => process.exit(), 200)\n } catch (_) {}\n }, 500)\n })\n process.on('SIGHUP', bark)\n}\n`\n\n/**\n * Pass in a ChildProcess, and this will spawn a watchdog process that\n * will make sure it exits if the parent does, thus preventing any\n * dangling detached zombie processes.\n *\n * If the child ends before the parent, then the watchdog will terminate.\n */\nexport const watchdog = (child: ChildProcess) => {\n let dogExited = false\n const dog = spawn(\n process.execPath,\n ['-e', watchdogCode, String(child.pid)],\n {\n stdio: 'ignore',\n },\n )\n dog.on('exit', () => (dogExited = true))\n child.on('exit', () => {\n if (!dogExited) dog.kill('SIGKILL')\n })\n return dog\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/package.json b/node_modules/foreground-child/package.json new file mode 100644 index 0000000..e157528 --- /dev/null +++ b/node_modules/foreground-child/package.json @@ -0,0 +1,111 @@ +{ + "name": "foreground-child", + "version": "3.2.1", + "description": "Run a child as if it's the foreground process. Give it stdio. Exit when it exits.", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "exports": { + "./watchdog": { + "import": { + "source": "./src/watchdog.ts", + "types": "./dist/esm/watchdog.d.ts", + "default": "./dist/esm/watchdog.js" + }, + "require": { + "source": "./src/watchdog.ts", + "types": "./dist/commonjs/watchdog.d.ts", + "default": "./dist/commonjs/watchdog.js" + } + }, + "./proxy-signals": { + "import": { + "source": "./src/proxy-signals.ts", + "types": "./dist/esm/proxy-signals.d.ts", + "default": "./dist/esm/proxy-signals.js" + }, + "require": { + "source": "./src/proxy-signals.ts", + "types": "./dist/commonjs/proxy-signals.d.ts", + "default": "./dist/commonjs/proxy-signals.js" + } + }, + "./package.json": "./package.json", + ".": { + "import": { + "source": "./src/index.ts", + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "source": "./src/index.ts", + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=14" + }, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "typecheck": true + }, + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/foreground-child.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "devDependencies": { + "@types/cross-spawn": "^6.0.2", + "@types/node": "^18.15.11", + "@types/tap": "^15.0.8", + "prettier": "^3.3.2", + "tap": "^19.2.5", + "tshy": "^1.15.1", + "typedoc": "^0.24.2", + "typescript": "^5.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "tshy": { + "exports": { + "./watchdog": "./src/watchdog.ts", + "./proxy-signals": "./src/proxy-signals.ts", + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "type": "module" +} diff --git a/node_modules/fs.realpath/LICENSE b/node_modules/fs.realpath/LICENSE new file mode 100644 index 0000000..5bd884c --- /dev/null +++ b/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + 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. diff --git a/node_modules/fs.realpath/README.md b/node_modules/fs.realpath/README.md new file mode 100644 index 0000000..a42ceac --- /dev/null +++ b/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/node_modules/fs.realpath/index.js b/node_modules/fs.realpath/index.js new file mode 100644 index 0000000..b09c7c7 --- /dev/null +++ b/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/node_modules/fs.realpath/old.js b/node_modules/fs.realpath/old.js new file mode 100644 index 0000000..b40305e --- /dev/null +++ b/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// 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 pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json new file mode 100644 index 0000000..3edc57d --- /dev/null +++ b/node_modules/fs.realpath/package.json @@ -0,0 +1,26 @@ +{ + "name": "fs.realpath", + "version": "1.0.0", + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "old.js", + "index.js" + ] +} diff --git a/node_modules/function-bind/.eslintrc b/node_modules/function-bind/.eslintrc new file mode 100644 index 0000000..71a054f --- /dev/null +++ b/node_modules/function-bind/.eslintrc @@ -0,0 +1,21 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "indent": [2, 4], + "no-new-func": [1], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "max-lines-per-function": 0, + "strict": [0] + }, + }, + ], +} diff --git a/node_modules/function-bind/.github/FUNDING.yml b/node_modules/function-bind/.github/FUNDING.yml new file mode 100644 index 0000000..7448219 --- /dev/null +++ b/node_modules/function-bind/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/function-bind +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/function-bind/.github/SECURITY.md b/node_modules/function-bind/.github/SECURITY.md new file mode 100644 index 0000000..82e4285 --- /dev/null +++ b/node_modules/function-bind/.github/SECURITY.md @@ -0,0 +1,3 @@ +# Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. diff --git a/node_modules/function-bind/.nycrc b/node_modules/function-bind/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/node_modules/function-bind/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/function-bind/CHANGELOG.md b/node_modules/function-bind/CHANGELOG.md new file mode 100644 index 0000000..f9e6cc0 --- /dev/null +++ b/node_modules/function-bind/CHANGELOG.md @@ -0,0 +1,136 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.2](https://github.com/ljharb/function-bind/compare/v1.1.1...v1.1.2) - 2023-10-12 + +### Merged + +- Point to the correct file [`#16`](https://github.com/ljharb/function-bind/pull/16) + +### Commits + +- [Tests] migrate tests to Github Actions [`4f8b57c`](https://github.com/ljharb/function-bind/commit/4f8b57c02f2011fe9ae353d5e74e8745f0988af8) +- [Tests] remove `jscs` [`90eb2ed`](https://github.com/ljharb/function-bind/commit/90eb2edbeefd5b76cd6c3a482ea3454db169b31f) +- [meta] update `.gitignore` [`53fcdc3`](https://github.com/ljharb/function-bind/commit/53fcdc371cd66634d6e9b71c836a50f437e89fed) +- [Tests] up to `node` `v11.10`, `v10.15`, `v9.11`, `v8.15`, `v6.16`, `v4.9`; use `nvm install-latest-npm`; run audit script in tests [`1fe8f6e`](https://github.com/ljharb/function-bind/commit/1fe8f6e9aed0dfa8d8b3cdbd00c7f5ea0cd2b36e) +- [meta] add `auto-changelog` [`1921fcb`](https://github.com/ljharb/function-bind/commit/1921fcb5b416b63ffc4acad051b6aad5722f777d) +- [Robustness] remove runtime dependency on all builtins except `.apply` [`f743e61`](https://github.com/ljharb/function-bind/commit/f743e61aa6bb2360358c04d4884c9db853d118b7) +- Docs: enable badges; update wording [`503cb12`](https://github.com/ljharb/function-bind/commit/503cb12d998b5f91822776c73332c7adcd6355dd) +- [readme] update badges [`290c5db`](https://github.com/ljharb/function-bind/commit/290c5dbbbda7264efaeb886552a374b869a4bb48) +- [Tests] switch to nyc for coverage [`ea360ba`](https://github.com/ljharb/function-bind/commit/ea360ba907fc2601ed18d01a3827fa2d3533cdf8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`cae5e9e`](https://github.com/ljharb/function-bind/commit/cae5e9e07a5578dc6df26c03ee22851ce05b943c) +- [meta] add `funding` field; create FUNDING.yml [`c9f4274`](https://github.com/ljharb/function-bind/commit/c9f4274aa80ea3aae9657a3938fdba41a3b04ca6) +- [Tests] fix eslint errors from #15 [`f69aaa2`](https://github.com/ljharb/function-bind/commit/f69aaa2beb2fdab4415bfb885760a699d0b9c964) +- [actions] fix permissions [`99a0cd9`](https://github.com/ljharb/function-bind/commit/99a0cd9f3b5bac223a0d572f081834cd73314be7) +- [meta] use `npmignore` to autogenerate an npmignore file [`f03b524`](https://github.com/ljharb/function-bind/commit/f03b524ca91f75a109a5d062f029122c86ecd1ae) +- [Dev Deps] update `@ljharb/eslint‑config`, `eslint`, `tape` [`7af9300`](https://github.com/ljharb/function-bind/commit/7af930023ae2ce7645489532821e4fbbcd7a2280) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`64a9127`](https://github.com/ljharb/function-bind/commit/64a9127ab0bd331b93d6572eaf6e9971967fc08c) +- [Tests] use `aud` instead of `npm audit` [`e75069c`](https://github.com/ljharb/function-bind/commit/e75069c50010a8fcce2a9ce2324934c35fdb4386) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`d03555c`](https://github.com/ljharb/function-bind/commit/d03555ca59dea3b71ce710045e4303b9e2619e28) +- [meta] add `safe-publish-latest` [`9c8f809`](https://github.com/ljharb/function-bind/commit/9c8f8092aed027d7e80c94f517aa892385b64f09) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`baf6893`](https://github.com/ljharb/function-bind/commit/baf6893e27f5b59abe88bc1995e6f6ed1e527397) +- [meta] create SECURITY.md [`4db1779`](https://github.com/ljharb/function-bind/commit/4db17799f1f28ae294cb95e0081ca2b591c3911b) +- [Tests] add `npm run audit` [`c8b38ec`](https://github.com/ljharb/function-bind/commit/c8b38ec40ed3f85dabdee40ed4148f1748375bc2) +- Revert "Point to the correct file" [`05cdf0f`](https://github.com/ljharb/function-bind/commit/05cdf0fa205c6a3c5ba40bbedd1dfa9874f915c9) + +## [v1.1.1](https://github.com/ljharb/function-bind/compare/v1.1.0...v1.1.1) - 2017-08-28 + +### Commits + +- [Tests] up to `node` `v8`; newer npm breaks on older node; fix scripts [`817f7d2`](https://github.com/ljharb/function-bind/commit/817f7d28470fdbff8ef608d4d565dd4d1430bc5e) +- [Dev Deps] update `eslint`, `jscs`, `tape`, `@ljharb/eslint-config` [`854288b`](https://github.com/ljharb/function-bind/commit/854288b1b6f5c555f89aceb9eff1152510262084) +- [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`83e639f`](https://github.com/ljharb/function-bind/commit/83e639ff74e6cd6921285bccec22c1bcf72311bd) +- Only apps should have lockfiles [`5ed97f5`](https://github.com/ljharb/function-bind/commit/5ed97f51235c17774e0832e122abda0f3229c908) +- Use a SPDX-compliant “license” field. [`5feefea`](https://github.com/ljharb/function-bind/commit/5feefea0dc0193993e83e5df01ded424403a5381) + +## [v1.1.0](https://github.com/ljharb/function-bind/compare/v1.0.2...v1.1.0) - 2016-02-14 + +### Commits + +- Update `eslint`, `tape`; use my personal shared `eslint` config [`9c9062a`](https://github.com/ljharb/function-bind/commit/9c9062abbe9dd70b59ea2c3a3c3a81f29b457097) +- Add `npm run eslint` [`dd96c56`](https://github.com/ljharb/function-bind/commit/dd96c56720034a3c1ffee10b8a59a6f7c53e24ad) +- [New] return the native `bind` when available. [`82186e0`](https://github.com/ljharb/function-bind/commit/82186e03d73e580f95ff167e03f3582bed90ed72) +- [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`a3dd767`](https://github.com/ljharb/function-bind/commit/a3dd76720c795cb7f4586b0544efabf8aa107b8b) +- Update `eslint` [`3dae2f7`](https://github.com/ljharb/function-bind/commit/3dae2f7423de30a2d20313ddb1edc19660142fe9) +- Update `tape`, `covert`, `jscs` [`a181eee`](https://github.com/ljharb/function-bind/commit/a181eee0cfa24eb229c6e843a971f36e060a2f6a) +- [Tests] up to `node` `v5.6`, `v4.3` [`964929a`](https://github.com/ljharb/function-bind/commit/964929a6a4ddb36fb128de2bcc20af5e4f22e1ed) +- Test up to `io.js` `v2.1` [`2be7310`](https://github.com/ljharb/function-bind/commit/2be7310f2f74886a7124ca925be411117d41d5ea) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`45f3d68`](https://github.com/ljharb/function-bind/commit/45f3d6865c6ca93726abcef54febe009087af101) +- [Dev Deps] update `tape`, `jscs` [`6e1340d`](https://github.com/ljharb/function-bind/commit/6e1340d94642deaecad3e717825db641af4f8b1f) +- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`d9bad2b`](https://github.com/ljharb/function-bind/commit/d9bad2b778b1b3a6dd2876087b88b3acf319f8cc) +- Update `eslint` [`935590c`](https://github.com/ljharb/function-bind/commit/935590caa024ab356102e4858e8fc315b2ccc446) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`8c9a1ef`](https://github.com/ljharb/function-bind/commit/8c9a1efd848e5167887aa8501857a0940a480c57) +- Test on `io.js` `v2.2` [`9a3a38c`](https://github.com/ljharb/function-bind/commit/9a3a38c92013aed6e108666e7bd40969b84ac86e) +- Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures. [`69afc26`](https://github.com/ljharb/function-bind/commit/69afc2617405b147dd2a8d8ae73ca9e9283f18b4) +- [Dev Deps] Update `tape`, `eslint` [`36c1be0`](https://github.com/ljharb/function-bind/commit/36c1be0ab12b45fe5df6b0fdb01a5d5137fd0115) +- Update `tape`, `jscs` [`98d8303`](https://github.com/ljharb/function-bind/commit/98d8303cd5ca1c6b8f985469f86b0d44d7d45f6e) +- Update `jscs` [`9633a4e`](https://github.com/ljharb/function-bind/commit/9633a4e9fbf82051c240855166e468ba8ba0846f) +- Update `tape`, `jscs` [`c80ef0f`](https://github.com/ljharb/function-bind/commit/c80ef0f46efc9791e76fa50de4414092ac147831) +- Test up to `io.js` `v3.0` [`7e2c853`](https://github.com/ljharb/function-bind/commit/7e2c8537d52ab9cf5a655755561d8917684c0df4) +- Test on `io.js` `v2.4` [`5a199a2`](https://github.com/ljharb/function-bind/commit/5a199a27ba46795ba5eaf0845d07d4b8232895c9) +- Test on `io.js` `v2.3` [`a511b88`](https://github.com/ljharb/function-bind/commit/a511b8896de0bddf3b56862daa416c701f4d0453) +- Fixing a typo from 822b4e1938db02dc9584aa434fd3a45cb20caf43 [`732d6b6`](https://github.com/ljharb/function-bind/commit/732d6b63a9b33b45230e630dbcac7a10855d3266) +- Update `jscs` [`da52a48`](https://github.com/ljharb/function-bind/commit/da52a4886c06d6490f46ae30b15e4163ba08905d) +- Lock covert to v1.0.0. [`d6150fd`](https://github.com/ljharb/function-bind/commit/d6150fda1e6f486718ebdeff823333d9e48e7430) + +## [v1.0.2](https://github.com/ljharb/function-bind/compare/v1.0.1...v1.0.2) - 2014-10-04 + +## [v1.0.1](https://github.com/ljharb/function-bind/compare/v1.0.0...v1.0.1) - 2014-10-03 + +### Merged + +- make CI build faster [`#3`](https://github.com/ljharb/function-bind/pull/3) + +### Commits + +- Using my standard jscs.json [`d8ee94c`](https://github.com/ljharb/function-bind/commit/d8ee94c993eff0a84cf5744fe6a29627f5cffa1a) +- Adding `npm run lint` [`7571ab7`](https://github.com/ljharb/function-bind/commit/7571ab7dfdbd99b25a1dbb2d232622bd6f4f9c10) +- Using consistent indentation [`e91a1b1`](https://github.com/ljharb/function-bind/commit/e91a1b13a61e99ec1e530e299b55508f74218a95) +- Updating jscs [`7e17892`](https://github.com/ljharb/function-bind/commit/7e1789284bc629bc9c1547a61c9b227bbd8c7a65) +- Using consistent quotes [`c50b57f`](https://github.com/ljharb/function-bind/commit/c50b57fcd1c5ec38320979c837006069ebe02b77) +- Adding keywords [`cb94631`](https://github.com/ljharb/function-bind/commit/cb946314eed35f21186a25fb42fc118772f9ee00) +- Directly export a function expression instead of using a declaration, and relying on hoisting. [`5a33c5f`](https://github.com/ljharb/function-bind/commit/5a33c5f45642de180e0d207110bf7d1843ceb87c) +- Naming npm URL and badge in README; use SVG [`2aef8fc`](https://github.com/ljharb/function-bind/commit/2aef8fcb79d54e63a58ae557c4e60949e05d5e16) +- Naming deps URLs in README [`04228d7`](https://github.com/ljharb/function-bind/commit/04228d766670ee45ca24e98345c1f6a7621065b5) +- Naming travis-ci URLs in README; using SVG [`62c810c`](https://github.com/ljharb/function-bind/commit/62c810c2f54ced956cd4d4ab7b793055addfe36e) +- Make sure functions are invoked correctly (also passing coverage tests) [`2b289b4`](https://github.com/ljharb/function-bind/commit/2b289b4dfbf037ffcfa4dc95eb540f6165e9e43a) +- Removing the strict mode pragmas; they make tests fail. [`1aa701d`](https://github.com/ljharb/function-bind/commit/1aa701d199ddc3782476e8f7eef82679be97b845) +- Adding myself as a contributor [`85fd57b`](https://github.com/ljharb/function-bind/commit/85fd57b0860e5a7af42de9a287f3f265fc6d72fc) +- Adding strict mode pragmas [`915b08e`](https://github.com/ljharb/function-bind/commit/915b08e084c86a722eafe7245e21db74aa21ca4c) +- Adding devDeps URLs to README [`4ccc731`](https://github.com/ljharb/function-bind/commit/4ccc73112c1769859e4ca3076caf4086b3cba2cd) +- Fixing the description. [`a7a472c`](https://github.com/ljharb/function-bind/commit/a7a472cf649af515c635cf560fc478fbe48999c8) +- Using a function expression instead of a function declaration. [`b5d3e4e`](https://github.com/ljharb/function-bind/commit/b5d3e4ea6aaffc63888953eeb1fbc7ff45f1fa14) +- Updating tape [`f086be6`](https://github.com/ljharb/function-bind/commit/f086be6029fb56dde61a258c1340600fa174d1e0) +- Updating jscs [`5f9bdb3`](https://github.com/ljharb/function-bind/commit/5f9bdb375ab13ba48f30852aab94029520c54d71) +- Updating jscs [`9b409ba`](https://github.com/ljharb/function-bind/commit/9b409ba6118e23395a4e5d83ef39152aab9d3bfc) +- Run coverage as part of tests. [`8e1b6d4`](https://github.com/ljharb/function-bind/commit/8e1b6d459f047d1bd4fee814e01247c984c80bd0) +- Run linter as part of tests [`c1ca83f`](https://github.com/ljharb/function-bind/commit/c1ca83f832df94587d09e621beba682fabfaa987) +- Updating covert [`701e837`](https://github.com/ljharb/function-bind/commit/701e83774b57b4d3ef631e1948143f43a72f4bb9) + +## [v1.0.0](https://github.com/ljharb/function-bind/compare/v0.2.0...v1.0.0) - 2014-08-09 + +### Commits + +- Make sure old and unstable nodes don't fail Travis [`27adca3`](https://github.com/ljharb/function-bind/commit/27adca34a4ab6ad67b6dfde43942a1b103ce4d75) +- Fixing an issue when the bound function is called as a constructor in ES3. [`e20122d`](https://github.com/ljharb/function-bind/commit/e20122d267d92ce553859b280cbbea5d27c07731) +- Adding `npm run coverage` [`a2e29c4`](https://github.com/ljharb/function-bind/commit/a2e29c4ecaef9e2f6cd1603e868c139073375502) +- Updating tape [`b741168`](https://github.com/ljharb/function-bind/commit/b741168b12b235b1717ff696087645526b69213c) +- Upgrading tape [`63631a0`](https://github.com/ljharb/function-bind/commit/63631a04c7fbe97cc2fa61829cc27246d6986f74) +- Updating tape [`363cb46`](https://github.com/ljharb/function-bind/commit/363cb46dafb23cb3e347729a22f9448051d78464) + +## v0.2.0 - 2014-03-23 + +### Commits + +- Updating test coverage to match es5-shim. [`aa94d44`](https://github.com/ljharb/function-bind/commit/aa94d44b8f9d7f69f10e060db7709aa7a694e5d4) +- initial [`942ee07`](https://github.com/ljharb/function-bind/commit/942ee07e94e542d91798137bc4b80b926137e066) +- Setting the bound function's length properly. [`079f46a`](https://github.com/ljharb/function-bind/commit/079f46a2d3515b7c0b308c2c13fceb641f97ca25) +- Ensuring that some older browsers will throw when given a regex. [`36ac55b`](https://github.com/ljharb/function-bind/commit/36ac55b87f460d4330253c92870aa26fbfe8227f) +- Removing npm scripts that don't have dependencies [`9d2be60`](https://github.com/ljharb/function-bind/commit/9d2be600002cb8bc8606f8f3585ad3e05868c750) +- Updating tape [`297a4ac`](https://github.com/ljharb/function-bind/commit/297a4acc5464db381940aafb194d1c88f4e678f3) +- Skipping length tests for now. [`d9891ea`](https://github.com/ljharb/function-bind/commit/d9891ea4d2aaffa69f408339cdd61ff740f70565) +- don't take my tea [`dccd930`](https://github.com/ljharb/function-bind/commit/dccd930bfd60ea10cb178d28c97550c3bc8c1e07) diff --git a/node_modules/function-bind/LICENSE b/node_modules/function-bind/LICENSE new file mode 100644 index 0000000..62d6d23 --- /dev/null +++ b/node_modules/function-bind/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +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. + diff --git a/node_modules/function-bind/README.md b/node_modules/function-bind/README.md new file mode 100644 index 0000000..814c20b --- /dev/null +++ b/node_modules/function-bind/README.md @@ -0,0 +1,46 @@ +# function-bind [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] + +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Implementation of function.prototype.bind + +Old versions of phantomjs, Internet Explorer < 9, and node < 0.6 don't support `Function.prototype.bind`. + +## Example + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + +[package-url]: https://npmjs.org/package/function-bind +[npm-version-svg]: https://versionbadg.es/Raynos/function-bind.svg +[deps-svg]: https://david-dm.org/Raynos/function-bind.svg +[deps-url]: https://david-dm.org/Raynos/function-bind +[dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg +[dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/function-bind.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/function-bind.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/function-bind.svg +[downloads-url]: https://npm-stat.com/charts.html?package=function-bind +[codecov-image]: https://codecov.io/gh/Raynos/function-bind/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/Raynos/function-bind/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/Raynos/function-bind +[actions-url]: https://github.com/Raynos/function-bind/actions diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js new file mode 100644 index 0000000..fd4384c --- /dev/null +++ b/node_modules/function-bind/implementation.js @@ -0,0 +1,84 @@ +'use strict'; + +/* 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; +}; diff --git a/node_modules/function-bind/index.js b/node_modules/function-bind/index.js new file mode 100644 index 0000000..3bb6b96 --- /dev/null +++ b/node_modules/function-bind/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json new file mode 100644 index 0000000..6185963 --- /dev/null +++ b/node_modules/function-bind/package.json @@ -0,0 +1,87 @@ +{ + "name": "function-bind", + "version": "1.1.2", + "description": "Implementation of Function.prototype.bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "author": "Raynos ", + "repository": { + "type": "git", + "url": "https://github.com/Raynos/function-bind.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "index", + "homepage": "https://github.com/Raynos/function-bind", + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.3", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.1" + }, + "license": "MIT", + "scripts": { + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepack": "npmignore --auto --commentLines=autogenerated", + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "aud --production", + "tests-only": "nyc tape 'test/**/*.js'", + "lint": "eslint --ext=js,mjs .", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/function-bind/test/.eslintrc b/node_modules/function-bind/test/.eslintrc new file mode 100644 index 0000000..8a56d5b --- /dev/null +++ b/node_modules/function-bind/test/.eslintrc @@ -0,0 +1,9 @@ +{ + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-invalid-this": 0, + "no-magic-numbers": 0, + } +} diff --git a/node_modules/function-bind/test/index.js b/node_modules/function-bind/test/index.js new file mode 100644 index 0000000..2edecce --- /dev/null +++ b/node_modules/function-bind/test/index.js @@ -0,0 +1,252 @@ +// jscs:disable requireUseStrict + +var test = require('tape'); + +var functionBind = require('../implementation'); +var getCurrentContext = function () { return this; }; + +test('functionBind is a function', function (t) { + t.equal(typeof functionBind, 'function'); + t.end(); +}); + +test('non-functions', function (t) { + var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; + t.plan(nonFunctions.length); + for (var i = 0; i < nonFunctions.length; ++i) { + try { functionBind.call(nonFunctions[i]); } catch (ex) { + t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); + } + } + t.end(); +}); + +test('without a context', function (t) { + t.test('binds properly', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }) + }; + namespace.func(1, 2, 3); + st.deepEqual(args, [1, 2, 3]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('binds properly, and still supplies bound arguments', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, undefined, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.deepEqual(args, [1, 2, 3, 4, 5, 6]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('returns properly', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('called as a constructor', function (st) { + var thunkify = function (value) { + return function () { return value; }; + }; + st.test('returns object value', function (sst) { + var expectedReturnValue = [1, 2, 3]; + var Constructor = functionBind.call(thunkify(expectedReturnValue), null); + var result = new Constructor(); + sst.equal(result, expectedReturnValue); + sst.end(); + }); + + st.test('does not return primitive value', function (sst) { + var Constructor = functionBind.call(thunkify(42), null); + var result = new Constructor(); + sst.notEqual(result, 42); + sst.end(); + }); + + st.test('object from bound constructor is instance of original and bound constructor', function (sst) { + var A = function (x) { + this.name = x || 'A'; + }; + var B = functionBind.call(A, null, 'B'); + + var result = new B(); + sst.ok(result instanceof B, 'result is instance of bound constructor'); + sst.ok(result instanceof A, 'result is instance of original constructor'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('with a context', function (t) { + t.test('with no bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext) + }; + namespace.func(1, 2, 3); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); + st.end(); + }); + + t.test('with bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); + st.end(); + }); + + t.test('returns properly', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('passes the correct arguments when called as a constructor', function (st) { + var expected = { name: 'Correct' }; + var namespace = { + Func: functionBind.call(function (arg) { + return arg; + }, { name: 'Incorrect' }) + }; + var returned = new namespace.Func(expected); + st.equal(returned, expected, 'returns the right arg when called as a constructor'); + st.end(); + }); + + t.test('has the new instance\'s context when called as a constructor', function (st) { + var actualContext; + var expectedContext = { foo: 'bar' }; + var namespace = { + Func: functionBind.call(function () { + actualContext = this; + }, expectedContext) + }; + var result = new namespace.Func(); + st.equal(result instanceof namespace.Func, true); + st.notEqual(actualContext, expectedContext); + st.end(); + }); + + t.end(); +}); + +test('bound function length', function (t) { + t.test('sets a correct length without thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); +}); diff --git a/node_modules/get-intrinsic/.eslintrc b/node_modules/get-intrinsic/.eslintrc new file mode 100644 index 0000000..8376636 --- /dev/null +++ b/node_modules/get-intrinsic/.eslintrc @@ -0,0 +1,38 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + "es2017": true, + "es2020": true, + "es2021": true, + "es2022": true, + }, + + "rules": { + "array-bracket-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": 0, + "max-lines": 0, + "max-lines-per-function": [2, 90], + "max-params": [2, 4], + "max-statements": 0, + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "new-cap": 0, + }, + }, + ], +} diff --git a/node_modules/get-intrinsic/.github/FUNDING.yml b/node_modules/get-intrinsic/.github/FUNDING.yml new file mode 100644 index 0000000..8e8da0d --- /dev/null +++ b/node_modules/get-intrinsic/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/get-intrinsic +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/get-intrinsic/.nycrc b/node_modules/get-intrinsic/.nycrc new file mode 100644 index 0000000..bdd626c --- /dev/null +++ b/node_modules/get-intrinsic/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/get-intrinsic/CHANGELOG.md b/node_modules/get-intrinsic/CHANGELOG.md new file mode 100644 index 0000000..96d5397 --- /dev/null +++ b/node_modules/get-intrinsic/CHANGELOG.md @@ -0,0 +1,143 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.2.4](https://github.com/ljharb/get-intrinsic/compare/v1.2.3...v1.2.4) - 2024-02-05 + +### Commits + +- [Refactor] use all 7 <+ ES6 Errors from `es-errors` [`bcac811`](https://github.com/ljharb/get-intrinsic/commit/bcac811abdc1c982e12abf848a410d6aae148d14) + +## [v1.2.3](https://github.com/ljharb/get-intrinsic/compare/v1.2.2...v1.2.3) - 2024-02-03 + +### Commits + +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`f11db9c`](https://github.com/ljharb/get-intrinsic/commit/f11db9c4fb97d87bbd53d3c73ac6b3db3613ad3b) +- [Dev Deps] update `aud`, `es-abstract`, `mock-property`, `npmignore` [`b7ac7d1`](https://github.com/ljharb/get-intrinsic/commit/b7ac7d1616fefb03877b1aed0c8f8d61aad32b6c) +- [meta] simplify `exports` [`faa0cc6`](https://github.com/ljharb/get-intrinsic/commit/faa0cc618e2830ffb51a8202490b0c215d965cbc) +- [meta] add missing `engines.node` [`774dd0b`](https://github.com/ljharb/get-intrinsic/commit/774dd0b3e8f741c3f05a6322d124d6087f146af1) +- [Dev Deps] update `tape` [`5828e8e`](https://github.com/ljharb/get-intrinsic/commit/5828e8e4a04e69312e87a36c0ea39428a7a4c3d8) +- [Robustness] use null objects for lookups [`eb9a11f`](https://github.com/ljharb/get-intrinsic/commit/eb9a11fa9eb3e13b193fcc05a7fb814341b1a7b7) +- [meta] add `sideEffects` flag [`89bcc7a`](https://github.com/ljharb/get-intrinsic/commit/89bcc7a42e19bf07b7c21e3094d5ab177109e6d2) + +## [v1.2.2](https://github.com/ljharb/get-intrinsic/compare/v1.2.1...v1.2.2) - 2023-10-20 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `call-bind`, `es-abstract`, `mock-property`, `object-inspect`, `tape` [`f51bcf2`](https://github.com/ljharb/get-intrinsic/commit/f51bcf26412d58d17ce17c91c9afd0ad271f0762) +- [Refactor] use `hasown` instead of `has` [`18d14b7`](https://github.com/ljharb/get-intrinsic/commit/18d14b799bea6b5765e1cec91890830cbcdb0587) +- [Deps] update `function-bind` [`6e109c8`](https://github.com/ljharb/get-intrinsic/commit/6e109c81e03804cc5e7824fb64353cdc3d8ee2c7) + +## [v1.2.1](https://github.com/ljharb/get-intrinsic/compare/v1.2.0...v1.2.1) - 2023-05-13 + +### Commits + +- [Fix] avoid a crash in envs without `__proto__` [`7bad8d0`](https://github.com/ljharb/get-intrinsic/commit/7bad8d061bf8721733b58b73a2565af2b6756b64) +- [Dev Deps] update `es-abstract` [`c60e6b7`](https://github.com/ljharb/get-intrinsic/commit/c60e6b7b4cf9660c7f27ed970970fd55fac48dc5) + +## [v1.2.0](https://github.com/ljharb/get-intrinsic/compare/v1.1.3...v1.2.0) - 2023-01-19 + +### Commits + +- [actions] update checkout action [`ca6b12f`](https://github.com/ljharb/get-intrinsic/commit/ca6b12f31eaacea4ea3b055e744cd61623385ffb) +- [Dev Deps] update `@ljharb/eslint-config`, `es-abstract`, `object-inspect`, `tape` [`41a3727`](https://github.com/ljharb/get-intrinsic/commit/41a3727d0026fa04273ae216a5f8e12eefd72da8) +- [Fix] ensure `Error.prototype` is undeniable [`c511e97`](https://github.com/ljharb/get-intrinsic/commit/c511e97ae99c764c4524b540dee7a70757af8da3) +- [Dev Deps] update `aud`, `es-abstract`, `tape` [`1bef8a8`](https://github.com/ljharb/get-intrinsic/commit/1bef8a8fd439ebb80863199b6189199e0851ac67) +- [Dev Deps] update `aud`, `es-abstract` [`0d41f16`](https://github.com/ljharb/get-intrinsic/commit/0d41f16bcd500bc28b7bfc98043ebf61ea081c26) +- [New] add `BigInt64Array` and `BigUint64Array` [`a6cca25`](https://github.com/ljharb/get-intrinsic/commit/a6cca25f29635889b7e9bd669baf9e04be90e48c) +- [Tests] use `gopd` [`ecf7722`](https://github.com/ljharb/get-intrinsic/commit/ecf7722240d15cfd16edda06acf63359c10fb9bd) + +## [v1.1.3](https://github.com/ljharb/get-intrinsic/compare/v1.1.2...v1.1.3) - 2022-09-12 + +### Commits + +- [Dev Deps] update `es-abstract`, `es-value-fixtures`, `tape` [`07ff291`](https://github.com/ljharb/get-intrinsic/commit/07ff291816406ebe5a12d7f16965bde0942dd688) +- [Fix] properly check for % signs [`50ac176`](https://github.com/ljharb/get-intrinsic/commit/50ac1760fe99c227e64eabde76e9c0e44cd881b5) + +## [v1.1.2](https://github.com/ljharb/get-intrinsic/compare/v1.1.1...v1.1.2) - 2022-06-08 + +### Fixed + +- [Fix] properly validate against extra % signs [`#16`](https://github.com/ljharb/get-intrinsic/issues/16) + +### Commits + +- [actions] reuse common workflows [`0972547`](https://github.com/ljharb/get-intrinsic/commit/0972547efd0abc863fe4c445a6ca7eb4f8c6901d) +- [meta] use `npmignore` to autogenerate an npmignore file [`5ba0b51`](https://github.com/ljharb/get-intrinsic/commit/5ba0b51d8d8d4f1c31d426d74abc0770fd106bad) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`c364492`](https://github.com/ljharb/get-intrinsic/commit/c364492af4af51333e6f81c0bf21fd3d602c3661) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `es-abstract`, `object-inspect`, `tape` [`dc04dad`](https://github.com/ljharb/get-intrinsic/commit/dc04dad86f6e5608775a2640cb0db5927ae29ed9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `es-abstract`, `object-inspect`, `safe-publish-latest`, `tape` [`1c14059`](https://github.com/ljharb/get-intrinsic/commit/1c1405984e86dd2dc9366c15d8a0294a96a146a5) +- [Tests] use `mock-property` [`b396ef0`](https://github.com/ljharb/get-intrinsic/commit/b396ef05bb73b1d699811abd64b0d9b97997fdda) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`c2c758d`](https://github.com/ljharb/get-intrinsic/commit/c2c758d3b90af4fef0a76910d8d3c292ec8d1d3e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`29e3c09`](https://github.com/ljharb/get-intrinsic/commit/29e3c091c2bf3e17099969847e8729d0e46896de) +- [actions] update codecov uploader [`8cbc141`](https://github.com/ljharb/get-intrinsic/commit/8cbc1418940d7a8941f3a7985cbc4ac095c5e13d) +- [Dev Deps] update `@ljharb/eslint-config`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`10b6f5c`](https://github.com/ljharb/get-intrinsic/commit/10b6f5c02593fb3680c581d696ac124e30652932) +- [readme] add github actions/codecov badges [`4e25400`](https://github.com/ljharb/get-intrinsic/commit/4e25400d9f51ae9eb059cbe22d9144e70ea214e8) +- [Tests] use `for-each` instead of `foreach` [`c05b957`](https://github.com/ljharb/get-intrinsic/commit/c05b957ad9a7bc7721af7cc9e9be1edbfe057496) +- [Dev Deps] update `es-abstract` [`29b05ae`](https://github.com/ljharb/get-intrinsic/commit/29b05aec3e7330e9ad0b8e0f685a9112c20cdd97) +- [meta] use `prepublishOnly` script for npm 7+ [`95c285d`](https://github.com/ljharb/get-intrinsic/commit/95c285da810516057d3bbfa871176031af38f05d) +- [Deps] update `has-symbols` [`593cb4f`](https://github.com/ljharb/get-intrinsic/commit/593cb4fb38e7922e40e42c183f45274b636424cd) +- [readme] fix repo URLs [`1c8305b`](https://github.com/ljharb/get-intrinsic/commit/1c8305b5365827c9b6fc785434aac0e1328ff2f5) +- [Deps] update `has-symbols` [`c7138b6`](https://github.com/ljharb/get-intrinsic/commit/c7138b6c6d73132d859471fb8c13304e1e7c8b20) +- [Dev Deps] remove unused `has-bigints` [`bd63aff`](https://github.com/ljharb/get-intrinsic/commit/bd63aff6ad8f3a986c557fcda2914187bdaab359) + +## [v1.1.1](https://github.com/ljharb/get-intrinsic/compare/v1.1.0...v1.1.1) - 2021-02-03 + +### Fixed + +- [meta] export `./package.json` [`#9`](https://github.com/ljharb/get-intrinsic/issues/9) + +### Commits + +- [readme] flesh out the readme; use `evalmd` [`d12f12c`](https://github.com/ljharb/get-intrinsic/commit/d12f12c15345a0a0772cc65a7c64369529abd614) +- [eslint] set up proper globals config [`5a8c098`](https://github.com/ljharb/get-intrinsic/commit/5a8c0984e3319d1ac0e64b102f8ec18b64e79f36) +- [Dev Deps] update `eslint` [`7b9a5c0`](https://github.com/ljharb/get-intrinsic/commit/7b9a5c0d31a90ca1a1234181c74988fb046701cd) + +## [v1.1.0](https://github.com/ljharb/get-intrinsic/compare/v1.0.2...v1.1.0) - 2021-01-25 + +### Fixed + +- [Refactor] delay `Function` eval until syntax-derived values are requested [`#3`](https://github.com/ljharb/get-intrinsic/issues/3) + +### Commits + +- [Tests] migrate tests to Github Actions [`2ab762b`](https://github.com/ljharb/get-intrinsic/commit/2ab762b48164aea8af37a40ba105bbc8246ab8c4) +- [meta] do not publish github action workflow files [`5e7108e`](https://github.com/ljharb/get-intrinsic/commit/5e7108e4768b244d48d9567ba4f8a6cab9c65b8e) +- [Tests] add some coverage [`01ac7a8`](https://github.com/ljharb/get-intrinsic/commit/01ac7a87ac29738567e8524cd8c9e026b1fa8cb3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `call-bind`, `es-abstract`, `tape`; add `call-bind` [`911b672`](https://github.com/ljharb/get-intrinsic/commit/911b672fbffae433a96924c6ce013585e425f4b7) +- [Refactor] rearrange evalled constructors a bit [`7e7e4bf`](https://github.com/ljharb/get-intrinsic/commit/7e7e4bf583f3799c8ac1c6c5e10d2cb553957347) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`0199968`](https://github.com/ljharb/get-intrinsic/commit/01999687a263ffce0a3cb011dfbcb761754aedbc) + +## [v1.0.2](https://github.com/ljharb/get-intrinsic/compare/v1.0.1...v1.0.2) - 2020-12-17 + +### Commits + +- [Fix] Throw for non‑existent intrinsics [`68f873b`](https://github.com/ljharb/get-intrinsic/commit/68f873b013c732a05ad6f5fc54f697e55515461b) +- [Fix] Throw for non‑existent segments in the intrinsic path [`8325dee`](https://github.com/ljharb/get-intrinsic/commit/8325deee43128f3654d3399aa9591741ebe17b21) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-bigints`, `object-inspect` [`0c227a7`](https://github.com/ljharb/get-intrinsic/commit/0c227a7d8b629166f25715fd242553892e458525) +- [meta] do not lint coverage output [`70d2419`](https://github.com/ljharb/get-intrinsic/commit/70d24199b620043cd9110fc5f426d214ebe21dc9) + +## [v1.0.1](https://github.com/ljharb/get-intrinsic/compare/v1.0.0...v1.0.1) - 2020-10-30 + +### Commits + +- [Tests] gather coverage data on every job [`d1d280d`](https://github.com/ljharb/get-intrinsic/commit/d1d280dec714e3f0519cc877dbcb193057d9cac6) +- [Fix] add missing dependencies [`5031771`](https://github.com/ljharb/get-intrinsic/commit/5031771bb1095b38be88ce7c41d5de88718e432e) +- [Tests] use `es-value-fixtures` [`af48765`](https://github.com/ljharb/get-intrinsic/commit/af48765a23c5323fb0b6b38dbf00eb5099c7bebc) + +## v1.0.0 - 2020-10-29 + +### Commits + +- Implementation [`bbce57c`](https://github.com/ljharb/get-intrinsic/commit/bbce57c6f33d05b2d8d3efa273ceeb3ee01127bb) +- Tests [`17b4f0d`](https://github.com/ljharb/get-intrinsic/commit/17b4f0d56dea6b4059b56fc30ef3ee4d9500ebc2) +- Initial commit [`3153294`](https://github.com/ljharb/get-intrinsic/commit/31532948de363b0a27dd9fd4649e7b7028ec4b44) +- npm init [`fb326c4`](https://github.com/ljharb/get-intrinsic/commit/fb326c4d2817c8419ec31de1295f06bb268a7902) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`48862fb`](https://github.com/ljharb/get-intrinsic/commit/48862fb2508c8f6a57968e6d08b7c883afc9d550) +- [meta] add `auto-changelog` [`5f28ad0`](https://github.com/ljharb/get-intrinsic/commit/5f28ad019e060a353d8028f9f2591a9cc93074a1) +- [meta] add "funding"; create `FUNDING.yml` [`c2bbdde`](https://github.com/ljharb/get-intrinsic/commit/c2bbddeba73a875be61484ee4680b129a6d4e0a1) +- [Tests] add `npm run lint` [`0a84b98`](https://github.com/ljharb/get-intrinsic/commit/0a84b98b22b7cf7a748666f705b0003a493c35fd) +- Only apps should have lockfiles [`9586c75`](https://github.com/ljharb/get-intrinsic/commit/9586c75866c1ee678e4d5d4dbbdef6997e511b05) diff --git a/node_modules/get-intrinsic/LICENSE b/node_modules/get-intrinsic/LICENSE new file mode 100644 index 0000000..48f05d0 --- /dev/null +++ b/node_modules/get-intrinsic/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +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. diff --git a/node_modules/get-intrinsic/README.md b/node_modules/get-intrinsic/README.md new file mode 100644 index 0000000..3aa0bba --- /dev/null +++ b/node_modules/get-intrinsic/README.md @@ -0,0 +1,71 @@ +# get-intrinsic [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Get and robustly cache all JS language-level intrinsics at first require time. + +See the syntax described [in the JS spec](https://tc39.es/ecma262/#sec-well-known-intrinsic-objects) for reference. + +## Example + +```js +var GetIntrinsic = require('get-intrinsic'); +var assert = require('assert'); + +// static methods +assert.equal(GetIntrinsic('%Math.pow%'), Math.pow); +assert.equal(Math.pow(2, 3), 8); +assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); +delete Math.pow; +assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); + +// instance methods +var arr = [1]; +assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push); +assert.deepEqual(arr, [1]); + +arr.push(2); +assert.deepEqual(arr, [1, 2]); + +GetIntrinsic('%Array.prototype.push%').call(arr, 3); +assert.deepEqual(arr, [1, 2, 3]); + +delete Array.prototype.push; +GetIntrinsic('%Array.prototype.push%').call(arr, 4); +assert.deepEqual(arr, [1, 2, 3, 4]); + +// missing features +delete JSON.parse; // to simulate a real intrinsic that is missing in the environment +assert.throws(() => GetIntrinsic('%JSON.parse%')); +assert.equal(undefined, GetIntrinsic('%JSON.parse%', true)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/get-intrinsic +[npm-version-svg]: https://versionbadg.es/ljharb/get-intrinsic.svg +[deps-svg]: https://david-dm.org/ljharb/get-intrinsic.svg +[deps-url]: https://david-dm.org/ljharb/get-intrinsic +[dev-deps-svg]: https://david-dm.org/ljharb/get-intrinsic/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/get-intrinsic#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/get-intrinsic.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/get-intrinsic.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/get-intrinsic.svg +[downloads-url]: https://npm-stat.com/charts.html?package=get-intrinsic +[codecov-image]: https://codecov.io/gh/ljharb/get-intrinsic/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/get-intrinsic/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-intrinsic +[actions-url]: https://github.com/ljharb/get-intrinsic/actions diff --git a/node_modules/get-intrinsic/index.js b/node_modules/get-intrinsic/index.js new file mode 100644 index 0000000..c25e2c4 --- /dev/null +++ b/node_modules/get-intrinsic/index.js @@ -0,0 +1,359 @@ +'use strict'; + +var undefined; + +var $Error = require('es-errors'); +var $EvalError = require('es-errors/eval'); +var $RangeError = require('es-errors/range'); +var $ReferenceError = require('es-errors/ref'); +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); +var $URIError = require('es-errors/uri'); + +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 = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +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 = require('has-symbols')(); +var hasProto = require('has-proto')(); + +var getProto = Object.getPrototypeOf || ( + hasProto + ? function (x) { return x.__proto__; } // eslint-disable-line no-proto + : null +); + +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, + '%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, + '%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 +}; + +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 = require('function-bind'); +var hasOwn = require('hasown'); +var $concat = bind.call(Function.call, Array.prototype.concat); +var $spliceApply = bind.call(Function.apply, Array.prototype.splice); +var $replace = bind.call(Function.call, String.prototype.replace); +var $strSlice = bind.call(Function.call, String.prototype.slice); +var $exec = bind.call(Function.call, RegExp.prototype.exec); + +/* 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; +}; diff --git a/node_modules/get-intrinsic/package.json b/node_modules/get-intrinsic/package.json new file mode 100644 index 0000000..568dff9 --- /dev/null +++ b/node_modules/get-intrinsic/package.json @@ -0,0 +1,93 @@ +{ + "name": "get-intrinsic", + "version": "1.2.4", + "description": "Get and robustly cache all JS language-level intrinsics at first require time", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/get-intrinsic.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "intrinsic", + "getintrinsic", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/get-intrinsic/issues" + }, + "homepage": "https://github.com/ljharb/get-intrinsic#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "call-bind": "^1.0.5", + "es-abstract": "^1.22.3", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "make-async-function": "^1.0.0", + "make-async-generator-function": "^1.0.0", + "make-generator-function": "^2.0.0", + "mock-property": "^1.0.3", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "testling": { + "files": "test/GetIntrinsic.js" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/get-intrinsic/test/GetIntrinsic.js b/node_modules/get-intrinsic/test/GetIntrinsic.js new file mode 100644 index 0000000..1cc08e0 --- /dev/null +++ b/node_modules/get-intrinsic/test/GetIntrinsic.js @@ -0,0 +1,274 @@ +'use strict'; + +var GetIntrinsic = require('../'); + +var test = require('tape'); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var generatorFns = require('make-generator-function')(); +var asyncFns = require('make-async-function').list(); +var asyncGenFns = require('make-async-generator-function')(); +var mockProperty = require('mock-property'); + +var callBound = require('call-bind/callBound'); +var v = require('es-value-fixtures'); +var $gOPD = require('gopd'); +var DefinePropertyOrThrow = require('es-abstract/2021/DefinePropertyOrThrow'); + +var $isProto = callBound('%Object.prototype.isPrototypeOf%'); + +test('export', function (t) { + t.equal(typeof GetIntrinsic, 'function', 'it is a function'); + t.equal(GetIntrinsic.length, 2, 'function has length of 2'); + + t.end(); +}); + +test('throws', function (t) { + t['throws']( + function () { GetIntrinsic('not an intrinsic'); }, + SyntaxError, + 'nonexistent intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic(''); }, + TypeError, + 'empty string intrinsic throws a type error' + ); + + t['throws']( + function () { GetIntrinsic('.'); }, + SyntaxError, + '"just a dot" intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic('%String'); }, + SyntaxError, + 'Leading % without trailing % throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic('String%'); }, + SyntaxError, + 'Trailing % without leading % throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic("String['prototype]"); }, + SyntaxError, + 'Dynamic property access is disallowed for intrinsics (unterminated string)' + ); + + t['throws']( + function () { GetIntrinsic('%Proxy.prototype.undefined%'); }, + TypeError, + "Throws when middle part doesn't exist (%Proxy.prototype.undefined%)" + ); + + t['throws']( + function () { GetIntrinsic('%Array.prototype%garbage%'); }, + SyntaxError, + 'Throws with extra percent signs' + ); + + t['throws']( + function () { GetIntrinsic('%Array.prototype%push%'); }, + SyntaxError, + 'Throws with extra percent signs, even on an existing intrinsic' + ); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { GetIntrinsic(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { GetIntrinsic('%', nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach([ + 'toString', + 'propertyIsEnumerable', + 'hasOwnProperty' + ], function (objectProtoMember) { + t['throws']( + function () { GetIntrinsic(objectProtoMember); }, + SyntaxError, + debug(objectProtoMember) + ' is not an intrinsic' + ); + }); + + t.end(); +}); + +test('base intrinsics', function (t) { + t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); + t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); + t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); + t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); + + t.end(); +}); + +test('dotted paths', function (t) { + t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); + t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); + t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); + t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); + + test('underscore paths are aliases for dotted paths', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) { + var original = GetIntrinsic('%ObjProto_toString%'); + + forEach([ + '%Object.prototype.toString%', + 'Object.prototype.toString', + '%ObjectPrototype.toString%', + 'ObjectPrototype.toString', + '%ObjProto_toString%', + 'ObjProto_toString' + ], function (name) { + DefinePropertyOrThrow(Object.prototype, 'toString', { + '[[Value]]': function toString() { + return original.apply(this, arguments); + } + }); + st.equal(GetIntrinsic(name), original, name + ' yields original Object.prototype.toString'); + }); + + DefinePropertyOrThrow(Object.prototype, 'toString', { '[[Value]]': original }); + st.end(); + }); + + test('dotted paths cache', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) { + var original = GetIntrinsic('%Object.prototype.propertyIsEnumerable%'); + + forEach([ + '%Object.prototype.propertyIsEnumerable%', + 'Object.prototype.propertyIsEnumerable', + '%ObjectPrototype.propertyIsEnumerable%', + 'ObjectPrototype.propertyIsEnumerable' + ], function (name) { + var restore = mockProperty(Object.prototype, 'propertyIsEnumerable', { + value: function propertyIsEnumerable() { + return original.apply(this, arguments); + } + }); + st.equal(GetIntrinsic(name), original, name + ' yields cached Object.prototype.propertyIsEnumerable'); + + restore(); + }); + + st.end(); + }); + + test('dotted path reports correct error', function (st) { + st['throws'](function () { + GetIntrinsic('%NonExistentIntrinsic.prototype.property%'); + }, /%NonExistentIntrinsic%/, 'The base intrinsic of %NonExistentIntrinsic.prototype.property% is %NonExistentIntrinsic%'); + + st['throws'](function () { + GetIntrinsic('%NonExistentIntrinsicPrototype.property%'); + }, /%NonExistentIntrinsicPrototype%/, 'The base intrinsic of %NonExistentIntrinsicPrototype.property% is %NonExistentIntrinsicPrototype%'); + + st.end(); + }); + + t.end(); +}); + +test('accessors', { skip: !$gOPD || typeof Map !== 'function' }, function (t) { + var actual = $gOPD(Map.prototype, 'size'); + t.ok(actual, 'Map.prototype.size has a descriptor'); + t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); + t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); + t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); + + t.end(); +}); + +test('generator functions', { skip: !generatorFns.length }, function (t) { + var $GeneratorFunction = GetIntrinsic('%GeneratorFunction%'); + var $GeneratorFunctionPrototype = GetIntrinsic('%Generator%'); + var $GeneratorPrototype = GetIntrinsic('%GeneratorPrototype%'); + + forEach(generatorFns, function (genFn) { + var fnName = genFn.name; + fnName = fnName ? "'" + fnName + "'" : 'genFn'; + + t.ok(genFn instanceof $GeneratorFunction, fnName + ' instanceof %GeneratorFunction%'); + t.ok($isProto($GeneratorFunctionPrototype, genFn), '%Generator% is prototype of ' + fnName); + t.ok($isProto($GeneratorPrototype, genFn.prototype), '%GeneratorPrototype% is prototype of ' + fnName + '.prototype'); + }); + + t.end(); +}); + +test('async functions', { skip: !asyncFns.length }, function (t) { + var $AsyncFunction = GetIntrinsic('%AsyncFunction%'); + var $AsyncFunctionPrototype = GetIntrinsic('%AsyncFunctionPrototype%'); + + forEach(asyncFns, function (asyncFn) { + var fnName = asyncFn.name; + fnName = fnName ? "'" + fnName + "'" : 'asyncFn'; + + t.ok(asyncFn instanceof $AsyncFunction, fnName + ' instanceof %AsyncFunction%'); + t.ok($isProto($AsyncFunctionPrototype, asyncFn), '%AsyncFunctionPrototype% is prototype of ' + fnName); + }); + + t.end(); +}); + +test('async generator functions', { skip: asyncGenFns.length === 0 }, function (t) { + var $AsyncGeneratorFunction = GetIntrinsic('%AsyncGeneratorFunction%'); + var $AsyncGeneratorFunctionPrototype = GetIntrinsic('%AsyncGenerator%'); + var $AsyncGeneratorPrototype = GetIntrinsic('%AsyncGeneratorPrototype%'); + + forEach(asyncGenFns, function (asyncGenFn) { + var fnName = asyncGenFn.name; + fnName = fnName ? "'" + fnName + "'" : 'asyncGenFn'; + + t.ok(asyncGenFn instanceof $AsyncGeneratorFunction, fnName + ' instanceof %AsyncGeneratorFunction%'); + t.ok($isProto($AsyncGeneratorFunctionPrototype, asyncGenFn), '%AsyncGenerator% is prototype of ' + fnName); + t.ok($isProto($AsyncGeneratorPrototype, asyncGenFn.prototype), '%AsyncGeneratorPrototype% is prototype of ' + fnName + '.prototype'); + }); + + t.end(); +}); + +test('%ThrowTypeError%', function (t) { + var $ThrowTypeError = GetIntrinsic('%ThrowTypeError%'); + + t.equal(typeof $ThrowTypeError, 'function', 'is a function'); + t['throws']( + $ThrowTypeError, + TypeError, + '%ThrowTypeError% throws a TypeError' + ); + + t.end(); +}); + +test('allowMissing', { skip: asyncGenFns.length > 0 }, function (t) { + t['throws']( + function () { GetIntrinsic('%AsyncGeneratorPrototype%'); }, + TypeError, + 'throws when missing' + ); + + t.equal( + GetIntrinsic('%AsyncGeneratorPrototype%', true), + undefined, + 'does not throw when allowMissing' + ); + + t.end(); +}); diff --git a/node_modules/glob-parent/CHANGELOG.md b/node_modules/glob-parent/CHANGELOG.md new file mode 100644 index 0000000..fb9de96 --- /dev/null +++ b/node_modules/glob-parent/CHANGELOG.md @@ -0,0 +1,110 @@ +### [5.1.2](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) (2021-03-06) + + +### Bug Fixes + +* eliminate ReDoS ([#36](https://github.com/gulpjs/glob-parent/issues/36)) ([f923116](https://github.com/gulpjs/glob-parent/commit/f9231168b0041fea3f8f954b3cceb56269fc6366)) + +### [5.1.1](https://github.com/gulpjs/glob-parent/compare/v5.1.0...v5.1.1) (2021-01-27) + + +### Bug Fixes + +* unescape exclamation mark ([#26](https://github.com/gulpjs/glob-parent/issues/26)) ([a98874f](https://github.com/gulpjs/glob-parent/commit/a98874f1a59e407f4fb1beb0db4efa8392da60bb)) + +## [5.1.0](https://github.com/gulpjs/glob-parent/compare/v5.0.0...v5.1.0) (2021-01-27) + + +### Features + +* add `flipBackslashes` option to disable auto conversion of slashes (closes [#24](https://github.com/gulpjs/glob-parent/issues/24)) ([#25](https://github.com/gulpjs/glob-parent/issues/25)) ([eecf91d](https://github.com/gulpjs/glob-parent/commit/eecf91d5e3834ed78aee39c4eaaae654d76b87b3)) + +## [5.0.0](https://github.com/gulpjs/glob-parent/compare/v4.0.0...v5.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* Drop support for node <6 & bump dependencies + +### Miscellaneous Chores + +* Drop support for node <6 & bump dependencies ([896c0c0](https://github.com/gulpjs/glob-parent/commit/896c0c00b4e7362f60b96e7fc295ae929245255a)) + +## [4.0.0](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v4.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* question marks are valid path characters on Windows so avoid flagging as a glob when alone +* Update is-glob dependency + +### Features + +* hoist regexps and strings for performance gains ([4a80667](https://github.com/gulpjs/glob-parent/commit/4a80667c69355c76a572a5892b0f133c8e1f457e)) +* question marks are valid path characters on Windows so avoid flagging as a glob when alone ([2a551dd](https://github.com/gulpjs/glob-parent/commit/2a551dd0dc3235e78bf3c94843d4107072d17841)) +* Update is-glob dependency ([e41fcd8](https://github.com/gulpjs/glob-parent/commit/e41fcd895d1f7bc617dba45c9d935a7949b9c281)) + +## [3.1.0](https://github.com/gulpjs/glob-parent/compare/v3.0.1...v3.1.0) (2021-01-27) + + +### Features + +* allow basic win32 backslash use ([272afa5](https://github.com/gulpjs/glob-parent/commit/272afa5fd070fc0f796386a5993d4ee4a846988b)) +* handle extglobs (parentheses) containing separators ([7db1bdb](https://github.com/gulpjs/glob-parent/commit/7db1bdb0756e55fd14619e8ce31aa31b17b117fd)) +* new approach to braces/brackets handling ([8269bd8](https://github.com/gulpjs/glob-parent/commit/8269bd89290d99fac9395a354fb56fdcdb80f0be)) +* pre-process braces/brackets sections ([9ef8a87](https://github.com/gulpjs/glob-parent/commit/9ef8a87f66b1a43d0591e7a8e4fc5a18415ee388)) +* preserve escaped brace/bracket at end of string ([8cfb0ba](https://github.com/gulpjs/glob-parent/commit/8cfb0ba84202d51571340dcbaf61b79d16a26c76)) + + +### Bug Fixes + +* trailing escaped square brackets ([99ec9fe](https://github.com/gulpjs/glob-parent/commit/99ec9fecc60ee488ded20a94dd4f18b4f55c4ccf)) + +### [3.0.1](https://github.com/gulpjs/glob-parent/compare/v3.0.0...v3.0.1) (2021-01-27) + + +### Features + +* use path-dirname ponyfill ([cdbea5f](https://github.com/gulpjs/glob-parent/commit/cdbea5f32a58a54e001a75ddd7c0fccd4776aacc)) + + +### Bug Fixes + +* unescape glob-escaped dirnames on output ([598c533](https://github.com/gulpjs/glob-parent/commit/598c533bdf49c1428bc063aa9b8db40c5a86b030)) + +## [3.0.0](https://github.com/gulpjs/glob-parent/compare/v2.0.0...v3.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* update is-glob dependency + +### Features + +* update is-glob dependency ([5c5f8ef](https://github.com/gulpjs/glob-parent/commit/5c5f8efcee362a8e7638cf8220666acd8784f6bd)) + +## [2.0.0](https://github.com/gulpjs/glob-parent/compare/v1.3.0...v2.0.0) (2021-01-27) + + +### Features + +* move up to dirname regardless of glob characters ([f97fb83](https://github.com/gulpjs/glob-parent/commit/f97fb83be2e0a9fc8d3b760e789d2ecadd6aa0c2)) + +## [1.3.0](https://github.com/gulpjs/glob-parent/compare/v1.2.0...v1.3.0) (2021-01-27) + +## [1.2.0](https://github.com/gulpjs/glob-parent/compare/v1.1.0...v1.2.0) (2021-01-27) + + +### Reverts + +* feat: make regex test strings smaller ([dc80fa9](https://github.com/gulpjs/glob-parent/commit/dc80fa9658dca20549cfeba44bbd37d5246fcce0)) + +## [1.1.0](https://github.com/gulpjs/glob-parent/compare/v1.0.0...v1.1.0) (2021-01-27) + + +### Features + +* make regex test strings smaller ([cd83220](https://github.com/gulpjs/glob-parent/commit/cd832208638f45169f986d80fcf66e401f35d233)) + +## 1.0.0 (2021-01-27) + diff --git a/node_modules/glob-parent/LICENSE b/node_modules/glob-parent/LICENSE new file mode 100644 index 0000000..63222d7 --- /dev/null +++ b/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015, 2019 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md new file mode 100644 index 0000000..36a2793 --- /dev/null +++ b/node_modules/glob-parent/README.md @@ -0,0 +1,137 @@ +

+ + + +

+ +# glob-parent + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Extract the non-magic parent path from a glob string. + +## Usage + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## API + +### `globParent(maybeGlobString, [options])` + +Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. + +#### options + +```js +{ + // Disables the automatic conversion of slashes for Windows + flipBackslashes: true +} +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) unless used as a path segment alone +- `*` (asterisk) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/') // 'foo' +globParent('foo/\\[bar]/') // 'foo/[bar]' +``` + +## Limitations + +### Braces & Brackets +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +### Windows +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]') // 'foo ' +globParent('foo \\[bar]*') // 'foo ' + +// GOOD +globParent('./foo \\[bar]') // 'foo [bar]' +globParent('./foo \\[bar]*') // '.' +``` + +## License + +ISC + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg +[npm-url]: https://www.npmjs.com/package/glob-parent +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg + +[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master +[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master + +[travis-url]: https://travis-ci.org/gulpjs/glob-parent +[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js new file mode 100644 index 0000000..09e257e --- /dev/null +++ b/node_modules/glob-parent/index.js @@ -0,0 +1,42 @@ +'use strict'; + +var isGlob = require('is-glob'); +var pathPosixDirname = require('path').posix.dirname; +var isWin32 = require('os').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'); +}; diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json new file mode 100644 index 0000000..125c971 --- /dev/null +++ b/node_modules/glob-parent/package.json @@ -0,0 +1,48 @@ +{ + "name": "glob-parent", + "version": "5.1.2", + "description": "Extract the non-magic parent path from a glob string.", + "author": "Gulp Team (https://gulpjs.com/)", + "contributors": [ + "Elan Shanker (https://github.com/es128)", + "Blaine Bublitz " + ], + "repository": "gulpjs/glob-parent", + "license": "ISC", + "engines": { + "node": ">= 6" + }, + "main": "index.js", + "files": [ + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only", + "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "dependencies": { + "is-glob": "^4.0.1" + }, + "devDependencies": { + "coveralls": "^3.0.11", + "eslint": "^2.13.1", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "mocha": "^6.0.2", + "nyc": "^13.3.0" + }, + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ] +} diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md new file mode 100644 index 0000000..83f0c83 --- /dev/null +++ b/node_modules/glob/README.md @@ -0,0 +1,378 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![a fun cartoon logo made of glob characters](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. +* `fs` File-system object with Node's `fs` API. By default, the built-in + `fs` module will be used. Set to a volume provided by a library like + `memfs` to avoid using the "real" file-system. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js new file mode 100644 index 0000000..424c46e --- /dev/null +++ b/node_modules/glob/common.js @@ -0,0 +1,238 @@ +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var fs = require("fs") +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasort (a, b) { + return a.localeCompare(b, 'en') +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + // always treat \ in patterns as escapes, not path separators + options.allowWindowsEscape = false + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js new file mode 100644 index 0000000..37a4d7e --- /dev/null +++ b/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + self.fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json new file mode 100644 index 0000000..5940b64 --- /dev/null +++ b/node_modules/glob/package.json @@ -0,0 +1,55 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.2.3", + "publishConfig": { + "tag": "v7-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "memfs": "^3.2.0", + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^15.0.6", + "tick": "0.0.6" + }, + "tap": { + "before": "test/00-setup.js", + "after": "test/zz-cleanup.js", + "jobs": 1 + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js new file mode 100644 index 0000000..2c4f480 --- /dev/null +++ b/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert.ok(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert.ok(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/gopd/.eslintrc b/node_modules/gopd/.eslintrc new file mode 100644 index 0000000..e2550c0 --- /dev/null +++ b/node_modules/gopd/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-style": [2, "declaration"], + "id-length": 0, + "multiline-comment-style": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/node_modules/gopd/.github/FUNDING.yml b/node_modules/gopd/.github/FUNDING.yml new file mode 100644 index 0000000..94a44a8 --- /dev/null +++ b/node_modules/gopd/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/gopd +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/gopd/CHANGELOG.md b/node_modules/gopd/CHANGELOG.md new file mode 100644 index 0000000..f111eb1 --- /dev/null +++ b/node_modules/gopd/CHANGELOG.md @@ -0,0 +1,25 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/gopd/compare/v1.0.0...v1.0.1) - 2022-11-01 + +### Commits + +- [Fix] actually export gOPD instead of dP [`4b624bf`](https://github.com/ljharb/gopd/commit/4b624bfbeff788c5e3ff16d9443a83627847234f) + +## v1.0.0 - 2022-11-01 + +### Commits + +- Initial implementation, tests, readme [`0911e01`](https://github.com/ljharb/gopd/commit/0911e012cd642092bd88b732c161c58bf4f20bea) +- Initial commit [`b84e33f`](https://github.com/ljharb/gopd/commit/b84e33f5808a805ac57ff88d4247ad935569acbe) +- [actions] add reusable workflows [`12ae28a`](https://github.com/ljharb/gopd/commit/12ae28ae5f50f86e750215b6e2188901646d0119) +- npm init [`280118b`](https://github.com/ljharb/gopd/commit/280118badb45c80b4483836b5cb5315bddf6e582) +- [meta] add `auto-changelog` [`bb78de5`](https://github.com/ljharb/gopd/commit/bb78de5639a180747fb290c28912beaaf1615709) +- [meta] create FUNDING.yml; add `funding` in package.json [`11c22e6`](https://github.com/ljharb/gopd/commit/11c22e6355bb01f24e7fac4c9bb3055eb5b25002) +- [meta] use `npmignore` to autogenerate an npmignore file [`4f4537a`](https://github.com/ljharb/gopd/commit/4f4537a843b39f698c52f072845092e6fca345bb) +- Only apps should have lockfiles [`c567022`](https://github.com/ljharb/gopd/commit/c567022a18573aa7951cf5399445d9840e23e98b) diff --git a/node_modules/gopd/LICENSE b/node_modules/gopd/LICENSE new file mode 100644 index 0000000..6abfe14 --- /dev/null +++ b/node_modules/gopd/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Jordan Harband + +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. diff --git a/node_modules/gopd/README.md b/node_modules/gopd/README.md new file mode 100644 index 0000000..784e56a --- /dev/null +++ b/node_modules/gopd/README.md @@ -0,0 +1,40 @@ +# gopd [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation. + +## Usage + +```javascript +var gOPD = require('gopd'); +var assert = require('assert'); + +if (gOPD) { + assert.equal(typeof gOPD, 'function', 'descriptors supported'); + // use gOPD like Object.getOwnPropertyDescriptor here +} else { + assert.ok(!gOPD, 'descriptors not supported'); +} +``` + +[package-url]: https://npmjs.org/package/gopd +[npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg +[deps-svg]: https://david-dm.org/ljharb/gopd.svg +[deps-url]: https://david-dm.org/ljharb/gopd +[dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/gopd.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/gopd.svg +[downloads-url]: https://npm-stat.com/charts.html?package=gopd +[codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/gopd/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd +[actions-url]: https://github.com/ljharb/gopd/actions diff --git a/node_modules/gopd/index.js b/node_modules/gopd/index.js new file mode 100644 index 0000000..fb6d3bb --- /dev/null +++ b/node_modules/gopd/index.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; diff --git a/node_modules/gopd/package.json b/node_modules/gopd/package.json new file mode 100644 index 0000000..d5e1fa4 --- /dev/null +++ b/node_modules/gopd/package.json @@ -0,0 +1,71 @@ +{ + "name": "gopd", + "version": "1.0.1", + "description": "`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "lint": "eslint --ext=js,mjs .", + "postlint": "evalmd README.md", + "pretest": "npm run lint", + "tests-only": "tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/gopd.git" + }, + "keywords": [ + "ecmascript", + "javascript", + "getownpropertydescriptor", + "property", + "descriptor" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/gopd/issues" + }, + "homepage": "https://github.com/ljharb/gopd#readme", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.0.0", + "aud": "^2.0.1", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.0", + "safe-publish-latest": "^2.0.0", + "tape": "^5.6.1" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/gopd/test/index.js b/node_modules/gopd/test/index.js new file mode 100644 index 0000000..0376bfb --- /dev/null +++ b/node_modules/gopd/test/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var test = require('tape'); +var gOPD = require('../'); + +test('gOPD', function (t) { + t.test('supported', { skip: !gOPD }, function (st) { + st.equal(typeof gOPD, 'function', 'is a function'); + + var obj = { x: 1 }; + st.ok('x' in obj, 'property exists'); + + var desc = gOPD(obj, 'x'); + st.deepEqual( + desc, + { + configurable: true, + enumerable: true, + value: 1, + writable: true + }, + 'descriptor is as expected' + ); + + st.end(); + }); + + t.test('not supported', { skip: gOPD }, function (st) { + st.notOk(gOPD, 'is falsy'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000..e906a25 --- /dev/null +++ b/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md new file mode 100644 index 0000000..82d6e4d --- /dev/null +++ b/node_modules/graceful-fs/README.md @@ -0,0 +1,143 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFile('some-file-or-whatever', (err, data) => { + // Do stuff here. +}) +``` + +## Sync methods + +This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync +methods. If you use sync methods which open file descriptors then you are +responsible for dealing with any errors. + +This is a known limitation, not a bug. + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/node_modules/graceful-fs/clone.js b/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000..dff3cc8 --- /dev/null +++ b/node_modules/graceful-fs/clone.js @@ -0,0 +1,23 @@ +'use strict' + +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 +} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..8d5b89e --- /dev/null +++ b/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,448 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* 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]) + require('assert').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) + } +} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000..d617b50 --- /dev/null +++ b/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').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(); + } + } +} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..87babf0 --- /dev/null +++ b/node_modules/graceful-fs/package.json @@ -0,0 +1,53 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.2.11", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" + }, + "main": "graceful-fs.js", + "directories": { + "test": "test" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "nyc --silent node test.js | tap -c -", + "posttest": "nyc report" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^16.3.4" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "tap": { + "reporter": "classic" + } +} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..453f1a9 --- /dev/null +++ b/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,355 @@ +var constants = require('constants') + +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 + } +} diff --git a/node_modules/gray-matter/CHANGELOG.md b/node_modules/gray-matter/CHANGELOG.md new file mode 100644 index 0000000..eebdf42 --- /dev/null +++ b/node_modules/gray-matter/CHANGELOG.md @@ -0,0 +1,24 @@ +# Release history + +## 4.0.0 - 2018-04-01 + +### Breaking changes + +- Now requires node v4 or higher. + + +## 3.0.0 - 2017-06-30 + +### Breaking changes + +- `toml`, `coffee` and `cson` are no longer supported by default. Please see [`options.engines`](README.md#optionsengines) and the [examples](./examples) to learn how to add engines. + +### Added + +- Support for [excerpts](README.md#optionsexcerpt). +- The returned object now has non-enumerable `matter` and `stringify` properties. + +### Changed + +- Refactored engines (parsers), so that it's easier to add parsers and stringifiers. +- `options.parsers` was renamed to [`options.engines`](README.md#optionsengines) diff --git a/node_modules/gray-matter/LICENSE b/node_modules/gray-matter/LICENSE new file mode 100644 index 0000000..d32ab44 --- /dev/null +++ b/node_modules/gray-matter/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +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. diff --git a/node_modules/gray-matter/README.md b/node_modules/gray-matter/README.md new file mode 100644 index 0000000..d5d1e0a --- /dev/null +++ b/node_modules/gray-matter/README.md @@ -0,0 +1,565 @@ +# gray-matter [![NPM version](https://img.shields.io/npm/v/gray-matter.svg?style=flat)](https://www.npmjs.com/package/gray-matter) [![NPM monthly downloads](https://img.shields.io/npm/dm/gray-matter.svg?style=flat)](https://npmjs.org/package/gray-matter) [![NPM total downloads](https://img.shields.io/npm/dt/gray-matter.svg?style=flat)](https://npmjs.org/package/gray-matter) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/gray-matter.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/gray-matter) + +> Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML front matter by default, but also has support for YAML, JSON, TOML or Coffee Front-Matter, with options to set custom delimiters. Used by metalsmith, assemble, verb and many other projects. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save gray-matter +``` + +## Heads up! + +Please see the [changelog](CHANGELOG.md) to learn about breaking changes that were made in v3.0. + +## What does this do? + +
+Run this example + +Add the HTML in the following example to `example.html`, then add the following code to `example.js` and run `$ node example` (without the `$`): + +```js +const fs = require('fs'); +const matter = require('gray-matter'); +const str = fs.readFileSync('example.html', 'utf8'); +console.log(matter(str)); +``` + +
+ +Converts a string with front-matter, like this: + +```handlebars +--- +title: Hello +slug: home +--- +

Hello world!

+``` + +Into an object like this: + +```js +{ + content: '

Hello world!

', + data: { + title: 'Hello', + slug: 'home' + } +} +``` + +## Why use gray-matter? + +* **simple**: main function takes a string and returns an object +* **accurate**: better at catching and handling edge cases than front-matter parsers that rely on regex for parsing +* **fast**: faster than other front-matter parsers that use regex for parsing +* **flexible**: By default, gray-matter is capable of parsing [YAML](https://github.com/nodeca/js-yaml), [JSON](http://en.wikipedia.org/wiki/Json) and JavaScript front-matter. But other [engines](#optionsengines) may be added. +* **extensible**: Use [custom delimiters](#optionsdelimiters), or add support for [any language](#optionsengines), like [TOML](http://github.com/mojombo/toml), [CoffeeScript](http://coffeescript.org), or [CSON](https://github.com/bevry/cson) +* **battle-tested**: used by [assemble](https://github.com/assemble/assemble), [metalsmith](https://github.com/segmentio/metalsmith), [phenomic](https://github.com/phenomic/phenomic), [verb](https://github.com/assemble/verb), [generate](https://github.com/generate/generate), [update](https://github.com/update/update) and many others. + +
+Rationale + +**Why did we create gray-matter in the first place?** + +We created gray-matter after trying out other libraries that failed to meet our standards and requirements. + +Some libraries met most of the requirements, but _none met all of them_. + +**Here are the most important**: + +* Be usable, if not simple +* Use a dependable and well-supported library for parsing YAML +* Support other languages besides YAML +* Support stringifying back to YAML or another language +* Don't fail when no content exists +* Don't fail when no front matter exists +* Don't use regex for parsing. This is a relatively simple parsing operation, and regex is the slowest and most error-prone way to do it. +* Have no problem reading YAML files directly +* Have no problem with complex content, including **non-front-matter** fenced code blocks that contain examples of YAML front matter. Other parsers fail on this. +* Support stringifying back to front-matter. This is useful for linting, updating properties, etc. +* Allow custom delimiters, when it's necessary for avoiding delimiter collision. +* Should return an object with at least these three properties: + - `data`: the parsed YAML front matter, as a JSON object + - `content`: the contents as a string, without the front matter + - `orig`: the "original" content (for debugging) + +
+ +## Usage + +Using Node's `require()` system: + +```js +const matter = require('gray-matter'); +``` + +Or with [typescript](https://www.typescriptlang.org) + +```js +import matter = require('gray-matter'); +// OR +import * as matter from 'gray-matter'; +``` + +Pass a string and [options](#options) to gray-matter: + +```js +console.log(matter('---\ntitle: Front Matter\n---\nThis is content.')); +``` + +Returns: + +```js +{ + content: '\nThis is content.', + data: { + title: 'Front Matter' + } +} +``` + +More about the returned object in the following section. + +*** + +## Returned object + +gray-matter returns a `file` object with the following properties. + +**Enumerable** + +* `file.data` **{Object}**: the object created by parsing front-matter +* `file.content` **{String}**: the input string, with `matter` stripped +* `file.excerpt` **{String}**: an excerpt, if [defined on the options](#optionsexcerpt) +* `file.empty` **{String}**: when the front-matter is "empty" (either all whitespace, nothing at all, or just comments and no data), the original string is set on this property. See [#65](https://github.com/jonschlinkert/gray-matter/issues/65) for details regarding use case. +* `file.isEmpty` **{Boolean}**: true if front-matter is empty. + +**Non-enumerable** + +In addition, the following non-enumberable properties are added to the object to help with debugging. + +* `file.orig` **{Buffer}**: the original input string (or buffer) +* `file.language` **{String}**: the front-matter language that was parsed. `yaml` is the default +* `file.matter` **{String}**: the _raw_, un-parsed front-matter string +* `file.stringify` **{Function}**: [stringify](#stringify) the file by converting `file.data` to a string in the given language, wrapping it in delimiters and prepending it to `file.content`. + +## Run the examples + +If you'd like to test-drive the examples, first clone gray-matter into `my-project` (or wherever you want): + +```sh +$ git clone https://github.com/jonschlinkert/gray-matter my-project +``` + +CD into `my-project` and install dependencies: + +```sh +$ cd my-project && npm install +``` + +Then run any of the [examples](./examples) to see how gray-matter works: + +```sh +$ node examples/ +``` + +**Links to examples** + +* [coffee](examples/coffee.js) +* [excerpt-separator](examples/excerpt-separator.js) +* [excerpt-stringify](examples/excerpt-stringify.js) +* [excerpt](examples/excerpt.js) +* [javascript](examples/javascript.js) +* [json-stringify](examples/json-stringify.js) +* [json](examples/json.js) +* [restore-empty](examples/restore-empty.js) +* [sections-excerpt](examples/sections-excerpt.js) +* [sections](examples/sections.js) +* [toml](examples/toml.js) +* [yaml-stringify](examples/yaml-stringify.js) +* [yaml](examples/yaml.js) + +## API + +### [matter](index.js#L29) + +Takes a string or object with `content` property, extracts and parses front-matter from the string, then returns an object with `data`, `content` and other [useful properties](#returned-object). + +**Params** + +* `input` **{Object|String}**: String, or object with `content` string +* `options` **{Object}** +* `returns` **{Object}** + +**Example** + +```js +const matter = require('gray-matter'); +console.log(matter('---\ntitle: Home\n---\nOther stuff')); +//=> { data: { title: 'Home'}, content: 'Other stuff' } +``` + +### [.stringify](index.js#L160) + +Stringify an object to YAML or the specified language, and append it to the given string. By default, only YAML and JSON can be stringified. See the [engines](#engines) section to learn how to stringify other languages. + +**Params** + +* `file` **{String|Object}**: The content string to append to stringified front-matter, or a file object with `file.content` string. +* `data` **{Object}**: Front matter to stringify. +* `options` **{Object}**: [Options](#options) to pass to gray-matter and [js-yaml](https://github.com/nodeca/js-yaml). +* `returns` **{String}**: Returns a string created by wrapping stringified yaml with delimiters, and appending that to the given string. + +**Example** + +```js +console.log(matter.stringify('foo bar baz', {title: 'Home'})); +// results in: +// --- +// title: Home +// --- +// foo bar baz +``` + +### [.read](index.js#L178) + +Synchronously read a file from the file system and parse front matter. Returns the same object as the [main function](#matter). + +**Params** + +* `filepath` **{String}**: file path of the file to read. +* `options` **{Object}**: [Options](#options) to pass to gray-matter. +* `returns` **{Object}**: Returns [an object](#returned-object) with `data` and `content` + +**Example** + +```js +const file = matter.read('./content/blog-post.md'); +``` + +### [.test](index.js#L193) + +Returns true if the given `string` has front matter. + +**Params** + +* `string` **{String}** +* `options` **{Object}** +* `returns` **{Boolean}**: True if front matter exists. + +## Options + +### options.excerpt + +**Type**: `Boolean|Function` + +**Default**: `undefined` + +Extract an excerpt that directly follows front-matter, or is the first thing in the string if no front-matter exists. + +If set to `excerpt: true`, it will look for the frontmatter delimiter, `---` by default and grab everything leading up to it. + +**Example** + +```js +const str = '---\nfoo: bar\n---\nThis is an excerpt.\n---\nThis is content'; +const file = matter(str, { excerpt: true }); +``` + +Results in: + +```js +{ + content: 'This is an excerpt.\n---\nThis is content', + data: { foo: 'bar' }, + excerpt: 'This is an excerpt.\n' +} +``` + +You can also set `excerpt` to a function. This function uses the 'file' and 'options' that were initially passed to gray-matter as parameters, so you can control how the excerpt is extracted from the content. + +**Example** + +```js +// returns the first 4 lines of the contents +function firstFourLines(file, options) { + file.excerpt = file.content.split('\n').slice(0, 4).join(' '); +} + +const file = matter([ + '---', + 'foo: bar', + '---', + 'Only this', + 'will be', + 'in the', + 'excerpt', + 'but not this...' +].join('\n'), {excerpt: firstFourLines}); +``` + +Results in: + +```js +{ + content: 'Only this\nwill be\nin the\nexcerpt\nbut not this...', + data: { foo: 'bar' }, + excerpt: 'Only this will be in the excerpt' +} +``` + +### options.excerpt_separator + +**Type**: `String` + +**Default**: `undefined` + +Define a custom separator to use for excerpts. + +```js +console.log(matter(string, {excerpt_separator: ''})); +``` + +**Example** + +The following HTML string: + +```html +--- +title: Blog +--- +My awesome blog. + +

Hello world

+``` + +Results in: + +```js +{ + data: { title: 'Blog'}, + excerpt: 'My awesome blog.', + content: 'My awesome blog.\n\n

Hello world

' +} +``` + +### options.engines + +Define custom engines for parsing and/or stringifying front-matter. + +**Type**: `Object` Object of engines + +**Default**: `JSON`, `YAML` and `JavaScript` are already handled by default. + +**Engine format** + +Engines may either be an object with `parse` and (optionally) `stringify` methods, or a function that will be used for parsing only. + +**Examples** + +```js +const toml = require('toml'); + +/** + * defined as a function + */ + +const file = matter(str, { + engines: { + toml: toml.parse.bind(toml), + } +}); + +/** + * Or as an object + */ + +const file = matter(str, { + engines: { + toml: { + parse: toml.parse.bind(toml), + + // example of throwing an error to let users know stringifying is + // not supported (a TOML stringifier might exist, this is just an example) + stringify: function() { + throw new Error('cannot stringify to TOML'); + } + } + } +}); + +console.log(file); +``` + +### options.language + +**Type**: `String` + +**Default**: `yaml` + +Define the engine to use for parsing front-matter. + +```js +console.log(matter(string, {language: 'toml'})); +``` + +**Example** + +The following HTML string: + +```html +--- +title = "TOML" +description = "Front matter" +categories = "front matter toml" +--- +This is content +``` + +Results in: + +```js +{ content: 'This is content', + excerpt: '', + data: + { title: 'TOML', + description: 'Front matter', + categories: 'front matter toml' } } +``` + +**Dynamic language detection** + +Instead of defining the language on the options, gray-matter will automatically detect the language defined after the first delimiter and select the correct engine to use for parsing. + +```html +---toml +title = "TOML" +description = "Front matter" +categories = "front matter toml" +--- +This is content +``` + +### options.delimiters + +**Type**: `String` + +**Default**: `---` + +Open and close delimiters can be passed in as an array of strings. + +**Example:** + +```js +// format delims as a string +matter.read('file.md', {delims: '~~~'}); +// or an array (open/close) +matter.read('file.md', {delims: ['~~~', '~~~']}); +``` + +would parse: + +```html +~~~ +title: Home +~~~ +This is the {{title}} page. +``` + +## Deprecated options + +### options.lang + +Decrecated, please use [options.language](#optionslanguage) instead. + +### options.delims + +Decrecated, please use [options.delimiters](#optionsdelimiters) instead. + +### options.parsers + +Decrecated, please use [options.engines](#optionsengines) instead. + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [metalsmith](https://www.npmjs.com/package/metalsmith): An extremely simple, pluggable static site generator. | [homepage](https://github.com/segmentio/metalsmith#readme "An extremely simple, pluggable static site generator.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") +* [gray-matter-loader](https://github.com/atlassian/gray-matter-loader): A webpack loader for gray-matter. [homepage](https://github.com/atlassian/gray-matter-loader#gray-matter-loader) + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 174 | [jonschlinkert](https://github.com/jonschlinkert) | +| 7 | [RobLoach](https://github.com/RobLoach) | +| 5 | [heymind](https://github.com/heymind) | +| 4 | [doowb](https://github.com/doowb) | +| 3 | [aljopro](https://github.com/aljopro) | +| 2 | [reccanti](https://github.com/reccanti) | +| 2 | [onokumus](https://github.com/onokumus) | +| 2 | [moozzyk](https://github.com/moozzyk) | +| 1 | [Ajedi32](https://github.com/Ajedi32) | +| 1 | [caesar](https://github.com/caesar) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | +| 1 | [qm3ster](https://github.com/qm3ster) | +| 1 | [zachwhaley](https://github.com/zachwhaley) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 01, 2018._ \ No newline at end of file diff --git a/node_modules/gray-matter/gray-matter.d.ts b/node_modules/gray-matter/gray-matter.d.ts new file mode 100644 index 0000000..dec9c09 --- /dev/null +++ b/node_modules/gray-matter/gray-matter.d.ts @@ -0,0 +1,114 @@ +/** + * Takes a string or object with `content` property, extracts + * and parses front-matter from the string, then returns an object + * with `data`, `content` and other [useful properties](#returned-object). + * + * ```js + * var matter = require('gray-matter'); + * console.log(matter('---\ntitle: Home\n---\nOther stuff')); + * //=> { data: { title: 'Home'}, content: 'Other stuff' } + * ``` + * @param {Object|String} `input` String, or object with `content` string + * @param {Object} `options` + * @return {Object} + * @api public + */ +declare function matter< + I extends matter.Input, + O extends matter.GrayMatterOption +>(input: I | { content: I }, options?: O): matter.GrayMatterFile + +declare namespace matter { + type Input = string | Buffer + interface GrayMatterOption< + I extends Input, + O extends GrayMatterOption + > { + parser?: () => void + eval?: boolean + excerpt?: boolean | ((input: I, options: O) => string) + excerpt_separator?: string + engines?: { + [index: string]: + | ((input: string) => object) + | { parse: (input: string) => object; stringify?: (data: object) => string } + } + language?: string + delimiters?: string | [string, string] + } + interface GrayMatterFile { + data: { [key: string]: any } + content: string + excerpt?: string + orig: Buffer | I + language: string + matter: string + stringify(lang: string): string + } + + /** + * Stringify an object to YAML or the specified language, and + * append it to the given string. By default, only YAML and JSON + * can be stringified. See the [engines](#engines) section to learn + * how to stringify other languages. + * + * ```js + * console.log(matter.stringify('foo bar baz', {title: 'Home'})); + * // results in: + * // --- + * // title: Home + * // --- + * // foo bar baz + * ``` + * @param {String|Object} `file` The content string to append to stringified front-matter, or a file object with `file.content` string. + * @param {Object} `data` Front matter to stringify. + * @param {Object} `options` [Options](#options) to pass to gray-matter and [js-yaml]. + * @return {String} Returns a string created by wrapping stringified yaml with delimiters, and appending that to the given string. + */ + export function stringify>( + file: string | { content: string }, + data: object, + options?: GrayMatterOption + ): string + + /** + * Synchronously read a file from the file system and parse + * front matter. Returns the same object as the [main function](#matter). + * + * ```js + * var file = matter.read('./content/blog-post.md'); + * ``` + * @param {String} `filepath` file path of the file to read. + * @param {Object} `options` [Options](#options) to pass to gray-matter. + * @return {Object} Returns [an object](#returned-object) with `data` and `content` + */ + export function read>( + fp: string, + options?: GrayMatterOption + ): matter.GrayMatterFile + + /** + * Returns true if the given `string` has front matter. + * @param {String} `string` + * @param {Object} `options` + * @return {Boolean} True if front matter exists. + */ + export function test>( + str: string, + options?: GrayMatterOption + ): boolean + + /** + * Detect the language to use, if one is defined after the + * first front-matter delimiter. + * @param {String} `string` + * @param {Object} `options` + * @return {Object} Object with `raw` (actual language string), and `name`, the language with whitespace trimmed + */ + export function language>( + str: string, + options?: GrayMatterOption + ): { name: string; raw: string } +} + +export = matter diff --git a/node_modules/gray-matter/index.js b/node_modules/gray-matter/index.js new file mode 100644 index 0000000..7d49331 --- /dev/null +++ b/node_modules/gray-matter/index.js @@ -0,0 +1,228 @@ +'use strict'; + +const fs = require('fs'); +const sections = require('section-matter'); +const defaults = require('./lib/defaults'); +const stringify = require('./lib/stringify'); +const excerpt = require('./lib/excerpt'); +const engines = require('./lib/engines'); +const toFile = require('./lib/to-file'); +const parse = require('./lib/parse'); +const utils = require('./lib/utils'); + +/** + * Takes a string or object with `content` property, extracts + * and parses front-matter from the string, then returns an object + * with `data`, `content` and other [useful properties](#returned-object). + * + * ```js + * const matter = require('gray-matter'); + * console.log(matter('---\ntitle: Home\n---\nOther stuff')); + * //=> { data: { title: 'Home'}, content: 'Other stuff' } + * ``` + * @param {Object|String} `input` String, or object with `content` string + * @param {Object} `options` + * @return {Object} + * @api public + */ + +function matter(input, options) { + if (input === '') { + return { data: {}, content: input, excerpt: '', orig: input }; + } + + let file = toFile(input); + const cached = matter.cache[file.content]; + + if (!options) { + if (cached) { + file = Object.assign({}, cached); + file.orig = cached.orig; + return file; + } + + // only cache if there are no options passed. if we cache when options + // are passed, we would need to also cache options values, which would + // negate any performance benefits of caching + matter.cache[file.content] = file; + } + + return parseMatter(file, options); +} + +/** + * Parse front matter + */ + +function parseMatter(file, options) { + const opts = defaults(options); + const open = opts.delimiters[0]; + const close = '\n' + opts.delimiters[1]; + let str = file.content; + + if (opts.language) { + file.language = opts.language; + } + + // get the length of the opening delimiter + const openLen = open.length; + if (!utils.startsWith(str, open, openLen)) { + excerpt(file, opts); + return file; + } + + // if the next character after the opening delimiter is + // a character from the delimiter, then it's not a front- + // matter delimiter + if (str.charAt(openLen) === open.slice(-1)) { + return file; + } + + // strip the opening delimiter + str = str.slice(openLen); + const len = str.length; + + // use the language defined after first delimiter, if it exists + const language = matter.language(str, opts); + if (language.name) { + file.language = language.name; + str = str.slice(language.raw.length); + } + + // get the index of the closing delimiter + let closeIndex = str.indexOf(close); + if (closeIndex === -1) { + closeIndex = len; + } + + // get the raw front-matter block + file.matter = str.slice(0, closeIndex); + + const block = file.matter.replace(/^\s*#[^\n]+/gm, '').trim(); + if (block === '') { + file.isEmpty = true; + file.empty = file.content; + file.data = {}; + } else { + + // create file.data by parsing the raw file.matter block + file.data = parse(file.language, file.matter, opts); + } + + // update file.content + if (closeIndex === len) { + file.content = ''; + } else { + file.content = str.slice(closeIndex + close.length); + if (file.content[0] === '\r') { + file.content = file.content.slice(1); + } + if (file.content[0] === '\n') { + file.content = file.content.slice(1); + } + } + + excerpt(file, opts); + + if (opts.sections === true || typeof opts.section === 'function') { + sections(file, opts.section); + } + return file; +} + +/** + * Expose engines + */ + +matter.engines = engines; + +/** + * Stringify an object to YAML or the specified language, and + * append it to the given string. By default, only YAML and JSON + * can be stringified. See the [engines](#engines) section to learn + * how to stringify other languages. + * + * ```js + * console.log(matter.stringify('foo bar baz', {title: 'Home'})); + * // results in: + * // --- + * // title: Home + * // --- + * // foo bar baz + * ``` + * @param {String|Object} `file` The content string to append to stringified front-matter, or a file object with `file.content` string. + * @param {Object} `data` Front matter to stringify. + * @param {Object} `options` [Options](#options) to pass to gray-matter and [js-yaml]. + * @return {String} Returns a string created by wrapping stringified yaml with delimiters, and appending that to the given string. + * @api public + */ + +matter.stringify = function(file, data, options) { + if (typeof file === 'string') file = matter(file, options); + return stringify(file, data, options); +}; + +/** + * Synchronously read a file from the file system and parse + * front matter. Returns the same object as the [main function](#matter). + * + * ```js + * const file = matter.read('./content/blog-post.md'); + * ``` + * @param {String} `filepath` file path of the file to read. + * @param {Object} `options` [Options](#options) to pass to gray-matter. + * @return {Object} Returns [an object](#returned-object) with `data` and `content` + * @api public + */ + +matter.read = function(filepath, options) { + const str = fs.readFileSync(filepath, 'utf8'); + const file = matter(str, options); + file.path = filepath; + return file; +}; + +/** + * Returns true if the given `string` has front matter. + * @param {String} `string` + * @param {Object} `options` + * @return {Boolean} True if front matter exists. + * @api public + */ + +matter.test = function(str, options) { + return utils.startsWith(str, defaults(options).delimiters[0]); +}; + +/** + * Detect the language to use, if one is defined after the + * first front-matter delimiter. + * @param {String} `string` + * @param {Object} `options` + * @return {Object} Object with `raw` (actual language string), and `name`, the language with whitespace trimmed + */ + +matter.language = function(str, options) { + const opts = defaults(options); + const open = opts.delimiters[0]; + + if (matter.test(str)) { + str = str.slice(open.length); + } + + const language = str.slice(0, str.search(/\r?\n/)); + return { + raw: language, + name: language ? language.trim() : '' + }; +}; + +/** + * Expose `matter` + */ + +matter.cache = {}; +matter.clearCache = function() { + matter.cache = {}; +}; +module.exports = matter; diff --git a/node_modules/gray-matter/lib/defaults.js b/node_modules/gray-matter/lib/defaults.js new file mode 100644 index 0000000..81d9e41 --- /dev/null +++ b/node_modules/gray-matter/lib/defaults.js @@ -0,0 +1,18 @@ +'use strict'; + +const engines = require('./engines'); +const utils = require('./utils'); + +module.exports = function(options) { + const opts = Object.assign({}, options); + + // ensure that delimiters are an array + opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || '---'); + if (opts.delimiters.length === 1) { + opts.delimiters.push(opts.delimiters[0]); + } + + opts.language = (opts.language || opts.lang || 'yaml').toLowerCase(); + opts.engines = Object.assign({}, engines, opts.parsers, opts.engines); + return opts; +}; diff --git a/node_modules/gray-matter/lib/engine.js b/node_modules/gray-matter/lib/engine.js new file mode 100644 index 0000000..d8f6c41 --- /dev/null +++ b/node_modules/gray-matter/lib/engine.js @@ -0,0 +1,30 @@ +'use strict'; + +module.exports = function(name, options) { + let engine = options.engines[name] || options.engines[aliase(name)]; + if (typeof engine === 'undefined') { + throw new Error('gray-matter engine "' + name + '" is not registered'); + } + if (typeof engine === 'function') { + engine = { parse: engine }; + } + return engine; +}; + +function aliase(name) { + switch (name.toLowerCase()) { + case 'js': + case 'javascript': + return 'javascript'; + case 'coffee': + case 'coffeescript': + case 'cson': + return 'coffee'; + case 'yaml': + case 'yml': + return 'yaml'; + default: { + return name; + } + } +} diff --git a/node_modules/gray-matter/lib/engines.js b/node_modules/gray-matter/lib/engines.js new file mode 100644 index 0000000..38f993d --- /dev/null +++ b/node_modules/gray-matter/lib/engines.js @@ -0,0 +1,54 @@ +'use strict'; + +const yaml = require('js-yaml'); + +/** + * Default engines + */ + +const engines = exports = module.exports; + +/** + * YAML + */ + +engines.yaml = { + parse: yaml.safeLoad.bind(yaml), + stringify: yaml.safeDump.bind(yaml) +}; + +/** + * JSON + */ + +engines.json = { + parse: JSON.parse.bind(JSON), + stringify: function(obj, options) { + const opts = Object.assign({replacer: null, space: 2}, options); + return JSON.stringify(obj, opts.replacer, opts.space); + } +}; + +/** + * JavaScript + */ + +engines.javascript = { + parse: function parse(str, options, wrap) { + /* eslint no-eval: 0 */ + try { + if (wrap !== false) { + str = '(function() {\nreturn ' + str.trim() + ';\n}());'; + } + return eval(str) || {}; + } catch (err) { + if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) { + return parse(str, options, false); + } + throw new SyntaxError(err); + } + }, + stringify: function() { + throw new Error('stringifying JavaScript is not supported'); + } +}; diff --git a/node_modules/gray-matter/lib/excerpt.js b/node_modules/gray-matter/lib/excerpt.js new file mode 100644 index 0000000..14d9904 --- /dev/null +++ b/node_modules/gray-matter/lib/excerpt.js @@ -0,0 +1,32 @@ +'use strict'; + +const defaults = require('./defaults'); + +module.exports = function(file, options) { + const opts = defaults(options); + + if (file.data == null) { + file.data = {}; + } + + if (typeof opts.excerpt === 'function') { + return opts.excerpt(file, opts); + } + + const sep = file.data.excerpt_separator || opts.excerpt_separator; + if (sep == null && (opts.excerpt === false || opts.excerpt == null)) { + return file; + } + + const delimiter = typeof opts.excerpt === 'string' + ? opts.excerpt + : (sep || opts.delimiters[0]); + + // if enabled, get the excerpt defined after front-matter + const idx = file.content.indexOf(delimiter); + if (idx !== -1) { + file.excerpt = file.content.slice(0, idx); + } + + return file; +}; diff --git a/node_modules/gray-matter/lib/parse.js b/node_modules/gray-matter/lib/parse.js new file mode 100644 index 0000000..e10ea9b --- /dev/null +++ b/node_modules/gray-matter/lib/parse.js @@ -0,0 +1,13 @@ +'use strict'; + +const getEngine = require('./engine'); +const defaults = require('./defaults'); + +module.exports = function(language, str, options) { + const opts = defaults(options); + const engine = getEngine(language, opts); + if (typeof engine.parse !== 'function') { + throw new TypeError('expected "' + language + '.parse" to be a function'); + } + return engine.parse(str, opts); +}; diff --git a/node_modules/gray-matter/lib/stringify.js b/node_modules/gray-matter/lib/stringify.js new file mode 100644 index 0000000..b4c70a4 --- /dev/null +++ b/node_modules/gray-matter/lib/stringify.js @@ -0,0 +1,56 @@ +'use strict'; + +const typeOf = require('kind-of'); +const getEngine = require('./engine'); +const defaults = require('./defaults'); + +module.exports = function(file, data, options) { + if (data == null && options == null) { + switch (typeOf(file)) { + case 'object': + data = file.data; + options = {}; + break; + case 'string': + return file; + default: { + throw new TypeError('expected file to be a string or object'); + } + } + } + + const str = file.content; + const opts = defaults(options); + if (data == null) { + if (!opts.data) return file; + data = opts.data; + } + + const language = file.language || opts.language; + const engine = getEngine(language, opts); + if (typeof engine.stringify !== 'function') { + throw new TypeError('expected "' + language + '.stringify" to be a function'); + } + + data = Object.assign({}, file.data, data); + const open = opts.delimiters[0]; + const close = opts.delimiters[1]; + const matter = engine.stringify(data, options).trim(); + let buf = ''; + + if (matter !== '{}') { + buf = newline(open) + newline(matter) + newline(close); + } + + if (typeof file.excerpt === 'string' && file.excerpt !== '') { + if (str.indexOf(file.excerpt.trim()) === -1) { + buf += newline(file.excerpt) + newline(close); + } + } + + return buf + newline(str); +}; + +function newline(str) { + return str.slice(-1) !== '\n' ? str + '\n' : str; +} diff --git a/node_modules/gray-matter/lib/to-file.js b/node_modules/gray-matter/lib/to-file.js new file mode 100644 index 0000000..799bb5d --- /dev/null +++ b/node_modules/gray-matter/lib/to-file.js @@ -0,0 +1,43 @@ +'use strict'; + +const typeOf = require('kind-of'); +const stringify = require('./stringify'); +const utils = require('./utils'); + +/** + * Normalize the given value to ensure an object is returned + * with the expected properties. + */ + +module.exports = function(file) { + if (typeOf(file) !== 'object') { + file = { content: file }; + } + + if (typeOf(file.data) !== 'object') { + file.data = {}; + } + + // if file was passed as an object, ensure that + // "file.content" is set + if (file.contents && file.content == null) { + file.content = file.contents; + } + + // set non-enumerable properties on the file object + utils.define(file, 'orig', utils.toBuffer(file.content)); + utils.define(file, 'language', file.language || ''); + utils.define(file, 'matter', file.matter || ''); + utils.define(file, 'stringify', function(data, options) { + if (options && options.language) { + file.language = options.language; + } + return stringify(file, data, options); + }); + + // strip BOM and ensure that "file.content" is a string + file.content = utils.toString(file.content); + file.isEmpty = false; + file.excerpt = ''; + return file; +}; diff --git a/node_modules/gray-matter/lib/utils.js b/node_modules/gray-matter/lib/utils.js new file mode 100644 index 0000000..96e7ce0 --- /dev/null +++ b/node_modules/gray-matter/lib/utils.js @@ -0,0 +1,66 @@ +'use strict'; + +const stripBom = require('strip-bom-string'); +const typeOf = require('kind-of'); + +exports.define = function(obj, key, val) { + Reflect.defineProperty(obj, key, { + enumerable: false, + configurable: true, + writable: true, + value: val + }); +}; + +/** + * Returns true if `val` is a buffer + */ + +exports.isBuffer = function(val) { + return typeOf(val) === 'buffer'; +}; + +/** + * Returns true if `val` is an object + */ + +exports.isObject = function(val) { + return typeOf(val) === 'object'; +}; + +/** + * Cast `input` to a buffer + */ + +exports.toBuffer = function(input) { + return typeof input === 'string' ? Buffer.from(input) : input; +}; + +/** + * Cast `val` to a string. + */ + +exports.toString = function(input) { + if (exports.isBuffer(input)) return stripBom(String(input)); + if (typeof input !== 'string') { + throw new TypeError('expected input to be a string or buffer'); + } + return stripBom(input); +}; + +/** + * Cast `val` to an array. + */ + +exports.arrayify = function(val) { + return val ? (Array.isArray(val) ? val : [val]) : []; +}; + +/** + * Returns true if `str` starts with `substr`. + */ + +exports.startsWith = function(str, substr, len) { + if (typeof len !== 'number') len = substr.length; + return str.slice(0, len) === substr; +}; diff --git a/node_modules/gray-matter/package.json b/node_modules/gray-matter/package.json new file mode 100644 index 0000000..c5a1fff --- /dev/null +++ b/node_modules/gray-matter/package.json @@ -0,0 +1,127 @@ +{ + "name": "gray-matter", + "description": "Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML front matter by default, but also has support for YAML, JSON, TOML or Coffee Front-Matter, with options to set custom delimiters. Used by metalsmith, assemble, verb and many other projects.", + "version": "4.0.3", + "homepage": "https://github.com/jonschlinkert/gray-matter", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Andrew Meyer (https://github.com/Ajedi32)", + "Brian Woodward (https://twitter.com/doowb)", + "Caesar Schinas (https://caesarschinas.com)", + "Ian Storm Taylor (http://ianstormtaylor.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Osman Nuri Okumuş (http://onokumus.com)", + "Pawel Kadluczka (http://blog.3d-logic.com)", + "Rob Loach (http://robloach.net)", + "(https://github.com/heymind)", + "Zach Whaley (http://zachwhaleys.website)" + ], + "repository": "jonschlinkert/gray-matter", + "bugs": { + "url": "https://github.com/jonschlinkert/gray-matter/issues" + }, + "license": "MIT", + "files": [ + "gray-matter.d.ts", + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=6.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "js-yaml": "^3.13.1", + "kind-of": "^6.0.2", + "section-matter": "^1.0.0", + "strip-bom-string": "^1.0.0" + }, + "devDependencies": { + "ansi-green": "^0.1.1", + "benchmarked": "^2.0.0", + "coffeescript": "^2.2.3", + "delimiter-regex": "^2.0.0", + "extend-shallow": "^3.0.2", + "front-matter": "^2.3.0", + "gulp-format-md": "^1.0.0", + "minimist": "^1.2.0", + "mocha": "^6.1.4", + "toml": "^2.3.3", + "vinyl": "^2.1.0", + "write": "^1.0.3" + }, + "keywords": [ + "assemble", + "coffee", + "coffee-script", + "data", + "docs", + "documentation", + "extract", + "extracting", + "front", + "front-matter", + "frontmatter", + "generate", + "generator", + "gh-pages", + "gray", + "javascript", + "jekyll", + "js", + "JSON", + "markdown", + "matter", + "parse", + "parser", + "parsing", + "site", + "static", + "template", + "toml", + "yaml", + "yfm" + ], + "browser": { + "fs": false + }, + "typings": "gray-matter.d.ts", + "eslintConfig": { + "rules": { + "no-console": 0 + } + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "helpers": { + "examples": "./examples/helper.js" + }, + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "assemble", + "metalsmith", + "verb" + ] + }, + "reflinks": [ + "coffe-script", + "generate", + "js-yaml", + "toml", + "update" + ] + } +} diff --git a/node_modules/hamljs/.bower.json b/node_modules/hamljs/.bower.json new file mode 100644 index 0000000..272f4eb --- /dev/null +++ b/node_modules/hamljs/.bower.json @@ -0,0 +1,14 @@ +{ + "name": "haml.js", + "homepage": "https://github.com/visionmedia/haml.js", + "version": "0.6.2", + "_release": "0.6.2", + "_resolution": { + "type": "version", + "tag": "0.6.2", + "commit": "52228c31b34a4c3461cc94b321f1c2a5ef391455" + }, + "_source": "git://github.com/visionmedia/haml.js.git", + "_target": "1.x", + "_originalSource": "haml" +} diff --git a/node_modules/hamljs/.gitmodules b/node_modules/hamljs/.gitmodules new file mode 100644 index 0000000..83fc8f9 --- /dev/null +++ b/node_modules/hamljs/.gitmodules @@ -0,0 +1,3 @@ +[submodule "benchmarks/haml-js"] + path = benchmarks/haml-js + url = git://github.com/creationix/haml-js.git diff --git a/node_modules/hamljs/.ignore b/node_modules/hamljs/.ignore new file mode 100644 index 0000000..81736c9 --- /dev/null +++ b/node_modules/hamljs/.ignore @@ -0,0 +1 @@ +benchmarks \ No newline at end of file diff --git a/node_modules/hamljs/.npmignore b/node_modules/hamljs/.npmignore new file mode 100644 index 0000000..4acf1d6 --- /dev/null +++ b/node_modules/hamljs/.npmignore @@ -0,0 +1,3 @@ +benchmarks +examples +spec diff --git a/node_modules/hamljs/.travis.yml b/node_modules/hamljs/.travis.yml new file mode 100644 index 0000000..09d3ef3 --- /dev/null +++ b/node_modules/hamljs/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.10 diff --git a/node_modules/hamljs/Gruntfile.js b/node_modules/hamljs/Gruntfile.js new file mode 100644 index 0000000..125cae1 --- /dev/null +++ b/node_modules/hamljs/Gruntfile.js @@ -0,0 +1,19 @@ +"use strict"; + +module.exports = function(grunt) { + + grunt.initConfig({ + urequire: { + dist: { + path: "lib", + main: "haml", + dstPath: ".", + template: "AMD" + } + } + }); + + grunt.loadNpmTasks("grunt-urequire"); + grunt.registerTask("default", ["urequire"]); + +}; diff --git a/node_modules/hamljs/History.md b/node_modules/hamljs/History.md new file mode 100644 index 0000000..b9aa315 --- /dev/null +++ b/node_modules/hamljs/History.md @@ -0,0 +1,120 @@ +0.6.2 / 2014-02-17 +================== + + * add support for string interpolation + * add amd support + * add `.renderFile` + * ability to use both class tag and class attribute at the same time + +0.6.1 / 2012-07-26 +================== + + * fix global leak of Parser + +0.6.0 / 2012-06-25 +================== + + * remove engine restriction + * [fix] Changed require('sys') to require('util') for compatibility with node v0.8 + * require('util') instead of require('sys') + * Refactor tests to not use require.paths + * Typechange (from a symlink to a file). + +0.5.1 / 2011-03-30 +================== + + * Exposing Parser for extension [Derek Hammer] + +0.5.0 / 2011-03-04 +================== + + * Added `.compile()` for Express 2.0 + * Fixed issue with to many newlines in output. Closes #24 + +0.4.5 / 2010-06-04 +================== + + * Ignoring stray indent + +0.4.4 / 2010-05-27 +================== + + * Fixed arbitrary whitespace support + +0.4.3 / 2010-05-25 +================== + + * Fixed support for CRLF / CR line-endings, converted on input + * Exporting HamlError + +0.4.2 / 2010-05-25 +================== + + * Added HamlError + * Buffer newline indentation. Closes #23 + * Benchmarks with node-bench + +0.4.1 / 2010-05-17 +================== + + * Fixed "- each" with non-enumerables, no longer throws exception + * Fixed array iteration + +0.4.0 / 2010-05-06 +================== + + * Using Function constructor instead of eval() + * Performance enhanced by faster iteration implementation for "- each" + +0.3.1 / 2010-04-26 +================== + + * Fixed support for tags with hypens (both namespace / tag name, ex: "fb:login-button") + +0.3.0 / 2010-04-16 +================== + + * Added xml namespace support + * Added xml support + +0.2.0 / 2010-04-06 +================== + + * Added conditional comment support [ciaranj] + * Fixed; Trimming input string before tokenization + * Fixed issue requiring quoting of "for" when used in attrs [aheckmann] + * Fixed; Exposing Haml compilation cache. Closes #12 + * Fixed :javascript "type" attr, now "text/javascript" [aheckmann] + +0.1.0 / 2010-03-31 +================== + + * Added "cache" option, making haml.js over 90 times faster than haml-js + * Improved textBlock whitespace replication + * Fixed empty tags followed by class / ids on new lines. Closes #6 + +0.0.4 / 2010-03-29 +================== + + * Added better error reporting + +0.0.3 / 2010-03-29 +================== + + * Added "filename" option support to aid in error reporting + * Added exports.compile() to create intermediate javascript + * Added `make benchmark` + * Changed; caching function templates to increase performance + * Fixed; ids and classes allowing underscores. Closes #5 + * Fixed outdent issue when \n is not followed by whitespace. Closes #8 + +0.0.2 / 2010-03-26 +================== + + * Added haml.js vs haml-js benchmarks + * Fixed; commenting :javascript CDATA + +0.0.1 / 2010-03-26 +================== + + * Initial release diff --git a/node_modules/hamljs/Makefile b/node_modules/hamljs/Makefile new file mode 100644 index 0000000..d9cee9d --- /dev/null +++ b/node_modules/hamljs/Makefile @@ -0,0 +1,11 @@ +REPORTER = spec +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter $(REPORTER) \ + test/test.js + +benchmark: + @node-bench benchmarks/run.js + +.PHONY: test benchmark diff --git a/node_modules/hamljs/Readme.md b/node_modules/hamljs/Readme.md new file mode 100644 index 0000000..f74007e --- /dev/null +++ b/node_modules/hamljs/Readme.md @@ -0,0 +1,318 @@ +# Haml.js + + High performance JavaScript [Haml](http://haml-lang.com) implementation for [nodejs](http://nodejs.org) + + For a higher quality implementation you may want to look at my [Jade](http://jade-lang.com) template engine, + however the syntax is slightly different. Jade's engine may be back-ported to haml.js in the future. + + [![Build Status](https://travis-ci.org/visionmedia/haml.js.png?branch=master)](https://travis-ci.org/visionmedia/haml.js) + +## Installation + + $ npm install hamljs + + node> require('hamljs') + +## Express + + To use with [Express](http://expressjs.com) and the .haml extension, simply register the engine: + + app.engine('.haml', require('hamljs').renderFile); + +## About + + Benchmarks rendering the same 21 line haml file located at _benchmarks/page.haml_, + shows that this library is nearly **65%** or **3 times** faster than haml-js. + + Winner: haml.js + Compared with next highest (haml-js), it's: + 65.39% faster + 2.89 times as fast + 0 order(s) of magnitude faster + + Haml.js attempts to comply with the original [Haml](http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html) + implementation as well as possible. There are no magic "plugins" like + found in other JavaScript haml implementations, for example the following + will work just fine: + + - if (items) + %ul + - for (var i = 0; i < items.length; ++i) + %li= items[i] + + Iteration is the one exception to these magical plugins, + since this is **ugly** in JavaScript, you may also: + + - if (items) + %ul + - each item in items + %li= item + +## Tags + + %div text + +html: + +
text
+ +## Classes + + %div.article.first + article text here + and here + +html: + +
+ article text here and here +
+ +## Div Class Shortcut + + .comment hey + +html: + +
hey
+ +## Div Id Shortcut + + #article-1 foo + +html: + +
foo
+ +## Combining Ids and Classes + +You may chain id and classes in any order: + + .article#first.summary content + +html: + +
content
+ +## Attributes + + %a{ href: 'http://google.com', title: 'Google It' } Google + +html: + + Google + +Attribute keys such as "for" are automatically quoted +by haml.js, so instead of: + + %label{ 'for': 'something' } + +you should: + + %label{ for: 'something' } + +which will render: + + + +## Boolean Attributes + + %input{ type: 'checkbox', checked: true } + +html: + + + +## Combining Attributes, Ids, and Classes + +Wemay also contain id and classes before or after: + + %a.button{ href: 'http://google.com', title: 'Google It' }.first Google + +html: + + Google + +## Code + +Code starting with a hyphen will be executed but +not buffered, where as code using the equals sign +will be buffered: + + - a = 1 + - b = 2 + = a + b + +html: + + 3 + +HTML buffered with equals sign will **always** be escaped: + + = "
" + +html: + + <br/> + +To prevent escaping of HTML entities we can use _!=_: + + != "
" + +html: + +
+ +## Iteration + + %ul + - each item in items + %li= item + +html: + +
    +
  • one
  • +
  • two
  • +
  • three
  • +
+ +If you require the key or index of the object +or array during iteration simple append a comma +following another id: + + %ul + - each item, index in items + %li= item + '(' + index + ')' + +html: + +
    +
  • one(0)
  • +
  • two(1)
  • +
  • three(2)
  • +
+ +## Doctypes + +Defaults to transitional: + + !!! + +html: + + + +Optionally pass a supported doctype name: + + !!! strict + +html: + + + +currently supported doctypes, which can be +extended simply by adding values to to _haml.doctypes_. + + '5': '', + 'xml': '', + 'default': '', + 'strict': '', + 'frameset': '', + '1.1': '', + 'basic': '', + 'mobile': '' + +## String interpolation + + %div Hello #{world} + +with locals: + + { world: "World!" } + +html: + +
Hello World!
+ +## :cdata + + %script + :cdata + foo + +html: + + + +## :javascript + + %head + :javascript + if (foo) + if (bar) + alert('baz') + +html: + + + + + +## Extending Haml + +### Adding Filters + + var haml = require('hamljs') + haml.filters.my_filter = function(str) { + return doSomethingWith(str) + } + +by registering the filter function _my_filter_ we can now +utilize it within our Haml templates as shown below: + %p + :my_filter + some text + here yay + whoop awesome + +### Adding Doctypes + + var haml = require('hamljs') + haml.doctypes.foo = '' + +Will now allow you to: + !!! foo + +## License + +(The MIT License) + +Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> + +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. diff --git a/node_modules/hamljs/haml.js b/node_modules/hamljs/haml.js new file mode 100644 index 0000000..c0ec0b9 --- /dev/null +++ b/node_modules/hamljs/haml.js @@ -0,0 +1,436 @@ +// Generated by uRequire v0.6.10 - template: 'AMD' +(function (window, global) { + +var __isAMD = !!(typeof define === 'function' && define.amd), + __isNode = (typeof exports === 'object'), + __isWeb = !__isNode; +define(function (require, exports, module) { + + +var HAML = {}; +HAML.version = "0.6.2"; +HAML.cache = {}; +HAML.errorContextLength = 15; +HAML.selfClosing = [ + "meta", + "img", + "link", + "br", + "hr", + "input", + "area", + "base" +]; +HAML.doctypes = { + "5": "", + "xml": "", + "default": "", + "strict": "", + "frameset": "", + "1.1": "", + "basic": "", + "mobile": "" +}; +HAML.filters = { + plain: function (str, buf) { + buf.push(str); + }, + cdata: function (str, buf) { + buf.push(""); + }, + javascript: function (str, buf) { + buf.push(""); + } +}; +var HamlError = HAML.HamlError = function (msg) { + this.name = "HamlError"; + this.message = msg; + Error.captureStackTrace(this, HAML.render); + }; +HamlError.super_ = Error; +HamlError.prototype = Object.create(Error.prototype, { + constructor: { + value: HamlError, + enumerable: false, + writable: true, + configurable: true + } +}); +var rules = { + indent: /^\n( *)(?! *-#)/, + conditionalComment: /^\/(\[[^\n]+\])/, + comment: /^\n? *\/ */, + silentComment: /^\n? *-#([^\n]*)/, + doctype: /^!!! *([^\n]*)/, + escape: /^\\(.)/, + filter: /^:(\w+) */, + each: /^\- *each *(\w+)(?: *, *(\w+))? * in ([^\n]+)/, + code: /^\-([^\n]+)/, + outputCode: /^!=([^\n]+)/, + escapeCode: /^=([^\n]+)/, + attrs: /^\{(.*?)\}/, + tag: /^%([-a-zA-Z][-a-zA-Z0-9:]*)/, + class: /^\.([\w\-]+)/, + id: /^\#([\w\-]+)/, + text: /^([^\n]+)/ + }; +function context(str) { + return String(str).substr(0, HAML.errorContextLength).replace(/\n/g, "\\n"); +} +function tokenize(str) { + var captures, token, tokens = [], line = 1, lastIndents = 0, str = String(str).trim().replace(/\r\n|\r|\n *\n/g, "\n"); + function error(msg) { + throw new HamlError("(Haml):" + line + " " + msg); + } + while (str.length) { + for (var type in rules) + if (captures = rules[type].exec(str)) { + token = { + type: type, + line: line, + match: captures[0], + val: captures.length > 2 ? captures.slice(1) : captures[1] + }; + str = str.substr(captures[0].length); + if (type === "indent") + ++line; + else + break; + var indents = token.val.length / 2; + if (indents % 1) + error("invalid indentation; got " + token.val.length + " spaces, should be multiple of 2"); + else if (indents - 1 > lastIndents) + error("invalid indentation; got " + indents + ", when previous was " + lastIndents); + else if (lastIndents > indents) + while (lastIndents-- > indents) + tokens.push({ + type: "outdent", + line: line + }); + else if (lastIndents !== indents) + tokens.push({ + type: "indent", + line: line + }); + else + tokens.push({ + type: "newline", + line: line + }); + lastIndents = indents; + } + if (token) { + if (token.type !== "silentComment") + tokens.push(token); + token = null; + } else + error("near \"" + context(str) + "\""); + } + return tokens.concat({ type: "eof" }); +} +var Parser = HAML.Parser = function (str, options) { + options = options || {}; + this.tokens = tokenize(str); + this.xml = options.xml; + }; +Parser.prototype = { + get peek() { + return this.tokens[0]; + }, + get advance() { + return this.current = this.tokens.shift(); + }, + get outdent() { + switch (this.peek.type) { + case "eof": + return; + case "outdent": + return this.advance; + default: + throw new HamlError("expected outdent, got " + this.peek.type); + } + }, + get text() { + var text = this.advance.val.trim(); + text = text.replace(/#\{(.*)\}/, "\" + $1 + \""); + this.buffer(text); + }, + get block() { + this.advance; + while (this.peek.type !== "outdent" && this.peek.type !== "eof") + this.expr; + this.outdent; + }, + get textBlock() { + var token, indents = 1; + this.advance; + while (this.peek.type !== "eof" && indents) + switch ((token = this.advance).type) { + case "newline": + this.buffer("\\n" + Array(indents).join(" ") + ""); + break; + case "indent": + ++indents; + this.buffer("\\n" + Array(indents).join(" ") + ""); + break; + case "outdent": + --indents; + if (indents === 1) + this.buffer("\\n"); + break; + default: + this.buffer(token.match.replace(/"/g, "\\\"")); + } + }, + get attrs() { + var attrs = [ + "attrs", + "class", + "id" + ], buf = []; + while (attrs.indexOf(this.peek.type) !== -1) + switch (this.peek.type) { + case "id": + buf.push("{ id: \"" + this.advance.val + "\" }"); + break; + case "class": + buf.push("{ class: \"" + this.advance.val + "\" }"); + break; + case "attrs": + buf.push("{ " + this.advance.val.replace(/(for) *:/gi, "\"$1\":") + " }"); + } + return buf.length ? " \" + attrs([" + buf.join(", ") + "]) + \"" : ""; + }, + get tag() { + var tag = this.advance.val, selfClosing = !this.xml && HAML.selfClosing.indexOf(tag) !== -1; + this.buffer("\\n<" + tag + this.attrs + (selfClosing ? "/>" : ">")); + switch (this.peek.type) { + case "text": + this.text; + break; + case "conditionalComment": + this.conditionalComment; + break; + case "comment": + this.comment; + break; + case "outputCode": + this.outputCode; + break; + case "escapeCode": + this.escapeCode; + break; + case "indent": + this.block; + } + if (!selfClosing) + this.buffer(""); + }, + get outputCode() { + this.buffer(this.advance.val, false); + }, + get escapeCode() { + this.buffer("escape(" + this.advance.val + ")", false); + }, + get doctype() { + var doctype = this.advance.val.trim().toLowerCase() || "default"; + if (doctype in HAML.doctypes) + this.buffer(HAML.doctypes[doctype].replace(/"/g, "\\\"")); + else + throw new HamlError("doctype `" + doctype + "' does not exist"); + }, + get conditionalComment() { + var condition = this.advance.val; + this.buffer(""); + }, + get comment() { + this.advance; + this.buffer(""); + }, + get code() { + var code = this.advance.val; + if (this.peek.type === "indent") { + this.buf.push(code); + this.buf.push("{"); + this.block; + this.buf.push("}"); + return; + } + this.buf.push(code); + }, + get filter() { + var filter = this.advance.val; + if (!(filter in HAML.filters)) + throw new HamlError("filter `" + filter + "' does not exist"); + if (this.peek.type !== "indent") + throw new HamlError("filter `" + filter + "' expects a text block"); + this.buf.push("HAML.filters." + filter + "("); + this.buf.push("(function(){"); + this.buf.push("var buf = []"); + this.textBlock; + this.buf.push("return buf.join(\"\")"); + this.buf.push("}).call(this)"); + this.buf.push(", buf)"); + }, + get iterate() { + var each = this.advance, key = each.val[1], vals = each.val[2], val = each.val[0]; + if (this.peek.type !== "indent") + throw new HamlError("'- each' expects a block, but got " + this.peek.type); + this.buf.push("for (var " + (key || "index") + " in " + vals + ") {"); + this.buf.push("var " + val + " = " + vals + "[" + (key || "index") + "];"); + this.block; + this.buf.push("}"); + }, + get expr() { + switch (this.peek.type) { + case "id": + case "class": + this.tokens.unshift({ + type: "tag", + val: "div" + }); + return this.tag; + case "tag": + return this.tag; + case "text": + var buf = []; + while (this.peek.type === "text") { + buf.push(this.advance.val.trim()); + if (this.peek.type === "newline") + this.advance; + } + return this.buffer(buf.join(" ")); + case "each": + return this.iterate; + case "code": + return this.code; + case "escape": + return this.buffer(this.advance.val); + case "doctype": + return this.doctype; + case "filter": + return this.filter; + case "conditionalComment": + return this.conditionalComment; + case "comment": + return this.comment; + case "escapeCode": + return this.escapeCode; + case "outputCode": + return this.outputCode; + case "newline": + case "indent": + case "outdent": + this.advance; + return this.expr; + default: + throw new HamlError("unexpected " + this.peek.type); + } + }, + get js() { + this.buf = [ + "with (locals || {}) {", + " var buf = [];" + ]; + while (this.peek.type !== "eof") + this.expr; + this.buf.push(" return buf.join(\"\")"); + this.buf.push("}"); + return this.buf.join("\n"); + }, + buffer: function (str, quoted) { + if (typeof quoted === "undefined") + var quoted = true; + if (quoted) + this.buf.push(" buf.push(\"" + str + "\")"); + else + this.buf.push(" buf.push(" + str + ")"); + } +}; +function escape(str) { + return String(str).replace(/&/g, "&").replace(/>/g, ">").replace(/ (MIT Licensed) + +var HAML = {}; + +/** + * Version. + */ + +HAML.version = '0.6.2' + +/** + * Haml template cache. + */ + +HAML.cache = {} + +/** + * Default error context length. + */ + +HAML.errorContextLength = 15 + +/** + * Self closing tags. + */ + +HAML.selfClosing = [ + 'meta', + 'img', + 'link', + 'br', + 'hr', + 'input', + 'area', + 'base' + ] + +/** + * Default supported doctypes. + */ + +HAML.doctypes = { + '5': '', + 'xml': '', + 'default': '', + 'strict': '', + 'frameset': '', + '1.1': '', + 'basic': '', + 'mobile': '' +} + +/** + * Default filters. + */ + +HAML.filters = { + + /** + * Return plain string. + */ + + plain: function(str, buf) { + buf.push(str) + }, + + /** + * Wrap with CDATA tags. + */ + + cdata: function(str, buf) { + buf.push('') + }, + + /** + * Wrap with ') + } +} + +/** + * HamlError. + */ + +var HamlError = HAML.HamlError = function(msg) { + this.name = 'HamlError' + this.message = msg + Error.captureStackTrace(this, HAML.render) +} + +/** + * HamlError inherits from Error. + */ +HamlError.super_ = Error; +HamlError.prototype = Object.create(Error.prototype, { + constructor: { + value: HamlError, + enumerable: false, + writable: true, + configurable: true + } +}); + +/** + * Lexing rules. + */ + +var rules = { + indent: /^\n( *)(?! *-#)/, + conditionalComment: /^\/(\[[^\n]+\])/, + comment: /^\n? *\/ */, + silentComment: /^\n? *-#([^\n]*)/, + doctype: /^!!! *([^\n]*)/, + escape: /^\\(.)/, + filter: /^:(\w+) */, + each: /^\- *each *(\w+)(?: *, *(\w+))? * in ([^\n]+)/, + code: /^\-([^\n]+)/, + outputCode: /^!=([^\n]+)/, + escapeCode: /^=([^\n]+)/, + attrs: /^\{(.*?)\}/, + tag: /^%([-a-zA-Z][-a-zA-Z0-9:]*)/, + class: /^\.([\w\-]+)/, + id: /^\#([\w\-]+)/, + text: /^([^\n]+)/ +} + +/** + * Return error context _str_. + * + * @param {string} str + * @return {string} + * @api private + */ + +function context(str) { + return String(str) + .substr(0, HAML.errorContextLength) + .replace(/\n/g, '\\n') +} + +/** + * Tokenize _str_. + * + * @param {string} str + * @return {array} + * @api private + */ + +function tokenize(str) { + var captures, + token, + tokens = [], + line = 1, + lastIndents = 0, + str = String(str).trim().replace(/\r\n|\r|\n *\n/g, '\n') + function error(msg){ throw new HamlError('(Haml):' + line + ' ' + msg) } + while (str.length) { + for (var type in rules) + if (captures = rules[type].exec(str)) { + token = { + type: type, + line: line, + match: captures[0], + val: captures.length > 2 + ? captures.slice(1) + : captures[1] + } + str = str.substr(captures[0].length) + if (type === 'indent') ++line + else break + var indents = token.val.length / 2 + if (indents % 1) + error('invalid indentation; got ' + token.val.length + ' spaces, should be multiple of 2') + else if (indents - 1 > lastIndents) + error('invalid indentation; got ' + indents + ', when previous was ' + lastIndents) + else if (lastIndents > indents) + while (lastIndents-- > indents) + tokens.push({ type: 'outdent', line: line }) + else if (lastIndents !== indents) + tokens.push({ type: 'indent', line: line }) + else + tokens.push({ type: 'newline', line: line }) + lastIndents = indents + } + if (token) { + if (token.type !== 'silentComment') + tokens.push(token) + token = null + } else + error('near "' + context(str) + '"') + } + return tokens.concat({ type: 'eof' }) +} + +// --- Parser + +/** + * Initialize parser with _str_ and _options_. + */ + +var Parser = HAML.Parser = function (str, options) { + options = options || {} + this.tokens = tokenize(str) + this.xml = options.xml +} + +Parser.prototype = { + + /** + * Lookahead a single token. + * + * @return {object} + * @api private + */ + + get peek() { + return this.tokens[0] + }, + + /** + * Advance a single token. + * + * @return {object} + * @api private + */ + + get advance() { + return this.current = this.tokens.shift() + }, + + /** + * outdent + * | eof + */ + + get outdent() { + switch (this.peek.type) { + case 'eof': + return + case 'outdent': + return this.advance + default: + throw new HamlError('expected outdent, got ' + this.peek.type) + } + }, + + /** + * text + */ + + get text() { + var text = this.advance.val.trim(); + + // String interpolation + text = text.replace(/#\{(.*)\}/, '" + $1 + "') + + this.buffer(text) + }, + + /** + * indent expr outdent + */ + + get block() { + this.advance + while (this.peek.type !== 'outdent' && + this.peek.type !== 'eof') + this.expr + this.outdent + }, + + /** + * indent expr + */ + + get textBlock() { + var token, + indents = 1 + this.advance + while (this.peek.type !== 'eof' && indents) + switch((token = this.advance).type) { + case 'newline': + this.buffer('\\n' + Array(indents).join(' ') + '') + break + case 'indent': + ++indents + this.buffer('\\n' + Array(indents).join(' ') + '') + break + case 'outdent': + --indents + if (indents === 1) this.buffer('\\n') + break + default: + this.buffer(token.match.replace(/"/g, '\\\"')) + } + }, + + /** + * ( attrs | class | id )* + */ + + get attrs() { + var attrs = ['attrs', 'class', 'id'], + buf = [] + + while (attrs.indexOf(this.peek.type) !== -1) + switch (this.peek.type) { + case 'id': + buf.push('{ id: "' + this.advance.val + '" }') + break + case 'class': + buf.push('{ class: "' + this.advance.val + '" }'); + break + case 'attrs': + buf.push('{ ' + this.advance.val.replace(/(for) *:/gi, '"$1":') + ' }') + } + + return buf.length + ? ' " + attrs([' + buf.join(', ') + ']) + "' + : '' + }, + + /** + * tag + * | tag text + * | tag conditionalComment + * | tag comment + * | tag outputCode + * | tag escapeCode + * | tag block + */ + + get tag() { + var tag = this.advance.val, + selfClosing = !this.xml && HAML.selfClosing.indexOf(tag) !== -1 + + this.buffer('\\n<' + tag + this.attrs + (selfClosing ? '/>' : '>')); + switch (this.peek.type) { + case 'text': + this.text + break + case 'conditionalComment': + this.conditionalComment + break; + case 'comment': + this.comment + break + case 'outputCode': + this.outputCode + break + case 'escapeCode': + this.escapeCode + break + case 'indent': + this.block + } + if (!selfClosing) this.buffer('') + }, + + /** + * outputCode + */ + + get outputCode() { + this.buffer(this.advance.val, false) + }, + + /** + * escapeCode + */ + + get escapeCode() { + this.buffer('escape(' + this.advance.val + ')', false) + }, + + /** + * doctype + */ + + get doctype() { + var doctype = this.advance.val.trim().toLowerCase() || 'default' + if (doctype in HAML.doctypes) + this.buffer(HAML.doctypes[doctype].replace(/"/g, '\\"')) + else + throw new HamlError("doctype `" + doctype + "' does not exist") + }, + + /** + * conditional comment expr + */ + + get conditionalComment() { + var condition= this.advance.val + + this.buffer('') + }, + + /** + * comment expr + */ + + get comment() { + this.advance + this.buffer('') + }, + + /** + * code + * | code block + */ + + get code() { + var code = this.advance.val + + if (this.peek.type === 'indent') { + this.buf.push(code) + this.buf.push('{') + this.block + this.buf.push('}') + return + } + + this.buf.push(code) + }, + + /** + * filter textBlock + */ + + get filter() { + var filter = this.advance.val + if (!(filter in HAML.filters)) + throw new HamlError("filter `" + filter + "' does not exist") + if (this.peek.type !== 'indent') + throw new HamlError("filter `" + filter + "' expects a text block") + + this.buf.push('HAML.filters.' + filter + '(') + this.buf.push('(function(){') + this.buf.push('var buf = []') + this.textBlock + this.buf.push('return buf.join("")') + this.buf.push('}).call(this)') + this.buf.push(', buf)') + }, + + /** + * each block + */ + + get iterate() { + var each = this.advance, + key = each.val[1], + vals = each.val[2], + val = each.val[0] + + if (this.peek.type !== 'indent') + throw new HamlError("'- each' expects a block, but got " + this.peek.type) + + this.buf.push('for (var ' + (key || 'index') + ' in ' + vals + ') {') + this.buf.push('var ' + val + ' = ' + vals + '[' + (key || 'index') + '];') + + this.block + + this.buf.push('}') + }, + + /** + * eof + * | tag + * | text* + * | each + * | code + * | escape + * | doctype + * | filter + * | comment + * | conditionalComment + * | escapeCode + * | outputCode + */ + + get expr() { + switch (this.peek.type) { + case 'id': + case 'class': + this.tokens.unshift({ type: 'tag', val: 'div' }) + return this.tag + case 'tag': + return this.tag + case 'text': + var buf = [] + while (this.peek.type === 'text') { + buf.push(this.advance.val.trim()) + if (this.peek.type === 'newline') + this.advance + } + return this.buffer(buf.join(' ')) + case 'each': + return this.iterate + case 'code': + return this.code + case 'escape': + return this.buffer(this.advance.val); + case 'doctype': + return this.doctype + case 'filter': + return this.filter + case 'conditionalComment': + return this.conditionalComment + case 'comment': + return this.comment + case 'escapeCode': + return this.escapeCode + case 'outputCode': + return this.outputCode + case 'newline': + case 'indent': + case 'outdent': + this.advance + return this.expr + default: + throw new HamlError('unexpected ' + this.peek.type) + } + }, + + /** + * expr* + */ + + get js() { + this.buf = [ + 'with (locals || {}) {', + ' var buf = [];' + ] + + while (this.peek.type !== 'eof') + this.expr + + this.buf.push(' return buf.join("")') + this.buf.push('}'); + + return this.buf.join('\n') + }, + + buffer: function (str, quoted) { + if (typeof quoted === 'undefined') + var quoted = true + + if (quoted) + this.buf.push(' buf.push("' + str + '")') + else + this.buf.push(' buf.push(' + str + ')') + } +} + +/** + * Escape html entities in _str_. + * + * @param {string} str + * @return {string} + * @api private + */ + +function escape(str) { + return String(str) + .replace(/&/g, '&') + .replace(/>/g, '>') + .replace(/ (http://tjholowaychuk.com)", + "main": "lib/haml.js", + "devDependencies": { + "should": "~2.1.1", + "mocha": "~1.16.2", + "grunt-urequire": "~0.6.0", + "grunt": "~0.4.2" + } +} diff --git a/node_modules/hamljs/test/fixtures/class.haml b/node_modules/hamljs/test/fixtures/class.haml new file mode 100644 index 0000000..f11f685 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/class.haml @@ -0,0 +1 @@ +.users \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/class.html b/node_modules/hamljs/test/fixtures/class.html new file mode 100644 index 0000000..4dc2d12 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/class.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/classes.haml b/node_modules/hamljs/test/fixtures/classes.haml new file mode 100644 index 0000000..dc250ce --- /dev/null +++ b/node_modules/hamljs/test/fixtures/classes.haml @@ -0,0 +1 @@ +.foo.bar.baz_is-awesome \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/classes.html b/node_modules/hamljs/test/fixtures/classes.html new file mode 100644 index 0000000..94bf993 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/classes.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.each.haml b/node_modules/hamljs/test/fixtures/code.each.haml new file mode 100644 index 0000000..9dbc82e --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.each.haml @@ -0,0 +1,3 @@ +%ul + - each item in items + %li= item \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.each.html b/node_modules/hamljs/test/fixtures/code.each.html new file mode 100644 index 0000000..bfdb0cd --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.each.html @@ -0,0 +1,4 @@ +
    +
  • one
  • +
  • two
  • +
  • three
\ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.each.index.haml b/node_modules/hamljs/test/fixtures/code.each.index.haml new file mode 100644 index 0000000..bfaf81f --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.each.index.haml @@ -0,0 +1,3 @@ +%ul + - each item, index in items + %li= item + '(' + index + ')' \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.each.index.html b/node_modules/hamljs/test/fixtures/code.each.index.html new file mode 100644 index 0000000..b449d4b --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.each.index.html @@ -0,0 +1,4 @@ +
    +
  • one(0)
  • +
  • two(1)
  • +
  • three(2)
\ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.each.non-enumerable.haml b/node_modules/hamljs/test/fixtures/code.each.non-enumerable.haml new file mode 100644 index 0000000..bfaf81f --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.each.non-enumerable.haml @@ -0,0 +1,3 @@ +%ul + - each item, index in items + %li= item + '(' + index + ')' \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.each.non-enumerable.html b/node_modules/hamljs/test/fixtures/code.each.non-enumerable.html new file mode 100644 index 0000000..e2d1b04 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.each.non-enumerable.html @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.escape.haml b/node_modules/hamljs/test/fixtures/code.escape.haml new file mode 100644 index 0000000..aacec56 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.escape.haml @@ -0,0 +1 @@ += "" \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.escape.html b/node_modules/hamljs/test/fixtures/code.escape.html new file mode 100644 index 0000000..a18ba70 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.escape.html @@ -0,0 +1 @@ +<br/> \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.haml b/node_modules/hamljs/test/fixtures/code.haml new file mode 100644 index 0000000..4236fe0 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.haml @@ -0,0 +1 @@ +!= "foo" + "bar" \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.html b/node_modules/hamljs/test/fixtures/code.html new file mode 100644 index 0000000..f6ea049 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.html @@ -0,0 +1 @@ +foobar \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.if.else.haml b/node_modules/hamljs/test/fixtures/code.if.else.haml new file mode 100644 index 0000000..5a6818a --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.if.else.haml @@ -0,0 +1,5 @@ +- name = "not tj :(" +- if (name === 'tj') + %p You are logged in +- else + %p You are NOT logged in diff --git a/node_modules/hamljs/test/fixtures/code.if.else.html b/node_modules/hamljs/test/fixtures/code.if.else.html new file mode 100644 index 0000000..fc7a5bb --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.if.else.html @@ -0,0 +1 @@ +

    You are NOT logged in

    diff --git a/node_modules/hamljs/test/fixtures/code.if.haml b/node_modules/hamljs/test/fixtures/code.if.haml new file mode 100644 index 0000000..6731782 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.if.haml @@ -0,0 +1,3 @@ +- name = "tj" +- if (name === 'tj') + %p You are logged in \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.if.html b/node_modules/hamljs/test/fixtures/code.if.html new file mode 100644 index 0000000..07c3d71 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.if.html @@ -0,0 +1 @@ +

    You are logged in

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.nested.haml b/node_modules/hamljs/test/fixtures/code.nested.haml new file mode 100644 index 0000000..a86a44f --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.nested.haml @@ -0,0 +1,5 @@ +- if (true) + - if (false) + %p nope + - if (true) + %p yay \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/code.nested.html b/node_modules/hamljs/test/fixtures/code.nested.html new file mode 100644 index 0000000..26c4fe1 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/code.nested.html @@ -0,0 +1 @@ +

    yay

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.block.conditional.haml b/node_modules/hamljs/test/fixtures/comment.block.conditional.haml new file mode 100644 index 0000000..213e9a9 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.block.conditional.haml @@ -0,0 +1,9 @@ +/[if IE] + %a{ 'href' : 'http://www.mozilla.com/en-US/firefox/' } + %h1 Get Firefox +/[if IE] + %a{ 'href' : 'http://www.mozilla.com/en-US/firefox/' } + /[if IE 6] + %h1 Get Firefox (IE6 user) + /[if IE 7] + %h1 Get Firefox (IE7 user) \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.block.conditional.html b/node_modules/hamljs/test/fixtures/comment.block.conditional.html new file mode 100644 index 0000000..f0020fa --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.block.conditional.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.block.haml b/node_modules/hamljs/test/fixtures/comment.block.haml new file mode 100644 index 0000000..39041ea --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.block.haml @@ -0,0 +1,5 @@ +/ + %ul + %li nope + %li nope + %li nope \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.block.html b/node_modules/hamljs/test/fixtures/comment.block.html new file mode 100644 index 0000000..cfbdcb7 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.block.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.haml b/node_modules/hamljs/test/fixtures/comment.haml new file mode 100644 index 0000000..92d8988 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.haml @@ -0,0 +1,3 @@ +-# nothing +%p yay + -# whatever you want \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.html b/node_modules/hamljs/test/fixtures/comment.html new file mode 100644 index 0000000..76b80fe --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.html @@ -0,0 +1 @@ +

    yay

    diff --git a/node_modules/hamljs/test/fixtures/comment.tag.haml b/node_modules/hamljs/test/fixtures/comment.tag.haml new file mode 100644 index 0000000..880db37 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.tag.haml @@ -0,0 +1 @@ + / %p foo \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.tag.html b/node_modules/hamljs/test/fixtures/comment.tag.html new file mode 100644 index 0000000..1fde28f --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.tag.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.text.complex.haml b/node_modules/hamljs/test/fixtures/comment.text.complex.haml new file mode 100644 index 0000000..187cb4f --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.text.complex.haml @@ -0,0 +1,7 @@ +%ul + %li one + / first item + %li two + / second item + %ul + %li three \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.text.complex.html b/node_modules/hamljs/test/fixtures/comment.text.complex.html new file mode 100644 index 0000000..301aaf7 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.text.complex.html @@ -0,0 +1,5 @@ +
      +
    • one
    • +
    • two
    • +
        +
      • three
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.text.haml b/node_modules/hamljs/test/fixtures/comment.text.haml new file mode 100644 index 0000000..4dfe18d --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.text.haml @@ -0,0 +1,2 @@ +%p + / foo bar baz \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/comment.text.html b/node_modules/hamljs/test/fixtures/comment.text.html new file mode 100644 index 0000000..0d5b7c9 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/comment.text.html @@ -0,0 +1 @@ +

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/context.haml b/node_modules/hamljs/test/fixtures/context.haml new file mode 100644 index 0000000..a22be1c --- /dev/null +++ b/node_modules/hamljs/test/fixtures/context.haml @@ -0,0 +1 @@ +%p= this \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/context.html b/node_modules/hamljs/test/fixtures/context.html new file mode 100644 index 0000000..26c4fe1 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/context.html @@ -0,0 +1 @@ +

    yay

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/cr.haml b/node_modules/hamljs/test/fixtures/cr.haml new file mode 100644 index 0000000..a492ae1 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/cr.haml @@ -0,0 +1 @@ +#foo .bar \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/cr.html b/node_modules/hamljs/test/fixtures/cr.html new file mode 100644 index 0000000..65e61f7 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/cr.html @@ -0,0 +1,3 @@ +
    +
    +
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/crlf.haml b/node_modules/hamljs/test/fixtures/crlf.haml new file mode 100644 index 0000000..7263f27 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/crlf.haml @@ -0,0 +1,2 @@ +#foo + .bar \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/crlf.html b/node_modules/hamljs/test/fixtures/crlf.html new file mode 100644 index 0000000..65e61f7 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/crlf.html @@ -0,0 +1,3 @@ +
    +
    +
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/doctype.haml b/node_modules/hamljs/test/fixtures/doctype.haml new file mode 100644 index 0000000..08faabd --- /dev/null +++ b/node_modules/hamljs/test/fixtures/doctype.haml @@ -0,0 +1 @@ +!!! \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/doctype.html b/node_modules/hamljs/test/fixtures/doctype.html new file mode 100644 index 0000000..f38b71c --- /dev/null +++ b/node_modules/hamljs/test/fixtures/doctype.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/doctype.xml.case.haml b/node_modules/hamljs/test/fixtures/doctype.xml.case.haml new file mode 100644 index 0000000..57e66ca --- /dev/null +++ b/node_modules/hamljs/test/fixtures/doctype.xml.case.haml @@ -0,0 +1 @@ +!!! xml \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/doctype.xml.case.html b/node_modules/hamljs/test/fixtures/doctype.xml.case.html new file mode 100644 index 0000000..3297f54 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/doctype.xml.case.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/doctype.xml.haml b/node_modules/hamljs/test/fixtures/doctype.xml.haml new file mode 100644 index 0000000..3f0fe33 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/doctype.xml.haml @@ -0,0 +1 @@ +!!! XML \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/doctype.xml.html b/node_modules/hamljs/test/fixtures/doctype.xml.html new file mode 100644 index 0000000..3297f54 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/doctype.xml.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/error.haml b/node_modules/hamljs/test/fixtures/error.haml new file mode 100644 index 0000000..c5b0877 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/error.haml @@ -0,0 +1,3 @@ +%html + %body + %p \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/escape.haml b/node_modules/hamljs/test/fixtures/escape.haml new file mode 100644 index 0000000..d226974 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/escape.haml @@ -0,0 +1,2 @@ +%p + \.foo \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/escape.html b/node_modules/hamljs/test/fixtures/escape.html new file mode 100644 index 0000000..a919d0c --- /dev/null +++ b/node_modules/hamljs/test/fixtures/escape.html @@ -0,0 +1 @@ +

    .foo

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/feed.haml b/node_modules/hamljs/test/fixtures/feed.haml new file mode 100644 index 0000000..bc4b080 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/feed.haml @@ -0,0 +1,11 @@ +!!! xml +%rss{ version: '2.0' } + %channel + %title ExpressJS + %link http://expressjs.com + %description Is super cool + %language en-us + %item + %title Creating Routes + %description Some stuff + %link http://expressjs.com/routes \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/feed.xml b/node_modules/hamljs/test/fixtures/feed.xml new file mode 100644 index 0000000..6e0633d --- /dev/null +++ b/node_modules/hamljs/test/fixtures/feed.xml @@ -0,0 +1,11 @@ + + + +ExpressJS +http://expressjs.com +Is super cool +en-us + +Creating Routes +Some stuff +http://expressjs.com/routes \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.cdata.haml b/node_modules/hamljs/test/fixtures/filter.cdata.haml new file mode 100644 index 0000000..ede8c5b --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.cdata.haml @@ -0,0 +1,3 @@ +%script + :cdata + foo \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.cdata.html b/node_modules/hamljs/test/fixtures/filter.cdata.html new file mode 100644 index 0000000..8cefa09 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.cdata.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.cdata.whitespace.haml b/node_modules/hamljs/test/fixtures/filter.cdata.whitespace.haml new file mode 100644 index 0000000..30db588 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.cdata.whitespace.haml @@ -0,0 +1,7 @@ +%script + :cdata + $(function(){ + if (foo) + if (bar) + alert('yay') + }) \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.cdata.whitespace.html b/node_modules/hamljs/test/fixtures/filter.cdata.whitespace.html new file mode 100644 index 0000000..c09bdd9 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.cdata.whitespace.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.javascript.haml b/node_modules/hamljs/test/fixtures/filter.javascript.haml new file mode 100644 index 0000000..6a4fb39 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.javascript.haml @@ -0,0 +1,8 @@ +%head + :javascript + if (foo) + if (bar) + alert("baz") + foo() + bar() + %title Yay \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.javascript.html b/node_modules/hamljs/test/fixtures/filter.javascript.html new file mode 100644 index 0000000..62eefe2 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.javascript.html @@ -0,0 +1,9 @@ + +Yay \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.plain.haml b/node_modules/hamljs/test/fixtures/filter.plain.haml new file mode 100644 index 0000000..3d70c5d --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.plain.haml @@ -0,0 +1,5 @@ +%body + :plain + .foo + bar + = baz \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/filter.plain.html b/node_modules/hamljs/test/fixtures/filter.plain.html new file mode 100644 index 0000000..d2b9084 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/filter.plain.html @@ -0,0 +1,3 @@ +.foo +bar += baz \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/html.haml b/node_modules/hamljs/test/fixtures/html.haml new file mode 100644 index 0000000..a516e3c --- /dev/null +++ b/node_modules/hamljs/test/fixtures/html.haml @@ -0,0 +1,2 @@ +%div +

    literal

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/html.html b/node_modules/hamljs/test/fixtures/html.html new file mode 100644 index 0000000..cf23b5b --- /dev/null +++ b/node_modules/hamljs/test/fixtures/html.html @@ -0,0 +1 @@ +

    literal

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/id.haml b/node_modules/hamljs/test/fixtures/id.haml new file mode 100644 index 0000000..f2c7c82 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/id.haml @@ -0,0 +1 @@ +#users \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/id.html b/node_modules/hamljs/test/fixtures/id.html new file mode 100644 index 0000000..c0171e2 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/id.html @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/issue.#10.haml b/node_modules/hamljs/test/fixtures/issue.#10.haml new file mode 100644 index 0000000..d6a16e3 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/issue.#10.haml @@ -0,0 +1 @@ +%label{ for: "forsomething"} \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/issue.#10.html b/node_modules/hamljs/test/fixtures/issue.#10.html new file mode 100644 index 0000000..c3e1e61 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/issue.#10.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/issue.#8.haml b/node_modules/hamljs/test/fixtures/issue.#8.haml new file mode 100644 index 0000000..6611716 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/issue.#8.haml @@ -0,0 +1,4 @@ +%ul + - each item in items + %li= item +%p= "Total: " + items.length \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/issue.#8.html b/node_modules/hamljs/test/fixtures/issue.#8.html new file mode 100644 index 0000000..b0d3442 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/issue.#8.html @@ -0,0 +1,5 @@ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    +

    Total: 3

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/literals.haml b/node_modules/hamljs/test/fixtures/literals.haml new file mode 100644 index 0000000..8ddd574 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/literals.haml @@ -0,0 +1 @@ +%p= user \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/literals.html b/node_modules/hamljs/test/fixtures/literals.html new file mode 100644 index 0000000..ab8d4e5 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/literals.html @@ -0,0 +1 @@ +

    tj

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/namespace.haml b/node_modules/hamljs/test/fixtures/namespace.haml new file mode 100644 index 0000000..45fbdb6 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/namespace.haml @@ -0,0 +1 @@ +%h:table{ 'xmlns:h': 'http://www.w3.org/1999/xhtml' } \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/namespace.tag.haml b/node_modules/hamljs/test/fixtures/namespace.tag.haml new file mode 100644 index 0000000..ab6f9b2 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/namespace.tag.haml @@ -0,0 +1,5 @@ +%body + %fb:test.a + %fb:bar + %fb:foo{ title: 'home' } + %fb:login-button diff --git a/node_modules/hamljs/test/fixtures/namespace.tag.html b/node_modules/hamljs/test/fixtures/namespace.tag.html new file mode 100644 index 0000000..a5db0c0 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/namespace.tag.html @@ -0,0 +1,5 @@ + + + + + diff --git a/node_modules/hamljs/test/fixtures/namespace.xml b/node_modules/hamljs/test/fixtures/namespace.xml new file mode 100644 index 0000000..8d1888a --- /dev/null +++ b/node_modules/hamljs/test/fixtures/namespace.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/nesting.complex.haml b/node_modules/hamljs/test/fixtures/nesting.complex.haml new file mode 100644 index 0000000..b3bc8cc --- /dev/null +++ b/node_modules/hamljs/test/fixtures/nesting.complex.haml @@ -0,0 +1,6 @@ +%html + %head + %title Page Title + %body + %h1 Title + %p some stuff \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/nesting.complex.html b/node_modules/hamljs/test/fixtures/nesting.complex.html new file mode 100644 index 0000000..b6eb8b5 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/nesting.complex.html @@ -0,0 +1,6 @@ + + +Page Title + +

    Title

    +

    some stuff

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/nesting.simple.haml b/node_modules/hamljs/test/fixtures/nesting.simple.haml new file mode 100644 index 0000000..7a91ed3 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/nesting.simple.haml @@ -0,0 +1,6 @@ +%ul + %li one + %li two + %li + %ul + %li three \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/nesting.simple.html b/node_modules/hamljs/test/fixtures/nesting.simple.html new file mode 100644 index 0000000..50544e2 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/nesting.simple.html @@ -0,0 +1,6 @@ +
      +
    • one
    • +
    • two
    • +
    • +
        +
      • three
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/newlines.haml b/node_modules/hamljs/test/fixtures/newlines.haml new file mode 100644 index 0000000..b087e44 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/newlines.haml @@ -0,0 +1,12 @@ +%ul + %li one + %li two + %li three + %li + %ul + %li four + +%p foo +%p + bar + baz \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/newlines.html b/node_modules/hamljs/test/fixtures/newlines.html new file mode 100644 index 0000000..5beb1f9 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/newlines.html @@ -0,0 +1,9 @@ +
      +
    • one
    • +
    • two
    • +
    • three
    • +
    • +
        +
      • four
    +

    foo

    +

    bar baz

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/newlines.within-tags.haml b/node_modules/hamljs/test/fixtures/newlines.within-tags.haml new file mode 100644 index 0000000..1bd14f1 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/newlines.within-tags.haml @@ -0,0 +1,4 @@ +%head + %title + + tabineko diff --git a/node_modules/hamljs/test/fixtures/newlines.within-tags.html b/node_modules/hamljs/test/fixtures/newlines.within-tags.html new file mode 100644 index 0000000..c6c2018 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/newlines.within-tags.html @@ -0,0 +1,2 @@ + +tabineko diff --git a/node_modules/hamljs/test/fixtures/string.complex-interpolation.haml b/node_modules/hamljs/test/fixtures/string.complex-interpolation.haml new file mode 100644 index 0000000..6bdf204 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/string.complex-interpolation.haml @@ -0,0 +1 @@ +%p yay #{message + " {oh noes} y u do dis to me"} diff --git a/node_modules/hamljs/test/fixtures/string.complex-interpolation.html b/node_modules/hamljs/test/fixtures/string.complex-interpolation.html new file mode 100644 index 0000000..61a2d3f --- /dev/null +++ b/node_modules/hamljs/test/fixtures/string.complex-interpolation.html @@ -0,0 +1 @@ +

    yay it works! {oh noes} y u do dis to me

    diff --git a/node_modules/hamljs/test/fixtures/string.interpolation.haml b/node_modules/hamljs/test/fixtures/string.interpolation.haml new file mode 100644 index 0000000..62a7ac6 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/string.interpolation.haml @@ -0,0 +1 @@ +%p yay #{message} diff --git a/node_modules/hamljs/test/fixtures/string.interpolation.html b/node_modules/hamljs/test/fixtures/string.interpolation.html new file mode 100644 index 0000000..50df91a --- /dev/null +++ b/node_modules/hamljs/test/fixtures/string.interpolation.html @@ -0,0 +1 @@ +

    yay it works!

    diff --git a/node_modules/hamljs/test/fixtures/tag.attrs.bools.haml b/node_modules/hamljs/test/fixtures/tag.attrs.bools.haml new file mode 100644 index 0000000..7e0dc4f --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.attrs.bools.haml @@ -0,0 +1 @@ +%input{ type: 'checkbox', checked: true } \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.attrs.bools.html b/node_modules/hamljs/test/fixtures/tag.attrs.bools.html new file mode 100644 index 0000000..84416da --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.attrs.bools.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.attrs.escape.haml b/node_modules/hamljs/test/fixtures/tag.attrs.escape.haml new file mode 100644 index 0000000..b9f40e1 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.attrs.escape.haml @@ -0,0 +1 @@ +%option{ value: '' } \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.attrs.escape.html b/node_modules/hamljs/test/fixtures/tag.attrs.escape.html new file mode 100644 index 0000000..a958f38 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.attrs.escape.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.attrs.haml b/node_modules/hamljs/test/fixtures/tag.attrs.haml new file mode 100644 index 0000000..84d2729 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.attrs.haml @@ -0,0 +1 @@ +%a{ href: '/', title: 'home' } \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.attrs.html b/node_modules/hamljs/test/fixtures/tag.attrs.html new file mode 100644 index 0000000..2f8ca31 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.attrs.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.class.attribute.haml b/node_modules/hamljs/test/fixtures/tag.class.attribute.haml new file mode 100644 index 0000000..4def5eb --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.class.attribute.haml @@ -0,0 +1 @@ +%h1.title{ class: "red" } diff --git a/node_modules/hamljs/test/fixtures/tag.class.attribute.html b/node_modules/hamljs/test/fixtures/tag.class.attribute.html new file mode 100644 index 0000000..c3869bc --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.class.attribute.html @@ -0,0 +1 @@ +

    diff --git a/node_modules/hamljs/test/fixtures/tag.class.haml b/node_modules/hamljs/test/fixtures/tag.class.haml new file mode 100644 index 0000000..66dbc04 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.class.haml @@ -0,0 +1 @@ +%h1.title \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.class.html b/node_modules/hamljs/test/fixtures/tag.class.html new file mode 100644 index 0000000..101bb29 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.class.html @@ -0,0 +1 @@ +

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.classes.haml b/node_modules/hamljs/test/fixtures/tag.classes.haml new file mode 100644 index 0000000..61a79a6 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.classes.haml @@ -0,0 +1 @@ +%body.front-page.editing-user \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.classes.html b/node_modules/hamljs/test/fixtures/tag.classes.html new file mode 100644 index 0000000..173556e --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.classes.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.code.haml b/node_modules/hamljs/test/fixtures/tag.code.haml new file mode 100644 index 0000000..679e61c --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.code.haml @@ -0,0 +1 @@ +%div= "yay" \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.code.html b/node_modules/hamljs/test/fixtures/tag.code.html new file mode 100644 index 0000000..b3d55fc --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.code.html @@ -0,0 +1 @@ +
    yay
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.code.no-escape.haml b/node_modules/hamljs/test/fixtures/tag.code.no-escape.haml new file mode 100644 index 0000000..f092e67 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.code.no-escape.haml @@ -0,0 +1 @@ +%div!= "
    " \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.code.no-escape.html b/node_modules/hamljs/test/fixtures/tag.code.no-escape.html new file mode 100644 index 0000000..2c2ec7a --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.code.no-escape.html @@ -0,0 +1 @@ +

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.complex.haml b/node_modules/hamljs/test/fixtures/tag.complex.haml new file mode 100644 index 0000000..307f672 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.complex.haml @@ -0,0 +1 @@ +%a#delete-user.first.button{ href: '/', title: 'Click to delete' }= "Delete " + "tj" \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.complex.html b/node_modules/hamljs/test/fixtures/tag.complex.html new file mode 100644 index 0000000..4ddee81 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.complex.html @@ -0,0 +1 @@ +Delete tj \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.empty.haml b/node_modules/hamljs/test/fixtures/tag.empty.haml new file mode 100644 index 0000000..fdfb6cb --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.empty.haml @@ -0,0 +1,7 @@ +%body + %div.a + %div.b + .c + .d + #e + #f \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.empty.html b/node_modules/hamljs/test/fixtures/tag.empty.html new file mode 100644 index 0000000..ddc05d3 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.empty.html @@ -0,0 +1,7 @@ + +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.escape.haml b/node_modules/hamljs/test/fixtures/tag.escape.haml new file mode 100644 index 0000000..d33a301 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.escape.haml @@ -0,0 +1 @@ +%div= "
    " \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.escape.html b/node_modules/hamljs/test/fixtures/tag.escape.html new file mode 100644 index 0000000..5b703e7 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.escape.html @@ -0,0 +1 @@ +
    <br/>
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.self-close.haml b/node_modules/hamljs/test/fixtures/tag.self-close.haml new file mode 100644 index 0000000..63096c9 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.self-close.haml @@ -0,0 +1 @@ +%br \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.self-close.html b/node_modules/hamljs/test/fixtures/tag.self-close.html new file mode 100644 index 0000000..4bbea23 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.self-close.html @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.simple.haml b/node_modules/hamljs/test/fixtures/tag.simple.haml new file mode 100644 index 0000000..20d531e --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.simple.haml @@ -0,0 +1 @@ +%div \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.simple.html b/node_modules/hamljs/test/fixtures/tag.simple.html new file mode 100644 index 0000000..281c686 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.simple.html @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.text.block.complex.haml b/node_modules/hamljs/test/fixtures/tag.text.block.complex.haml new file mode 100644 index 0000000..cc55e16 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.text.block.complex.haml @@ -0,0 +1,5 @@ +%p + Visit + %a{ href: 'http://vision-media.ca' } Vision Media + because im amazing, + yes... \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.text.block.complex.html b/node_modules/hamljs/test/fixtures/tag.text.block.complex.html new file mode 100644 index 0000000..07c2b6b --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.text.block.complex.html @@ -0,0 +1,2 @@ +

    Visit +Vision Mediabecause im amazing, yes...

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.text.block.haml b/node_modules/hamljs/test/fixtures/tag.text.block.haml new file mode 100644 index 0000000..20c5bcf --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.text.block.haml @@ -0,0 +1,5 @@ +%p + some text + and more text + and even more text! + OMG \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.text.block.html b/node_modules/hamljs/test/fixtures/tag.text.block.html new file mode 100644 index 0000000..e02ce19 --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.text.block.html @@ -0,0 +1 @@ +

    some text and more text and even more text! OMG

    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.text.haml b/node_modules/hamljs/test/fixtures/tag.text.haml new file mode 100644 index 0000000..8718f9a --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.text.haml @@ -0,0 +1 @@ +%div some text \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/tag.text.html b/node_modules/hamljs/test/fixtures/tag.text.html new file mode 100644 index 0000000..e64083b --- /dev/null +++ b/node_modules/hamljs/test/fixtures/tag.text.html @@ -0,0 +1 @@ +
    some text
    \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/trailing-indent.haml b/node_modules/hamljs/test/fixtures/trailing-indent.haml new file mode 100644 index 0000000..1e118cd --- /dev/null +++ b/node_modules/hamljs/test/fixtures/trailing-indent.haml @@ -0,0 +1,4 @@ +%a + %b + + \ No newline at end of file diff --git a/node_modules/hamljs/test/fixtures/trailing-indent.html b/node_modules/hamljs/test/fixtures/trailing-indent.html new file mode 100644 index 0000000..094e68b --- /dev/null +++ b/node_modules/hamljs/test/fixtures/trailing-indent.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/node_modules/hamljs/test/test.js b/node_modules/hamljs/test/test.js new file mode 100644 index 0000000..bd1497c --- /dev/null +++ b/node_modules/hamljs/test/test.js @@ -0,0 +1,366 @@ +'use strict'; + +var fs = require('fs'); +var haml = require('../lib/haml'); + +describe('haml', function () { + describe('.version', function () { + it('should be a triplet', function () { + haml.version.should.match(/^\d+\.\d+\.\d+$/); + }); + }); + + describe('.compile()', function () { + it('should return a function', function () { + var fn = haml.compile('%foo= bar'); + fn({ bar: 'baz' }).should.equal('\nbaz'); + }); + }); + + describe('Parser', function () { + it('should be available for extension', function () { + haml.Parser.should.not.equal(undefined); + }); + }); + + describe('.renderFile()', function () { + it('should render the given file', function (done) { + haml.renderFile(__dirname + '/fixtures/class.haml', 'utf8', {}, function (err, html) { + html = html.trim() + var expected = fs.readFileSync(__dirname + '/fixtures/class.html').toString() + + console.log(JSON.stringify(html), JSON.stringify(expected)) + html.should.equal(expected) + + done() + }); + }); + }); + + describe('.render()', function () { + var assertAs, assert, assertXML; + + // Prepare helper functions + before(function () { + assertAs = function(name, type, options) { + var str = fs.readFileSync(__dirname + '/fixtures/' + name + '.haml').toString(); + try { + var html = haml.render(str, options).trim(); + var expected = fs.readFileSync(__dirname + '/fixtures/' + name + '.' + type).toString().trim(); + html.should.equal(expected); + } catch (err) { + throw err; + } + }; + assert = function(name, options) { + assertAs(name, 'html', options, 'CRLF', '\r\n'); + }; + assertXML = function(name, options) { + assertAs(name, 'xml', options, 'CRLF', '\r\n'); + }; + }); + + it('should allow passing of a context object', function () { + assert('context', { context: 'yay' }); + }); + + it('should allow passing of literals', function () { + assert('literals', { locals: { user: 'tj' }}); + }); + + it('should not fail on trailing indents', function () { + assert('trailing-indent'); + }); + + it('should add xml support via the "xml" option', function () { + assertXML('feed', { xml: true }); + }); + + it('should support xml namespaces', function () { + assertXML('namespace'); + }); + + it('should utilize "filename" option when an error is thrown', function () { + try { assert('error', { filename: 'error.haml' }); } + catch (err) { + err.message.should.eql('(error.haml):3 invalid indentation; got 3, when previous was 1'); + } + }); + + it('should default filename to "Haml" when an error is thrown', function () { + try { assert('error'); } + catch (err) { + err.message.should.eql('(Haml):3 invalid indentation; got 3, when previous was 1'); + } + }); + + it('should bitch when "cache" is true without a filename given', function () { + // -{ assert('tag.simple', { cache: true }) }.should.throw_error + }); + + it('should pre-compiled and cache when "cache" is true', function () { + assert('tag.simple', { cache: true, filename: 'tag.simple.haml' }); + assert('tag.simple', { cache: true, filename: 'tag.simple.haml' }); + }); + + describe('\\n', function () { + it('should support blank lines', function () { + assert('newlines'); + }); + + it('should support blank lines within tags', function () { + assert('newlines.within-tags'); + }); + }); + + describe('.class', function () { + it('should output a div with the given class', function () { + assert('class'); + }); + + it('should work with several classes', function () { + assert('classes'); + }); + }); + + describe('#id', function () { + it('should output a div with the given id', function () { + assert('id'); + }); + }); + + describe('%tag', function () { + it('should work with no text or block', function () { + assert('tag.simple'); + }); + + it('should work with text', function () { + assert('tag.text'); + }); + + it('should work with block text', function () { + assert('tag.text.block'); + }); + + it('should work with blocks of text and tags', function () { + assert('tag.text.block.complex'); + }); + + it('should work with many classes / ids / attrs', function () { + assert('tag.complex'); + }); + + it('should allow empty tags', function () { + assert('tag.empty'); + }); + }); + + describe('%tag.class', function () { + it('should output tag with a class', function () { + assert('tag.class'); + }); + + it('should work with several classes', function () { + assert('tag.classes'); + }); + + it('should work with both .class and class=\'another-class\'', function () { + assert('tag.class.attribute'); + }); + + it('should support self-closing tags', function () { + assert('tag.self-close'); + }); + }); + + describe('%tag!=', function () { + it('should output the evaluated code', function () { + assert('tag.code'); + }); + + it('should not escape output', function () { + assert('tag.code.no-escape'); + }); + }); + + describe('%tag=', function () { + it('should escape the evaluated code', function () { + assert('tag.escape'); + }); + }); + + describe('%namespace:tag', function () { + it('should output a tag with a namespace prefix', function () { + assert('namespace.tag'); + }); + }); + + describe('{...}', function () { + it('should be mapped as html attributes', function () { + assert('tag.attrs'); + }); + + it('should escape values', function () { + assert('tag.attrs.escape'); + }); + + it('should allow booleans', function () { + assert('tag.attrs.bools'); + }); + }); + + describe('!!!', function () { + it('should default the doctype to 1.0 transitional', function () { + assert('doctype'); + }); + }); + + describe('!!! NAME', function () { + it('should output a specific doctype', function () { + assert('doctype.xml'); + }); + + it('should be case-insensitive', function () { + assert('doctype.xml.case'); + }); + }); + + describe('nesting', function () { + it('should work when nested downwards', function () { + assert('nesting.simple'); + }); + + it('should work when blocks outdent', function () { + assert('nesting.complex'); + }); + }); + + describe('- code', function () { + it('should work with if statements', function () { + assert('code.if'); + }); + + it('should work with if / else statements', function () { + assert('code.if.else'); + }); + + it('should work when nested', function () { + assert('code.nested'); + }); + }); + + describe('- each', function () { + it('should iterate', function () { + assert('code.each', { locals: { items: ['one', 'two', 'three'] }}); + assert('code.each.non-enumerable', { locals: { items: null }}); + }); + + it('should iterate objects', function () { + assert('code.each', { locals: { items: { 0: 'one', 1: 'two', 2: 'three' }}}); + assert('code.each.index', { locals: { items: { 0: 'one', 1: 'two', 2: 'three' }}}); + }); + + it('should iterate with index', function () { + assert('code.each.index', { locals: { items: ['one', 'two', 'three'] }}); + }); + }); + + describe('= code', function () { + it('should output evaluation', function () { + assert('code'); + }); + }); + + describe('&= code', function () { + it('should output evaluation while escaping html entities', function () { + assert('code.escape'); + }); + }); + + describe('', function () { + it('should remain intact', function () { + assert('html'); + }); + }); + + describe('\\char', function () { + it('should escape the character', function () { + assert('escape'); + }); + }); + + describe('#{}', function () { + it('should interpolate strings', function () { + assert('string.interpolation', { locals: { message: 'it works!' } }); + }); + + it('should interpolate strings (complex)', function () { + assert('string.complex-interpolation', { locals: { message: 'it works!' } }); + }); + }); + + describe('-#', function () { + it('should become a silent comment', function () { + assert('comment'); + }); + }); + + describe('/', function () { + it('should comment out tags', function () { + assert('comment.tag'); + }); + + it('should comment out blocks', function () { + assert('comment.block'); + }); + + it('should comment out text', function () { + assert('comment.text'); + }); + + it('should work in blocks', function () { + assert('comment.text.complex'); + }); + }); + + describe('/[]', function () { + it('should insert conditional comment blocks', function () { + assert('comment.block.conditional'); + }); + }); + + describe(':filter', function () { + describe('plain', function () { + it('should ignore haml specific characters', function () { + assert('filter.plain'); + }); + }); + + describe('cdata', function () { + it('should wrap with CDATA tags', function () { + assert('filter.cdata'); + }); + + it('should retain whitespace', function () { + assert('filter.cdata.whitespace'); + }); + }); + + describe('javascript', function () { + it('should wrap with `. + this.sequenceIndex = Number(c === 60 /* Lt */); + } + }; + Tokenizer.prototype.stateCDATASequence = function (c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this._state = 21 /* InCommentLike */; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this._index + 1; + } + } + else { + this.sequenceIndex = 0; + this._state = 16 /* InDeclaration */; + this.stateInDeclaration(c); // Reconsume the character + } + }; + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + Tokenizer.prototype.fastForwardTo = function (c) { + while (++this._index < this.buffer.length) { + if (this.buffer.charCodeAt(this._index) === c) { + return true; + } + } + /* + * We increment the index at the end of the `parse` loop, + * so set it to `buffer.length - 1` here. + * + * TODO: Refactor `parse` to increment index before calling states. + */ + this._index = this.buffer.length - 1; + return false; + }; + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + Tokenizer.prototype.stateInCommentLike = function (c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + // Remove 2 trailing chars + var section = this.buffer.slice(this.sectionStart, this._index - 2); + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(section); + } + else { + this.cbs.oncomment(section); + } + this.sequenceIndex = 0; + this.sectionStart = this._index + 1; + this._state = 1 /* Text */; + } + } + else if (this.sequenceIndex === 0) { + // Fast-forward to the first character of the sequence + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } + else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + // Allow long sequences, eg. --->, ]]]> + this.sequenceIndex = 0; + } + }; + /** + * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name. + * + * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar). + * We allow anything that wouldn't end the tag. + */ + Tokenizer.prototype.isTagStartChar = function (c) { + return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c); + }; + Tokenizer.prototype.startSpecial = function (sequence, offset) { + this.isSpecial = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + this._state = 23 /* SpecialStartSequence */; + }; + Tokenizer.prototype.stateBeforeTagName = function (c) { + if (c === 33 /* ExclamationMark */) { + this._state = 15 /* BeforeDeclaration */; + this.sectionStart = this._index + 1; + } + else if (c === 63 /* Questionmark */) { + this._state = 17 /* InProcessingInstruction */; + this.sectionStart = this._index + 1; + } + else if (this.isTagStartChar(c)) { + var lower = c | 0x20; + this.sectionStart = this._index; + if (!this.xmlMode && lower === Sequences.TitleEnd[2]) { + this.startSpecial(Sequences.TitleEnd, 3); + } + else { + this._state = + !this.xmlMode && lower === Sequences.ScriptEnd[2] + ? 22 /* BeforeSpecialS */ + : 3 /* InTagName */; + } + } + else if (c === 47 /* Slash */) { + this._state = 5 /* BeforeClosingTagName */; + } + else { + this._state = 1 /* Text */; + this.stateText(c); + } + }; + Tokenizer.prototype.stateInTagName = function (c) { + if (isEndOfTagSection(c)) { + this.cbs.onopentagname(this.getSection()); + this.sectionStart = -1; + this._state = 8 /* BeforeAttributeName */; + this.stateBeforeAttributeName(c); + } + }; + Tokenizer.prototype.stateBeforeClosingTagName = function (c) { + if (isWhitespace(c)) { + // Ignore + } + else if (c === 62 /* Gt */) { + this._state = 1 /* Text */; + } + else { + this._state = this.isTagStartChar(c) + ? 6 /* InClosingTagName */ + : 20 /* InSpecialComment */; + this.sectionStart = this._index; + } + }; + Tokenizer.prototype.stateInClosingTagName = function (c) { + if (c === 62 /* Gt */ || isWhitespace(c)) { + this.cbs.onclosetag(this.getSection()); + this.sectionStart = -1; + this._state = 7 /* AfterClosingTagName */; + this.stateAfterClosingTagName(c); + } + }; + Tokenizer.prototype.stateAfterClosingTagName = function (c) { + // Skip everything until ">" + if (c === 62 /* Gt */ || this.fastForwardTo(62 /* Gt */)) { + this._state = 1 /* Text */; + this.sectionStart = this._index + 1; + } + }; + Tokenizer.prototype.stateBeforeAttributeName = function (c) { + if (c === 62 /* Gt */) { + this.cbs.onopentagend(); + if (this.isSpecial) { + this._state = 24 /* InSpecialTag */; + this.sequenceIndex = 0; + } + else { + this._state = 1 /* Text */; + } + this.baseState = this._state; + this.sectionStart = this._index + 1; + } + else if (c === 47 /* Slash */) { + this._state = 4 /* InSelfClosingTag */; + } + else if (!isWhitespace(c)) { + this._state = 9 /* InAttributeName */; + this.sectionStart = this._index; + } + }; + Tokenizer.prototype.stateInSelfClosingTag = function (c) { + if (c === 62 /* Gt */) { + this.cbs.onselfclosingtag(); + this._state = 1 /* Text */; + this.baseState = 1 /* Text */; + this.sectionStart = this._index + 1; + this.isSpecial = false; // Reset special state, in case of self-closing special tags + } + else if (!isWhitespace(c)) { + this._state = 8 /* BeforeAttributeName */; + this.stateBeforeAttributeName(c); + } + }; + Tokenizer.prototype.stateInAttributeName = function (c) { + if (c === 61 /* Eq */ || isEndOfTagSection(c)) { + this.cbs.onattribname(this.getSection()); + this.sectionStart = -1; + this._state = 10 /* AfterAttributeName */; + this.stateAfterAttributeName(c); + } + }; + Tokenizer.prototype.stateAfterAttributeName = function (c) { + if (c === 61 /* Eq */) { + this._state = 11 /* BeforeAttributeValue */; + } + else if (c === 47 /* Slash */ || c === 62 /* Gt */) { + this.cbs.onattribend(undefined); + this._state = 8 /* BeforeAttributeName */; + this.stateBeforeAttributeName(c); + } + else if (!isWhitespace(c)) { + this.cbs.onattribend(undefined); + this._state = 9 /* InAttributeName */; + this.sectionStart = this._index; + } + }; + Tokenizer.prototype.stateBeforeAttributeValue = function (c) { + if (c === 34 /* DoubleQuote */) { + this._state = 12 /* InAttributeValueDq */; + this.sectionStart = this._index + 1; + } + else if (c === 39 /* SingleQuote */) { + this._state = 13 /* InAttributeValueSq */; + this.sectionStart = this._index + 1; + } + else if (!isWhitespace(c)) { + this.sectionStart = this._index; + this._state = 14 /* InAttributeValueNq */; + this.stateInAttributeValueNoQuotes(c); // Reconsume token + } + }; + Tokenizer.prototype.handleInAttributeValue = function (c, quote) { + if (c === quote || + (!this.decodeEntities && this.fastForwardTo(quote))) { + this.cbs.onattribdata(this.getSection()); + this.sectionStart = -1; + this.cbs.onattribend(String.fromCharCode(quote)); + this._state = 8 /* BeforeAttributeName */; + } + else if (this.decodeEntities && c === 38 /* Amp */) { + this.baseState = this._state; + this._state = 25 /* BeforeEntity */; + } + }; + Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) { + this.handleInAttributeValue(c, 34 /* DoubleQuote */); + }; + Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) { + this.handleInAttributeValue(c, 39 /* SingleQuote */); + }; + Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) { + if (isWhitespace(c) || c === 62 /* Gt */) { + this.cbs.onattribdata(this.getSection()); + this.sectionStart = -1; + this.cbs.onattribend(null); + this._state = 8 /* BeforeAttributeName */; + this.stateBeforeAttributeName(c); + } + else if (this.decodeEntities && c === 38 /* Amp */) { + this.baseState = this._state; + this._state = 25 /* BeforeEntity */; + } + }; + Tokenizer.prototype.stateBeforeDeclaration = function (c) { + if (c === 91 /* OpeningSquareBracket */) { + this._state = 19 /* CDATASequence */; + this.sequenceIndex = 0; + } + else { + this._state = + c === 45 /* Dash */ + ? 18 /* BeforeComment */ + : 16 /* InDeclaration */; + } + }; + Tokenizer.prototype.stateInDeclaration = function (c) { + if (c === 62 /* Gt */ || this.fastForwardTo(62 /* Gt */)) { + this.cbs.ondeclaration(this.getSection()); + this._state = 1 /* Text */; + this.sectionStart = this._index + 1; + } + }; + Tokenizer.prototype.stateInProcessingInstruction = function (c) { + if (c === 62 /* Gt */ || this.fastForwardTo(62 /* Gt */)) { + this.cbs.onprocessinginstruction(this.getSection()); + this._state = 1 /* Text */; + this.sectionStart = this._index + 1; + } + }; + Tokenizer.prototype.stateBeforeComment = function (c) { + if (c === 45 /* Dash */) { + this._state = 21 /* InCommentLike */; + this.currentSequence = Sequences.CommentEnd; + // Allow short comments (eg. ) + this.sequenceIndex = 2; + this.sectionStart = this._index + 1; + } + else { + this._state = 16 /* InDeclaration */; + } + }; + Tokenizer.prototype.stateInSpecialComment = function (c) { + if (c === 62 /* Gt */ || this.fastForwardTo(62 /* Gt */)) { + this.cbs.oncomment(this.getSection()); + this._state = 1 /* Text */; + this.sectionStart = this._index + 1; + } + }; + Tokenizer.prototype.stateBeforeSpecialS = function (c) { + var lower = c | 0x20; + if (lower === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } + else if (lower === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); + } + else { + this._state = 3 /* InTagName */; + this.stateInTagName(c); // Consume the token again + } + }; + Tokenizer.prototype.stateBeforeEntity = function (c) { + // Start excess with 1 to include the '&' + this.entityExcess = 1; + if (c === 35 /* Num */) { + this._state = 26 /* BeforeNumericEntity */; + } + else if (c === 38 /* Amp */) { + // We have two `&` characters in a row. Stay in the current state. + } + else { + this.trieIndex = 0; + this.trieCurrent = this.entityTrie[0]; + this.trieResult = null; + this._state = 27 /* InNamedEntity */; + this.stateInNamedEntity(c); + } + }; + Tokenizer.prototype.stateInNamedEntity = function (c) { + this.entityExcess += 1; + this.trieIndex = (0, decode_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c); + if (this.trieIndex < 0) { + this.emitNamedEntity(); + this._index--; + return; + } + this.trieCurrent = this.entityTrie[this.trieIndex]; + // If the branch is a value, store it and continue + if (this.trieCurrent & decode_1.BinTrieFlags.HAS_VALUE) { + // If we have a legacy entity while parsing strictly, just skip the number of bytes + if (!this.allowLegacyEntity() && c !== 59 /* Semi */) { + // No need to consider multi-byte values, as the legacy entity is always a single byte + this.trieIndex += 1; + } + else { + // Add 1 as we have already incremented the excess + var entityStart = this._index - this.entityExcess + 1; + if (entityStart > this.sectionStart) { + this.emitPartial(this.buffer.substring(this.sectionStart, entityStart)); + } + // If this is a surrogate pair, combine the higher bits from the node with the next byte + this.trieResult = + this.trieCurrent & decode_1.BinTrieFlags.MULTI_BYTE + ? String.fromCharCode(this.entityTrie[++this.trieIndex], this.entityTrie[++this.trieIndex]) + : String.fromCharCode(this.entityTrie[++this.trieIndex]); + this.entityExcess = 0; + this.sectionStart = this._index + 1; + } + } + }; + Tokenizer.prototype.emitNamedEntity = function () { + if (this.trieResult) { + this.emitPartial(this.trieResult); + } + this._state = this.baseState; + }; + Tokenizer.prototype.stateBeforeNumericEntity = function (c) { + if ((c | 0x20) === 120 /* LowerX */) { + this.entityExcess++; + this._state = 29 /* InHexEntity */; + } + else { + this._state = 28 /* InNumericEntity */; + this.stateInNumericEntity(c); + } + }; + Tokenizer.prototype.decodeNumericEntity = function (base, strict) { + var entityStart = this._index - this.entityExcess - 1; + var numberStart = entityStart + 2 + (base >> 4); + if (numberStart !== this._index) { + // Emit leading data if any + if (entityStart > this.sectionStart) { + this.emitPartial(this.buffer.substring(this.sectionStart, entityStart)); + } + // Parse entity + var entity = this.buffer.substring(numberStart, this._index); + var parsed = parseInt(entity, base); + this.emitPartial((0, decode_codepoint_1.default)(parsed)); + this.sectionStart = this._index + Number(strict); + } + this._state = this.baseState; + }; + Tokenizer.prototype.stateInNumericEntity = function (c) { + if (c === 59 /* Semi */) { + this.decodeNumericEntity(10, true); + } + else if (!isNumber(c)) { + if (this.allowLegacyEntity()) { + this.decodeNumericEntity(10, false); + } + else { + this._state = this.baseState; + } + this._index--; + } + else { + this.entityExcess++; + } + }; + Tokenizer.prototype.stateInHexEntity = function (c) { + if (c === 59 /* Semi */) { + this.decodeNumericEntity(16, true); + } + else if ((c < 97 /* LowerA */ || c > 102 /* LowerF */) && + (c < 65 /* UpperA */ || c > 70 /* UpperF */) && + !isNumber(c)) { + if (this.allowLegacyEntity()) { + this.decodeNumericEntity(16, false); + } + else { + this._state = this.baseState; + } + this._index--; + } + else { + this.entityExcess++; + } + }; + Tokenizer.prototype.allowLegacyEntity = function () { + return (!this.xmlMode && + (this.baseState === 1 /* Text */ || + this.baseState === 24 /* InSpecialTag */)); + }; + /** + * Remove data that has already been consumed from the buffer. + */ + Tokenizer.prototype.cleanup = function () { + // If we are inside of text, emit what we already have. + if (this.running && + this.sectionStart !== this._index && + (this._state === 1 /* Text */ || + (this._state === 24 /* InSpecialTag */ && + this.sequenceIndex === 0))) { + // TODO: We could emit attribute data here as well. + this.cbs.ontext(this.buffer.substr(this.sectionStart)); + this.sectionStart = this._index; + } + var start = this.sectionStart < 0 ? this._index : this.sectionStart; + this.buffer = + start === this.buffer.length ? "" : this.buffer.substr(start); + this._index -= start; + this.bufferOffset += start; + if (this.sectionStart > 0) { + this.sectionStart = 0; + } + }; + Tokenizer.prototype.shouldContinue = function () { + return this._index < this.buffer.length && this.running; + }; + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + Tokenizer.prototype.parse = function () { + while (this.shouldContinue()) { + var c = this.buffer.charCodeAt(this._index); + if (this._state === 1 /* Text */) { + this.stateText(c); + } + else if (this._state === 23 /* SpecialStartSequence */) { + this.stateSpecialStartSequence(c); + } + else if (this._state === 24 /* InSpecialTag */) { + this.stateInSpecialTag(c); + } + else if (this._state === 19 /* CDATASequence */) { + this.stateCDATASequence(c); + } + else if (this._state === 12 /* InAttributeValueDq */) { + this.stateInAttributeValueDoubleQuotes(c); + } + else if (this._state === 9 /* InAttributeName */) { + this.stateInAttributeName(c); + } + else if (this._state === 21 /* InCommentLike */) { + this.stateInCommentLike(c); + } + else if (this._state === 20 /* InSpecialComment */) { + this.stateInSpecialComment(c); + } + else if (this._state === 8 /* BeforeAttributeName */) { + this.stateBeforeAttributeName(c); + } + else if (this._state === 3 /* InTagName */) { + this.stateInTagName(c); + } + else if (this._state === 6 /* InClosingTagName */) { + this.stateInClosingTagName(c); + } + else if (this._state === 2 /* BeforeTagName */) { + this.stateBeforeTagName(c); + } + else if (this._state === 10 /* AfterAttributeName */) { + this.stateAfterAttributeName(c); + } + else if (this._state === 13 /* InAttributeValueSq */) { + this.stateInAttributeValueSingleQuotes(c); + } + else if (this._state === 11 /* BeforeAttributeValue */) { + this.stateBeforeAttributeValue(c); + } + else if (this._state === 5 /* BeforeClosingTagName */) { + this.stateBeforeClosingTagName(c); + } + else if (this._state === 7 /* AfterClosingTagName */) { + this.stateAfterClosingTagName(c); + } + else if (this._state === 22 /* BeforeSpecialS */) { + this.stateBeforeSpecialS(c); + } + else if (this._state === 14 /* InAttributeValueNq */) { + this.stateInAttributeValueNoQuotes(c); + } + else if (this._state === 4 /* InSelfClosingTag */) { + this.stateInSelfClosingTag(c); + } + else if (this._state === 16 /* InDeclaration */) { + this.stateInDeclaration(c); + } + else if (this._state === 15 /* BeforeDeclaration */) { + this.stateBeforeDeclaration(c); + } + else if (this._state === 18 /* BeforeComment */) { + this.stateBeforeComment(c); + } + else if (this._state === 17 /* InProcessingInstruction */) { + this.stateInProcessingInstruction(c); + } + else if (this._state === 27 /* InNamedEntity */) { + this.stateInNamedEntity(c); + } + else if (this._state === 25 /* BeforeEntity */) { + this.stateBeforeEntity(c); + } + else if (this._state === 29 /* InHexEntity */) { + this.stateInHexEntity(c); + } + else if (this._state === 28 /* InNumericEntity */) { + this.stateInNumericEntity(c); + } + else { + // `this._state === State.BeforeNumericEntity` + this.stateBeforeNumericEntity(c); + } + this._index++; + } + this.cleanup(); + }; + Tokenizer.prototype.finish = function () { + if (this._state === 27 /* InNamedEntity */) { + this.emitNamedEntity(); + } + // If there is remaining data, emit it in a reasonable way + if (this.sectionStart < this._index) { + this.handleTrailingData(); + } + this.cbs.onend(); + }; + /** Handle any trailing data. */ + Tokenizer.prototype.handleTrailingData = function () { + var data = this.buffer.substr(this.sectionStart); + if (this._state === 21 /* InCommentLike */) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(data); + } + else { + this.cbs.oncomment(data); + } + } + else if (this._state === 28 /* InNumericEntity */ && + this.allowLegacyEntity()) { + this.decodeNumericEntity(10, false); + // All trailing data will have been consumed + } + else if (this._state === 29 /* InHexEntity */ && + this.allowLegacyEntity()) { + this.decodeNumericEntity(16, false); + // All trailing data will have been consumed + } + else if (this._state === 3 /* InTagName */ || + this._state === 8 /* BeforeAttributeName */ || + this._state === 11 /* BeforeAttributeValue */ || + this._state === 10 /* AfterAttributeName */ || + this._state === 9 /* InAttributeName */ || + this._state === 13 /* InAttributeValueSq */ || + this._state === 12 /* InAttributeValueDq */ || + this._state === 14 /* InAttributeValueNq */ || + this._state === 6 /* InClosingTagName */) { + /* + * If we are currently in an opening or closing tag, us not calling the + * respective callback signals that the tag should be ignored. + */ + } + else { + this.cbs.ontext(data); + } + }; + Tokenizer.prototype.getSection = function () { + return this.buffer.substring(this.sectionStart, this._index); + }; + Tokenizer.prototype.emitPartial = function (value) { + if (this.baseState !== 1 /* Text */ && + this.baseState !== 24 /* InSpecialTag */) { + this.cbs.onattribdata(value); + } + else { + this.cbs.ontext(value); + } + }; + return Tokenizer; +}()); +exports.default = Tokenizer; diff --git a/node_modules/htmlparser2/lib/WritableStream.d.ts b/node_modules/htmlparser2/lib/WritableStream.d.ts new file mode 100644 index 0000000..0755f99 --- /dev/null +++ b/node_modules/htmlparser2/lib/WritableStream.d.ts @@ -0,0 +1,16 @@ +/// +import { Handler, ParserOptions } from "./Parser"; +import { Writable } from "stream"; +/** + * WritableStream makes the `Parser` interface available as a NodeJS stream. + * + * @see Parser + */ +export declare class WritableStream extends Writable { + private readonly _parser; + private readonly _decoder; + constructor(cbs: Partial, options?: ParserOptions); + _write(chunk: string | Buffer, encoding: string, cb: () => void): void; + _final(cb: () => void): void; +} +//# sourceMappingURL=WritableStream.d.ts.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/WritableStream.d.ts.map b/node_modules/htmlparser2/lib/WritableStream.d.ts.map new file mode 100644 index 0000000..31295a2 --- /dev/null +++ b/node_modules/htmlparser2/lib/WritableStream.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"WritableStream.d.ts","sourceRoot":"","sources":["../src/WritableStream.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK1D,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAQlC;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;gBAEpC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa;IAK1D,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAOtE,MAAM,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;CAI/B"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/WritableStream.js b/node_modules/htmlparser2/lib/WritableStream.js new file mode 100644 index 0000000..ff87995 --- /dev/null +++ b/node_modules/htmlparser2/lib/WritableStream.js @@ -0,0 +1,53 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WritableStream = void 0; +var Parser_1 = require("./Parser"); +/* + * NOTE: If either of these two imports produces a type error, + * please update your @types/node dependency! + */ +var stream_1 = require("stream"); +var string_decoder_1 = require("string_decoder"); +// Following the example in https://nodejs.org/api/stream.html#stream_decoding_buffers_in_a_writable_stream +function isBuffer(_chunk, encoding) { + return encoding === "buffer"; +} +/** + * WritableStream makes the `Parser` interface available as a NodeJS stream. + * + * @see Parser + */ +var WritableStream = /** @class */ (function (_super) { + __extends(WritableStream, _super); + function WritableStream(cbs, options) { + var _this = _super.call(this, { decodeStrings: false }) || this; + _this._decoder = new string_decoder_1.StringDecoder(); + _this._parser = new Parser_1.Parser(cbs, options); + return _this; + } + WritableStream.prototype._write = function (chunk, encoding, cb) { + this._parser.write(isBuffer(chunk, encoding) ? this._decoder.write(chunk) : chunk); + cb(); + }; + WritableStream.prototype._final = function (cb) { + this._parser.end(this._decoder.end()); + cb(); + }; + return WritableStream; +}(stream_1.Writable)); +exports.WritableStream = WritableStream; diff --git a/node_modules/htmlparser2/lib/index.d.ts b/node_modules/htmlparser2/lib/index.d.ts new file mode 100644 index 0000000..997c6d9 --- /dev/null +++ b/node_modules/htmlparser2/lib/index.d.ts @@ -0,0 +1,39 @@ +import { Parser, ParserOptions } from "./Parser"; +export { Parser, ParserOptions }; +import { DomHandler, DomHandlerOptions, Node, Element, Document } from "domhandler"; +export { DomHandler, DomHandlerOptions }; +declare type Options = ParserOptions & DomHandlerOptions; +/** + * Parses the data, returns the resulting document. + * + * @param data The data that should be parsed. + * @param options Optional options for the parser and DOM builder. + */ +export declare function parseDocument(data: string, options?: Options): Document; +/** + * Parses data, returns an array of the root nodes. + * + * Note that the root nodes still have a `Document` node as their parent. + * Use `parseDocument` to get the `Document` node instead. + * + * @param data The data that should be parsed. + * @param options Optional options for the parser and DOM builder. + * @deprecated Use `parseDocument` instead. + */ +export declare function parseDOM(data: string, options?: Options): Node[]; +/** + * Creates a parser instance, with an attached DOM handler. + * + * @param cb A callback that will be called once parsing has been completed. + * @param options Optional options for the parser and DOM builder. + * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM. + */ +export declare function createDomStream(cb: (error: Error | null, dom: Node[]) => void, options?: Options, elementCb?: (element: Element) => void): Parser; +export { default as Tokenizer, Callbacks as TokenizerCallbacks, } from "./Tokenizer"; +import * as ElementType from "domelementtype"; +export { ElementType }; +export * from "./FeedHandler"; +export * as DomUtils from "domutils"; +export { DomHandler as DefaultHandler }; +export { FeedHandler as RssHandler } from "./FeedHandler"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/index.d.ts.map b/node_modules/htmlparser2/lib/index.d.ts.map new file mode 100644 index 0000000..058fcba --- /dev/null +++ b/node_modules/htmlparser2/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AAEjC,OAAO,EACH,UAAU,EACV,iBAAiB,EACjB,IAAI,EACJ,OAAO,EACP,QAAQ,EACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;AAEzC,aAAK,OAAO,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAIjD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAIvE;AACD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,EAAE,CAEhE;AACD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC3B,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,EAC9C,OAAO,CAAC,EAAE,OAAO,EACjB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GACvC,MAAM,CAGR;AAED,OAAO,EACH,OAAO,IAAI,SAAS,EACpB,SAAS,IAAI,kBAAkB,GAClC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,CAAC;AAOvB,cAAc,eAAe,CAAC;AAC9B,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,CAAC;AACxC,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/htmlparser2/lib/index.js b/node_modules/htmlparser2/lib/index.js new file mode 100644 index 0000000..3e461fa --- /dev/null +++ b/node_modules/htmlparser2/lib/index.js @@ -0,0 +1,84 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RssHandler = exports.DefaultHandler = exports.DomUtils = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DomHandler = exports.Parser = void 0; +var Parser_1 = require("./Parser"); +Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_1.Parser; } }); +var domhandler_1 = require("domhandler"); +Object.defineProperty(exports, "DomHandler", { enumerable: true, get: function () { return domhandler_1.DomHandler; } }); +Object.defineProperty(exports, "DefaultHandler", { enumerable: true, get: function () { return domhandler_1.DomHandler; } }); +// Helper methods +/** + * Parses the data, returns the resulting document. + * + * @param data The data that should be parsed. + * @param options Optional options for the parser and DOM builder. + */ +function parseDocument(data, options) { + var handler = new domhandler_1.DomHandler(undefined, options); + new Parser_1.Parser(handler, options).end(data); + return handler.root; +} +exports.parseDocument = parseDocument; +/** + * Parses data, returns an array of the root nodes. + * + * Note that the root nodes still have a `Document` node as their parent. + * Use `parseDocument` to get the `Document` node instead. + * + * @param data The data that should be parsed. + * @param options Optional options for the parser and DOM builder. + * @deprecated Use `parseDocument` instead. + */ +function parseDOM(data, options) { + return parseDocument(data, options).children; +} +exports.parseDOM = parseDOM; +/** + * Creates a parser instance, with an attached DOM handler. + * + * @param cb A callback that will be called once parsing has been completed. + * @param options Optional options for the parser and DOM builder. + * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM. + */ +function createDomStream(cb, options, elementCb) { + var handler = new domhandler_1.DomHandler(cb, options, elementCb); + return new Parser_1.Parser(handler, options); +} +exports.createDomStream = createDomStream; +var Tokenizer_1 = require("./Tokenizer"); +Object.defineProperty(exports, "Tokenizer", { enumerable: true, get: function () { return __importDefault(Tokenizer_1).default; } }); +var ElementType = __importStar(require("domelementtype")); +exports.ElementType = ElementType; +/* + * All of the following exports exist for backwards-compatibility. + * They should probably be removed eventually. + */ +__exportStar(require("./FeedHandler"), exports); +exports.DomUtils = __importStar(require("domutils")); +var FeedHandler_1 = require("./FeedHandler"); +Object.defineProperty(exports, "RssHandler", { enumerable: true, get: function () { return FeedHandler_1.FeedHandler; } }); diff --git a/node_modules/htmlparser2/package.json b/node_modules/htmlparser2/package.json new file mode 100644 index 0000000..ab52a8b --- /dev/null +++ b/node_modules/htmlparser2/package.json @@ -0,0 +1,75 @@ +{ + "name": "htmlparser2", + "description": "Fast & forgiving HTML/XML parser", + "version": "7.2.0", + "author": "Felix Boehm ", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "sideEffects": false, + "keywords": [ + "html", + "parser", + "streams", + "xml", + "dom", + "rss", + "feed", + "atom" + ], + "repository": { + "type": "git", + "url": "git://github.com/fb55/htmlparser2.git" + }, + "directories": { + "lib": "lib/" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib/**/*" + ], + "scripts": { + "test": "npm run test:jest && npm run lint", + "test:jest": "jest", + "lint": "npm run lint:es && npm run lint:prettier", + "lint:es": "eslint src", + "lint:prettier": "npm run format:prettier:raw -- --check", + "format": "npm run format:es && npm run format:prettier", + "format:es": "npm run lint:es -- --fix", + "format:prettier": "npm run format:prettier:raw -- --write", + "format:prettier:raw": "prettier '**/*.{ts,md,json,yml}'", + "build": "tsc", + "prepare": "npm run build" + }, + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.2", + "domutils": "^2.8.0", + "entities": "^3.0.1" + }, + "devDependencies": { + "@types/jest": "^27.0.2", + "@types/node": "^16.11.7", + "@typescript-eslint/eslint-plugin": "^5.3.1", + "@typescript-eslint/parser": "^5.3.1", + "eslint": "^8.2.0", + "eslint-config-prettier": "^8.1.0", + "jest": "^27.3.1", + "prettier": "^2.4.1", + "ts-jest": "^27.0.7", + "typescript": "^4.4.4" + }, + "jest": { + "preset": "ts-jest", + "testEnvironment": "node" + }, + "prettier": { + "tabWidth": 4 + } +} diff --git a/node_modules/http-equiv-refresh/README.md b/node_modules/http-equiv-refresh/README.md new file mode 100644 index 0000000..be450e5 --- /dev/null +++ b/node_modules/http-equiv-refresh/README.md @@ -0,0 +1,29 @@ +# http-equiv-refresh [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] + +> Parse an HTML meta refresh value. + + +## Installation + +[Node.js](http://nodejs.org/) `>= 0.10` is required. To install, type this at the command line: +```shell +npm install http-equiv-refresh +``` + + +## Usage +```js +var parseMetaRefresh = require("http-equiv-refresh"); + +parseMetaRefresh("5; url=http://domain.com/"); +//=> { timeout:5, url:"http://domain.com/" } + +parseMetaRefresh("5"); +//=> { timeout:5, url:null } +``` + + +[npm-image]: https://img.shields.io/npm/v/http-equiv-refresh.svg +[npm-url]: https://npmjs.org/package/http-equiv-refresh +[travis-image]: https://img.shields.io/travis/stevenvachon/http-equiv-refresh.svg +[travis-url]: https://travis-ci.org/stevenvachon/http-equiv-refresh diff --git a/node_modules/http-equiv-refresh/index.js b/node_modules/http-equiv-refresh/index.js new file mode 100644 index 0000000..a3770a6 --- /dev/null +++ b/node_modules/http-equiv-refresh/index.js @@ -0,0 +1,50 @@ +"use strict"; +var pattern = /^\s*(\d+)(?:\s*;(?:\s*url\s*=)?\s*(.+)?)?$/i; + + + +function parseMetaRefresh(content) +{ + var firstChar,lastChar,url; + var result = { timeout:null, url:null }; + content = pattern.exec(content); + + if (content !== null) + { + if (content[1] !== undefined) + { + result.timeout = ~~content[1]; // faster than `parseInt()` + } + + if (content[2] !== undefined) + { + url = content[2].trim(); + + firstChar = url[0]; + lastChar = url[ url.length-1 ]; + + // Remove a single level of encapsulating quotes + if (firstChar==="'" && lastChar==="'" || firstChar==='"' && lastChar==='"') + { + if (url.length > 2) + { + url = url.substr(1, url.length-2).trim(); + } + else + { + url = ""; + } + + if (url === "") url = null; + } + + result.url = url; + } + } + + return result; +} + + + +module.exports = parseMetaRefresh; diff --git a/node_modules/http-equiv-refresh/license b/node_modules/http-equiv-refresh/license new file mode 100644 index 0000000..b760007 --- /dev/null +++ b/node_modules/http-equiv-refresh/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Steven Vachon (svachon.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. diff --git a/node_modules/http-equiv-refresh/package.json b/node_modules/http-equiv-refresh/package.json new file mode 100644 index 0000000..a01831e --- /dev/null +++ b/node_modules/http-equiv-refresh/package.json @@ -0,0 +1,41 @@ +{ + "name": "http-equiv-refresh", + "description": "Parse an HTML meta refresh value.", + "version": "1.0.0", + "license": "MIT", + "homepage": "https://github.com/stevenvachon/http-equiv-refresh", + "author": { + "name": "Steven Vachon", + "email": "contact@svachon.com", + "url": "http://www.svachon.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/stevenvachon/http-equiv-refresh.git" + }, + "bugs": { + "url": "https://github.com/stevenvachon/http-equiv-refresh/issues" + }, + "devDependencies": { + "chai": "^3.5.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">= 0.10" + }, + "scripts": { + "test": "mocha test.js --reporter spec --check-leaks --bail" + }, + "files": [ + "index.js", + "license" + ], + "keywords": [ + "html", + "http-equiv", + "meta", + "metadata", + "parse", + "refresh" + ] +} diff --git a/node_modules/inflight/LICENSE b/node_modules/inflight/LICENSE new file mode 100644 index 0000000..05eeeb8 --- /dev/null +++ b/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/inflight/README.md b/node_modules/inflight/README.md new file mode 100644 index 0000000..6dc8929 --- /dev/null +++ b/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js new file mode 100644 index 0000000..48202b3 --- /dev/null +++ b/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json new file mode 100644 index 0000000..6084d35 --- /dev/null +++ b/node_modules/inflight/package.json @@ -0,0 +1,29 @@ +{ + "name": "inflight", + "version": "1.0.6", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" + ], + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.1.2" + }, + "scripts": { + "test": "tap test.js --100" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/inflight.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC" +} diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js new file mode 100644 index 0000000..f71f2d9 --- /dev/null +++ b/node_modules/inherits/inherits.js @@ -0,0 +1,9 @@ +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..86bbb3d --- /dev/null +++ b/node_modules/inherits/inherits_browser.js @@ -0,0 +1,27 @@ +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 + } + } +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json new file mode 100644 index 0000000..37b4366 --- /dev/null +++ b/node_modules/inherits/package.json @@ -0,0 +1,29 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.4", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": "git://github.com/isaacs/inherits", + "license": "ISC", + "scripts": { + "test": "tap" + }, + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ] +} diff --git a/node_modules/is-alphabetical/index.js b/node_modules/is-alphabetical/index.js new file mode 100644 index 0000000..26d3650 --- /dev/null +++ b/node_modules/is-alphabetical/index.js @@ -0,0 +1,14 @@ +'use strict' + +module.exports = alphabetical + +// Check if the given character code, or the character code at the first +// character, is alphabetical. +function alphabetical(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character + + return ( + (code >= 97 && code <= 122) /* a-z */ || + (code >= 65 && code <= 90) /* A-Z */ + ) +} diff --git a/node_modules/is-alphabetical/license b/node_modules/is-alphabetical/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-alphabetical/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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. diff --git a/node_modules/is-alphabetical/package.json b/node_modules/is-alphabetical/package.json new file mode 100644 index 0000000..c7764f2 --- /dev/null +++ b/node_modules/is-alphabetical/package.json @@ -0,0 +1,75 @@ +{ + "name": "is-alphabetical", + "version": "1.0.4", + "description": "Check if a character is alphabetical", + "license": "MIT", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical" + ], + "repository": "wooorm/is-alphabetical", + "bugs": "https://github.com/wooorm/is-alphabetical/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" + ], + "dependencies": {}, + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify -s isAlphabetical -o is-alphabetical.js", + "build-mangle": "browserify -s isAlphabetical -p tinyify -o is-alphabetical.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "capitalized-comments": "off" + }, + "ignores": [ + "is-alphabetical.js" + ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/node_modules/is-alphabetical/readme.md b/node_modules/is-alphabetical/readme.md new file mode 100644 index 0000000..2a6064b --- /dev/null +++ b/node_modules/is-alphabetical/readme.md @@ -0,0 +1,70 @@ +# is-alphabetical + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is alphabetical. + +## Install + +[npm][]: + +```sh +npm install is-alphabetical +``` + +## Use + +```js +var alphabetical = require('is-alphabetical') + +alphabetical('a') // => true +alphabetical('B') // => true +alphabetical('0') // => false +alphabetical('💩') // => false +``` + +## API + +### `alphabetical(character|code)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is alphabetical. + +## Related + +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-alphabetical.svg + +[build]: https://travis-ci.org/wooorm/is-alphabetical + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphabetical.svg + +[coverage]: https://codecov.io/github/wooorm/is-alphabetical + +[downloads-badge]: https://img.shields.io/npm/dm/is-alphabetical.svg + +[downloads]: https://www.npmjs.com/package/is-alphabetical + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-alphabetical.svg + +[size]: https://bundlephobia.com/result?p=is-alphabetical + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-alphanumerical/index.js b/node_modules/is-alphanumerical/index.js new file mode 100644 index 0000000..cd5edef --- /dev/null +++ b/node_modules/is-alphanumerical/index.js @@ -0,0 +1,12 @@ +'use strict' + +var alphabetical = require('is-alphabetical') +var decimal = require('is-decimal') + +module.exports = alphanumerical + +// Check if the given character code, or the character code at the first +// character, is alphanumerical. +function alphanumerical(character) { + return alphabetical(character) || decimal(character) +} diff --git a/node_modules/is-alphanumerical/license b/node_modules/is-alphanumerical/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-alphanumerical/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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. diff --git a/node_modules/is-alphanumerical/package.json b/node_modules/is-alphanumerical/package.json new file mode 100644 index 0000000..edaa31e --- /dev/null +++ b/node_modules/is-alphanumerical/package.json @@ -0,0 +1,77 @@ +{ + "name": "is-alphanumerical", + "version": "1.0.4", + "description": "Check if a character is alphanumerical", + "license": "MIT", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical", + "numerical", + "alphanumerical" + ], + "repository": "wooorm/is-alphanumerical", + "bugs": "https://github.com/wooorm/is-alphanumerical/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" + ], + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify . -s isAlphanumerical -o is-alphanumerical.js", + "build-mangle": "browserify . -s isAlphanumerical -p tinyify -o is-alphanumerical.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "is-alphanumerical.js" + ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/node_modules/is-alphanumerical/readme.md b/node_modules/is-alphanumerical/readme.md new file mode 100644 index 0000000..8496cad --- /dev/null +++ b/node_modules/is-alphanumerical/readme.md @@ -0,0 +1,71 @@ +# is-alphanumerical + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is alphanumerical (`[a-zA-Z0-9]`). + +## Install + +[npm][]: + +```sh +npm install is-alphanumerical +``` + +## Use + +```js +var alphanumerical = require('is-alphanumerical') + +alphanumerical('a') // => true +alphanumerical('Z') // => true +alphanumerical('0') // => true +alphanumerical(' ') // => false +alphanumerical('💩') // => false +``` + +## API + +### `alphanumerical(character)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is alphanumerical. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-alphanumerical.svg + +[build]: https://travis-ci.org/wooorm/is-alphanumerical + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphanumerical.svg + +[coverage]: https://codecov.io/github/wooorm/is-alphanumerical + +[downloads-badge]: https://img.shields.io/npm/dm/is-alphanumerical.svg + +[downloads]: https://www.npmjs.com/package/is-alphanumerical + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-alphanumerical.svg + +[size]: https://bundlephobia.com/result?p=is-alphanumerical + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-binary-path/index.d.ts b/node_modules/is-binary-path/index.d.ts new file mode 100644 index 0000000..19dcd43 --- /dev/null +++ b/node_modules/is-binary-path/index.d.ts @@ -0,0 +1,17 @@ +/** +Check if a file path is a binary file. + +@example +``` +import isBinaryPath = require('is-binary-path'); + +isBinaryPath('source/unicorn.png'); +//=> true + +isBinaryPath('source/unicorn.txt'); +//=> false +``` +*/ +declare function isBinaryPath(filePath: string): boolean; + +export = isBinaryPath; diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js new file mode 100644 index 0000000..ef7548c --- /dev/null +++ b/node_modules/is-binary-path/index.js @@ -0,0 +1,7 @@ +'use strict'; +const path = require('path'); +const binaryExtensions = require('binary-extensions'); + +const extensions = new Set(binaryExtensions); + +module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); diff --git a/node_modules/is-binary-path/license b/node_modules/is-binary-path/license new file mode 100644 index 0000000..401b1c7 --- /dev/null +++ b/node_modules/is-binary-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.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. diff --git a/node_modules/is-binary-path/package.json b/node_modules/is-binary-path/package.json new file mode 100644 index 0000000..a8d005a --- /dev/null +++ b/node_modules/is-binary-path/package.json @@ -0,0 +1,40 @@ +{ + "name": "is-binary-path", + "version": "2.1.0", + "description": "Check if a file path is a binary file", + "license": "MIT", + "repository": "sindresorhus/is-binary-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "binary", + "extensions", + "extension", + "file", + "path", + "check", + "detect", + "is" + ], + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/is-binary-path/readme.md b/node_modules/is-binary-path/readme.md new file mode 100644 index 0000000..b4ab025 --- /dev/null +++ b/node_modules/is-binary-path/readme.md @@ -0,0 +1,34 @@ +# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) + +> Check if a file path is a binary file + + +## Install + +``` +$ npm install is-binary-path +``` + + +## Usage + +```js +const isBinaryPath = require('is-binary-path'); + +isBinaryPath('source/unicorn.png'); +//=> true + +isBinaryPath('source/unicorn.txt'); +//=> false +``` + + +## Related + +- [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions +- [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com), [Paul Miller](https://paulmillr.com) diff --git a/node_modules/is-core-module/.eslintrc b/node_modules/is-core-module/.eslintrc new file mode 100644 index 0000000..f2e0726 --- /dev/null +++ b/node_modules/is-core-module/.eslintrc @@ -0,0 +1,18 @@ +{ + "extends": "@ljharb", + "root": true, + "rules": { + "func-style": 1, + }, + "overrides": [ + { + "files": "test/**", + "rules": { + "global-require": 0, + "max-depth": 0, + "max-lines-per-function": 0, + "no-negated-condition": 0, + }, + }, + ], +} diff --git a/node_modules/is-core-module/.nycrc b/node_modules/is-core-module/.nycrc new file mode 100644 index 0000000..bdd626c --- /dev/null +++ b/node_modules/is-core-module/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/is-core-module/CHANGELOG.md b/node_modules/is-core-module/CHANGELOG.md new file mode 100644 index 0000000..cebf92e --- /dev/null +++ b/node_modules/is-core-module/CHANGELOG.md @@ -0,0 +1,189 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.14.0](https://github.com/inspect-js/is-core-module/compare/v2.13.1...v2.14.0) - 2024-06-20 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `mock-property`, `npmignore`, `tape` [`0e43200`](https://github.com/inspect-js/is-core-module/commit/0e432006d97237cc082d41e6a593e87c81068364) +- [meta] add missing `engines.node` [`4ea3af8`](https://github.com/inspect-js/is-core-module/commit/4ea3af88891a1d4f96026f0ec0ef08c67cd1bd24) +- [New] add `test/mock_loader` [`e9fbd29`](https://github.com/inspect-js/is-core-module/commit/e9fbd2951383be070aeffb9ebbf3715237282610) +- [Deps] update `hasown` [`57f1940`](https://github.com/inspect-js/is-core-module/commit/57f1940947b3e368abdf529232d2f17d88909358) + +## [v2.13.1](https://github.com/inspect-js/is-core-module/compare/v2.13.0...v2.13.1) - 2023-10-20 + +### Commits + +- [Refactor] use `hasown` instead of `has` [`0e52096`](https://github.com/inspect-js/is-core-module/commit/0e520968b0a725276b67420ab4b877486b243ae0) +- [Dev Deps] update `mock-property`, `tape` [`8736b35`](https://github.com/inspect-js/is-core-module/commit/8736b35464d0f297b55da2c6b30deee04b8303c5) + +## [v2.13.0](https://github.com/inspect-js/is-core-module/compare/v2.12.1...v2.13.0) - 2023-08-05 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `semver`, `tape` [`c75b263`](https://github.com/inspect-js/is-core-module/commit/c75b263d047cb53430c3970107e5eb64d6cd6c0c) +- [New] `node:test/reporters` and `wasi`/`node:wasi` are in v18.17 [`d76cbf8`](https://github.com/inspect-js/is-core-module/commit/d76cbf8e9b208acfd98913fed5a5f45cb15fe5dc) + +## [v2.12.1](https://github.com/inspect-js/is-core-module/compare/v2.12.0...v2.12.1) - 2023-05-16 + +### Commits + +- [Fix] `test/reporters` now requires the `node:` prefix as of v20.2 [`12183d0`](https://github.com/inspect-js/is-core-module/commit/12183d0d8e4edf56b6ce18a1b3be54bfce10175b) + +## [v2.12.0](https://github.com/inspect-js/is-core-module/compare/v2.11.0...v2.12.0) - 2023-04-10 + +### Commits + +- [actions] update rebase action to use reusable workflow [`c0a7251`](https://github.com/inspect-js/is-core-module/commit/c0a7251f734f3c621932c5fcdfd1bf966b42ca32) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9ae8b7f`](https://github.com/inspect-js/is-core-module/commit/9ae8b7fac03c369861d0991b4a2ce8d4848e6a7d) +- [New] `test/reporters` added in v19.9, `wasi` added in v20 [`9d5341a`](https://github.com/inspect-js/is-core-module/commit/9d5341ab32053f25b7fa7db3c0e18461db24a79c) +- [Dev Deps] add missing `in-publish` dep [`5980245`](https://github.com/inspect-js/is-core-module/commit/59802456e9ac919fa748f53be9d8fbf304a197df) + +## [v2.11.0](https://github.com/inspect-js/is-core-module/compare/v2.10.0...v2.11.0) - 2022-10-18 + +### Commits + +- [meta] use `npmignore` to autogenerate an npmignore file [`3360011`](https://github.com/inspect-js/is-core-module/commit/33600118857b46177178072fba2affcdeb009d12) +- [Dev Deps] update `aud`, `tape` [`651c6b0`](https://github.com/inspect-js/is-core-module/commit/651c6b0cc2799d4130866cf43ad333dcade3d26c) +- [New] `inspector/promises` and `node:inspector/promises` is now available in node 19 [`22d332f`](https://github.com/inspect-js/is-core-module/commit/22d332fe22ac050305444e0781ff85af819abcb0) + +## [v2.10.0](https://github.com/inspect-js/is-core-module/compare/v2.9.0...v2.10.0) - 2022-08-03 + +### Commits + +- [New] `node:test` is now available in node ^16.17 [`e8fd36e`](https://github.com/inspect-js/is-core-module/commit/e8fd36e9b86c917775a07cc473b62a3294f459f2) +- [Tests] improve skip message [`c014a4c`](https://github.com/inspect-js/is-core-module/commit/c014a4c0cd6eb15fff573ae4709191775e70cab4) + +## [v2.9.0](https://github.com/inspect-js/is-core-module/compare/v2.8.1...v2.9.0) - 2022-04-19 + +### Commits + +- [New] add `node:test`, in node 18+ [`f853eca`](https://github.com/inspect-js/is-core-module/commit/f853eca801d0a7d4e1dbb670f1b6d9837d9533c5) +- [Tests] use `mock-property` [`03b3644`](https://github.com/inspect-js/is-core-module/commit/03b3644dff4417f4ba5a7d0aa0138f5f6b3e5c46) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`7c0e2d0`](https://github.com/inspect-js/is-core-module/commit/7c0e2d06ed2a89acf53abe2ab34d703ed5b03455) +- [meta] simplify "exports" [`d6ed201`](https://github.com/inspect-js/is-core-module/commit/d6ed201eba7fbba0e59814a9050fc49a6e9878c8) + +## [v2.8.1](https://github.com/inspect-js/is-core-module/compare/v2.8.0...v2.8.1) - 2022-01-05 + +### Commits + +- [actions] reuse common workflows [`cd2cf9b`](https://github.com/inspect-js/is-core-module/commit/cd2cf9b3b66c8d328f65610efe41e9325db7716d) +- [Fix] update node 0.4 results [`062195d`](https://github.com/inspect-js/is-core-module/commit/062195d89f0876a88b95d378b43f7fcc1205bc5b) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0790b62`](https://github.com/inspect-js/is-core-module/commit/0790b6222848c6167132f9f73acc3520fa8d1298) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7d139a6`](https://github.com/inspect-js/is-core-module/commit/7d139a6d767709eabf0a0251e074ec1fb230c06e) +- [Tests] run `nyc` in `tests-only`, not `test` [`780e8a0`](https://github.com/inspect-js/is-core-module/commit/780e8a049951c71cf78b1707f0871c48a28bde14) + +## [v2.8.0](https://github.com/inspect-js/is-core-module/compare/v2.7.0...v2.8.0) - 2021-10-14 + +### Commits + +- [actions] update codecov uploader [`0cfe94e`](https://github.com/inspect-js/is-core-module/commit/0cfe94e106a7d005ea03e008c0a21dec13a77904) +- [New] add `readline/promises` to node v17+ [`4f78c30`](https://github.com/inspect-js/is-core-module/commit/4f78c3008b1b58b4db6dc91d99610b1bc859da7e) +- [Tests] node ^14.18 supports `node:` prefixes for CJS [`43e2f17`](https://github.com/inspect-js/is-core-module/commit/43e2f177452cea2f0eaf34f61b5407217bbdb6f4) + +## [v2.7.0](https://github.com/inspect-js/is-core-module/compare/v2.6.0...v2.7.0) - 2021-09-27 + +### Commits + +- [New] node `v14.18` added `node:`-prefixed core modules to `require` [`6d943ab`](https://github.com/inspect-js/is-core-module/commit/6d943abe81382b9bbe344384d80fbfebe1cc0526) +- [Tests] add coverage for Object.prototype pollution [`c6baf5f`](https://github.com/inspect-js/is-core-module/commit/c6baf5f942311a1945c1af41167bb80b84df2af7) +- [Dev Deps] update `@ljharb/eslint-config` [`6717f00`](https://github.com/inspect-js/is-core-module/commit/6717f000d063ea57beb772bded36c2f056ac404c) +- [eslint] fix linter warning [`594c10b`](https://github.com/inspect-js/is-core-module/commit/594c10bb7d39d7eb00925c90924199ff596184b2) +- [meta] add `sideEffects` flag [`c32cfa5`](https://github.com/inspect-js/is-core-module/commit/c32cfa5195632944c4dd4284a142b8476e75be13) + +## [v2.6.0](https://github.com/inspect-js/is-core-module/compare/v2.5.0...v2.6.0) - 2021-08-17 + +### Commits + +- [Dev Deps] update `eslint`, `tape` [`6cc928f`](https://github.com/inspect-js/is-core-module/commit/6cc928f8a4bba66aeeccc4f6beeac736d4bd3081) +- [New] add `stream/consumers` to node `>= 16.7` [`a1a423e`](https://github.com/inspect-js/is-core-module/commit/a1a423e467e4cc27df180234fad5bab45943e67d) +- [Refactor] Remove duplicated `&&` operand [`86faea7`](https://github.com/inspect-js/is-core-module/commit/86faea738213a2433c62d1098488dc9314dca832) +- [Tests] include prereleases [`a4da7a6`](https://github.com/inspect-js/is-core-module/commit/a4da7a6abf7568e2aa4fd98e69452179f1850963) + +## [v2.5.0](https://github.com/inspect-js/is-core-module/compare/v2.4.0...v2.5.0) - 2021-07-12 + +### Commits + +- [Dev Deps] update `auto-changelog`, `eslint` [`6334cc9`](https://github.com/inspect-js/is-core-module/commit/6334cc94f3af7469685bd8f236740991baaf2705) +- [New] add `stream/web` to node v16.5+ [`17ac59b`](https://github.com/inspect-js/is-core-module/commit/17ac59b662d63e220a2e5728625f005c24f177b2) + +## [v2.4.0](https://github.com/inspect-js/is-core-module/compare/v2.3.0...v2.4.0) - 2021-05-09 + +### Commits + +- [readme] add actions and codecov badges [`82b7faa`](https://github.com/inspect-js/is-core-module/commit/82b7faa12b56dbe47fbea67e1a5b9e447027ba40) +- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`8096868`](https://github.com/inspect-js/is-core-module/commit/8096868c024a161ccd4d44110b136763e92eace8) +- [Dev Deps] update `eslint` [`6726824`](https://github.com/inspect-js/is-core-module/commit/67268249b88230018c510f6532a8046d7326346f) +- [New] add `diagnostics_channel` to node `^14.17` [`86c6563`](https://github.com/inspect-js/is-core-module/commit/86c65634201b8ff9b3e48a9a782594579c7f5c3c) +- [meta] fix prepublish script [`697a01e`](https://github.com/inspect-js/is-core-module/commit/697a01e3c9c0be074066520954f30fb28532ec57) + +## [v2.3.0](https://github.com/inspect-js/is-core-module/compare/v2.2.0...v2.3.0) - 2021-04-24 + +### Commits + +- [meta] do not publish github action workflow files [`060d4bb`](https://github.com/inspect-js/is-core-module/commit/060d4bb971a29451c19ff336eb56bee27f9fa95a) +- [New] add support for `node:` prefix, in node 16+ [`7341223`](https://github.com/inspect-js/is-core-module/commit/73412230a769f6e81c05eea50b6520cebf54ed2f) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`016269a`](https://github.com/inspect-js/is-core-module/commit/016269abae9f6657a5254adfbb813f09a05067f9) +- [patch] remove unneeded `.0` in version ranges [`cb466a6`](https://github.com/inspect-js/is-core-module/commit/cb466a6d89e52b8389e5c12715efcd550c41cea3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`c9f9c39`](https://github.com/inspect-js/is-core-module/commit/c9f9c396ace60ef81906f98059c064e6452473ed) +- [actions] update workflows [`3ee4a89`](https://github.com/inspect-js/is-core-module/commit/3ee4a89fd5a02fccd43882d905448ea6a98e9a3c) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`dee4fed`](https://github.com/inspect-js/is-core-module/commit/dee4fed79690c1d43a22f7fa9426abebdc6d727f) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`7d046ba`](https://github.com/inspect-js/is-core-module/commit/7d046ba07ae8c9292e43652694ca808d7b309de8) +- [meta] use `prepublishOnly` script for npm 7+ [`149e677`](https://github.com/inspect-js/is-core-module/commit/149e6771a5ede6d097e71785b467a9c4b4977cc7) +- [readme] remove travis badge [`903b51d`](https://github.com/inspect-js/is-core-module/commit/903b51d6b69b98abeabfbc3695c345b02646f19c) + +## [v2.2.0](https://github.com/inspect-js/is-core-module/compare/v2.1.0...v2.2.0) - 2020-11-26 + +### Commits + +- [Tests] migrate tests to Github Actions [`c919f57`](https://github.com/inspect-js/is-core-module/commit/c919f573c0a92d10a0acad0b650b5aecb033d426) +- [patch] `core.json`: %s/ /\t/g [`db3f685`](https://github.com/inspect-js/is-core-module/commit/db3f68581f53e73cc09cd675955eb1bdd6a5a39b) +- [Tests] run `nyc` on all tests [`b2f925f`](https://github.com/inspect-js/is-core-module/commit/b2f925f8866f210ef441f39fcc8cc42692ab89b1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`; add `safe-publish-latest` [`89f02a2`](https://github.com/inspect-js/is-core-module/commit/89f02a2b4162246dea303a6ee31bb9a550b05c72) +- [New] add `path/posix`, `path/win32`, `util/types` [`77f94f1`](https://github.com/inspect-js/is-core-module/commit/77f94f1e90ffd7c0be2a3f1aa8574ebf7fd981b3) + +## [v2.1.0](https://github.com/inspect-js/is-core-module/compare/v2.0.0...v2.1.0) - 2020-11-04 + +### Commits + +- [Dev Deps] update `eslint` [`5e0034e`](https://github.com/inspect-js/is-core-module/commit/5e0034eae57c09c8f1bd769f502486a00f56c6e4) +- [New] Add `diagnostics_channel` [`c2d83d0`](https://github.com/inspect-js/is-core-module/commit/c2d83d0a0225a1a658945d9bab7036ea347d29ec) + +## [v2.0.0](https://github.com/inspect-js/is-core-module/compare/v1.0.2...v2.0.0) - 2020-09-29 + +### Commits + +- v2 implementation [`865aeb5`](https://github.com/inspect-js/is-core-module/commit/865aeb5ca0e90248a3dfff5d7622e4751fdeb9cd) +- Only apps should have lockfiles [`5a5e660`](https://github.com/inspect-js/is-core-module/commit/5a5e660d568e37eb44e17fb1ebb12a105205fc2b) +- Initial commit for v2 [`5a51524`](https://github.com/inspect-js/is-core-module/commit/5a51524e06f92adece5fbb138c69b7b9748a2348) +- Tests [`116eae4`](https://github.com/inspect-js/is-core-module/commit/116eae4fccd01bc72c1fd3cc4b7561c387afc496) +- [meta] add `auto-changelog` [`c24388b`](https://github.com/inspect-js/is-core-module/commit/c24388bee828d223040519d1f5b226ca35beee63) +- [actions] add "Automatic Rebase" and "require allow edits" actions [`34292db`](https://github.com/inspect-js/is-core-module/commit/34292dbcbadae0868aff03c22dbd8b7b8a11558a) +- [Tests] add `npm run lint` [`4f9eeee`](https://github.com/inspect-js/is-core-module/commit/4f9eeee7ddff10698bbf528620f4dc8d4fa3e697) +- [readme] fix travis badges, https all URLs [`e516a73`](https://github.com/inspect-js/is-core-module/commit/e516a73b0dccce20938c432b1ba512eae8eff9e9) +- [meta] create FUNDING.yml [`1aabebc`](https://github.com/inspect-js/is-core-module/commit/1aabebca98d01f8a04e46bc2e2520fa93cf21ac6) +- [Fix] `domain`: domain landed sometime > v0.7.7 and <= v0.7.12 [`2df7d37`](https://github.com/inspect-js/is-core-module/commit/2df7d37595d41b15eeada732b706b926c2771655) +- [Fix] `sys`: worked in 0.6, not 0.7, and 0.8+ [`a75c134`](https://github.com/inspect-js/is-core-module/commit/a75c134229e1e9441801f6b73f6a52489346eb65) + +## [v1.0.2](https://github.com/inspect-js/is-core-module/compare/v1.0.1...v1.0.2) - 2014-09-28 + +### Commits + +- simpler [`66fe90f`](https://github.com/inspect-js/is-core-module/commit/66fe90f9771581b9adc0c3900baa52c21b5baea2) + +## [v1.0.1](https://github.com/inspect-js/is-core-module/compare/v1.0.0...v1.0.1) - 2014-09-28 + +### Commits + +- remove stupid [`f21f906`](https://github.com/inspect-js/is-core-module/commit/f21f906f882c2bd656a5fc5ed6fbe48ddaffb2ac) +- update readme [`1eff0ec`](https://github.com/inspect-js/is-core-module/commit/1eff0ec69798d1ec65771552d1562911e90a8027) + +## v1.0.0 - 2014-09-28 + +### Commits + +- init [`48e5e76`](https://github.com/inspect-js/is-core-module/commit/48e5e76cac378fddb8c1f7d4055b8dfc943d6b96) diff --git a/node_modules/is-core-module/LICENSE b/node_modules/is-core-module/LICENSE new file mode 100644 index 0000000..2e50287 --- /dev/null +++ b/node_modules/is-core-module/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Dave Justice + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/is-core-module/README.md b/node_modules/is-core-module/README.md new file mode 100644 index 0000000..062d906 --- /dev/null +++ b/node_modules/is-core-module/README.md @@ -0,0 +1,40 @@ +# is-core-module [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version. + +## Example + +```js +var isCore = require('is-core-module'); +var assert = require('assert'); +assert(isCore('fs')); +assert(!isCore('butts')); +``` + +## Tests +Clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-core-module +[2]: https://versionbadg.es/inspect-js/is-core-module.svg +[5]: https://david-dm.org/inspect-js/is-core-module.svg +[6]: https://david-dm.org/inspect-js/is-core-module +[7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg +[8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies +[11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/is-core-module.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg +[downloads-url]: https://npm-stat.com/charts.html?package=is-core-module +[codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module +[actions-url]: https://github.com/inspect-js/is-core-module/actions diff --git a/node_modules/is-core-module/core.json b/node_modules/is-core-module/core.json new file mode 100644 index 0000000..2592e14 --- /dev/null +++ b/node_modules/is-core-module/core.json @@ -0,0 +1,160 @@ +{ + "assert": true, + "node:assert": [">= 14.18 && < 15", ">= 16"], + "assert/strict": ">= 15", + "node:assert/strict": ">= 16", + "async_hooks": ">= 8", + "node:async_hooks": [">= 14.18 && < 15", ">= 16"], + "buffer_ieee754": ">= 0.5 && < 0.9.7", + "buffer": true, + "node:buffer": [">= 14.18 && < 15", ">= 16"], + "child_process": true, + "node:child_process": [">= 14.18 && < 15", ">= 16"], + "cluster": ">= 0.5", + "node:cluster": [">= 14.18 && < 15", ">= 16"], + "console": true, + "node:console": [">= 14.18 && < 15", ">= 16"], + "constants": true, + "node:constants": [">= 14.18 && < 15", ">= 16"], + "crypto": true, + "node:crypto": [">= 14.18 && < 15", ">= 16"], + "_debug_agent": ">= 1 && < 8", + "_debugger": "< 8", + "dgram": true, + "node:dgram": [">= 14.18 && < 15", ">= 16"], + "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"], + "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"], + "dns": true, + "node:dns": [">= 14.18 && < 15", ">= 16"], + "dns/promises": ">= 15", + "node:dns/promises": ">= 16", + "domain": ">= 0.7.12", + "node:domain": [">= 14.18 && < 15", ">= 16"], + "events": true, + "node:events": [">= 14.18 && < 15", ">= 16"], + "freelist": "< 6", + "fs": true, + "node:fs": [">= 14.18 && < 15", ">= 16"], + "fs/promises": [">= 10 && < 10.1", ">= 14"], + "node:fs/promises": [">= 14.18 && < 15", ">= 16"], + "_http_agent": ">= 0.11.1", + "node:_http_agent": [">= 14.18 && < 15", ">= 16"], + "_http_client": ">= 0.11.1", + "node:_http_client": [">= 14.18 && < 15", ">= 16"], + "_http_common": ">= 0.11.1", + "node:_http_common": [">= 14.18 && < 15", ">= 16"], + "_http_incoming": ">= 0.11.1", + "node:_http_incoming": [">= 14.18 && < 15", ">= 16"], + "_http_outgoing": ">= 0.11.1", + "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"], + "_http_server": ">= 0.11.1", + "node:_http_server": [">= 14.18 && < 15", ">= 16"], + "http": true, + "node:http": [">= 14.18 && < 15", ">= 16"], + "http2": ">= 8.8", + "node:http2": [">= 14.18 && < 15", ">= 16"], + "https": true, + "node:https": [">= 14.18 && < 15", ">= 16"], + "inspector": ">= 8", + "node:inspector": [">= 14.18 && < 15", ">= 16"], + "inspector/promises": [">= 19"], + "node:inspector/promises": [">= 19"], + "_linklist": "< 8", + "module": true, + "node:module": [">= 14.18 && < 15", ">= 16"], + "net": true, + "node:net": [">= 14.18 && < 15", ">= 16"], + "node-inspect/lib/_inspect": ">= 7.6 && < 12", + "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12", + "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12", + "os": true, + "node:os": [">= 14.18 && < 15", ">= 16"], + "path": true, + "node:path": [">= 14.18 && < 15", ">= 16"], + "path/posix": ">= 15.3", + "node:path/posix": ">= 16", + "path/win32": ">= 15.3", + "node:path/win32": ">= 16", + "perf_hooks": ">= 8.5", + "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], + "process": ">= 1", + "node:process": [">= 14.18 && < 15", ">= 16"], + "punycode": ">= 0.5", + "node:punycode": [">= 14.18 && < 15", ">= 16"], + "querystring": true, + "node:querystring": [">= 14.18 && < 15", ">= 16"], + "readline": true, + "node:readline": [">= 14.18 && < 15", ">= 16"], + "readline/promises": ">= 17", + "node:readline/promises": ">= 17", + "repl": true, + "node:repl": [">= 14.18 && < 15", ">= 16"], + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"], + "_stream_transform": ">= 0.9.4", + "node:_stream_transform": [">= 14.18 && < 15", ">= 16"], + "_stream_wrap": ">= 1.4.1", + "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"], + "_stream_passthrough": ">= 0.9.4", + "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"], + "_stream_readable": ">= 0.9.4", + "node:_stream_readable": [">= 14.18 && < 15", ">= 16"], + "_stream_writable": ">= 0.9.4", + "node:_stream_writable": [">= 14.18 && < 15", ">= 16"], + "stream": true, + "node:stream": [">= 14.18 && < 15", ">= 16"], + "stream/consumers": ">= 16.7", + "node:stream/consumers": ">= 16.7", + "stream/promises": ">= 15", + "node:stream/promises": ">= 16", + "stream/web": ">= 16.5", + "node:stream/web": ">= 16.5", + "string_decoder": true, + "node:string_decoder": [">= 14.18 && < 15", ">= 16"], + "sys": [">= 0.4 && < 0.7", ">= 0.8"], + "node:sys": [">= 14.18 && < 15", ">= 16"], + "test/reporters": ">= 19.9 && < 20.2", + "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"], + "test/mock_loader": ">= 22.3", + "node:test/mock_loader": ">= 22.3", + "node:test": [">= 16.17 && < 17", ">= 18"], + "timers": true, + "node:timers": [">= 14.18 && < 15", ">= 16"], + "timers/promises": ">= 15", + "node:timers/promises": ">= 16", + "_tls_common": ">= 0.11.13", + "node:_tls_common": [">= 14.18 && < 15", ">= 16"], + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"], + "tls": true, + "node:tls": [">= 14.18 && < 15", ">= 16"], + "trace_events": ">= 10", + "node:trace_events": [">= 14.18 && < 15", ">= 16"], + "tty": true, + "node:tty": [">= 14.18 && < 15", ">= 16"], + "url": true, + "node:url": [">= 14.18 && < 15", ">= 16"], + "util": true, + "node:util": [">= 14.18 && < 15", ">= 16"], + "util/types": ">= 15.3", + "node:util/types": ">= 16", + "v8/tools/arguments": ">= 10 && < 12", + "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8": ">= 1", + "node:v8": [">= 14.18 && < 15", ">= 16"], + "vm": true, + "node:vm": [">= 14.18 && < 15", ">= 16"], + "wasi": [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"], + "node:wasi": [">= 18.17 && < 19", ">= 20"], + "worker_threads": ">= 11.7", + "node:worker_threads": [">= 14.18 && < 15", ">= 16"], + "zlib": ">= 0.5", + "node:zlib": [">= 14.18 && < 15", ">= 16"] +} diff --git a/node_modules/is-core-module/index.js b/node_modules/is-core-module/index.js new file mode 100644 index 0000000..423e20c --- /dev/null +++ b/node_modules/is-core-module/index.js @@ -0,0 +1,69 @@ +'use strict'; + +var hasOwn = require('hasown'); + +function specifierIncluded(current, specifier) { + var nodeParts = current.split('.'); + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); + + for (var i = 0; i < 3; ++i) { + var cur = parseInt(nodeParts[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } + if (op === '>=') { + return cur >= ver; + } + return false; + } + return op === '>='; +} + +function matchesRange(current, range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { + return false; + } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(current, specifiers[i])) { + return false; + } + } + return true; +} + +function versionIncluded(nodeVersion, specifierValue) { + if (typeof specifierValue === 'boolean') { + return specifierValue; + } + + var current = typeof nodeVersion === 'undefined' + ? process.versions && process.versions.node + : nodeVersion; + + if (typeof current !== 'string') { + throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); + } + + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(current, specifierValue[i])) { + return true; + } + } + return false; + } + return matchesRange(current, specifierValue); +} + +var data = require('./core.json'); + +module.exports = function isCore(x, nodeVersion) { + return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]); +}; diff --git a/node_modules/is-core-module/package.json b/node_modules/is-core-module/package.json new file mode 100644 index 0000000..20d0174 --- /dev/null +++ b/node_modules/is-core-module/package.json @@ -0,0 +1,76 @@ +{ + "name": "is-core-module", + "version": "2.14.0", + "description": "Is this specifier a node.js core module?", + "main": "index.js", + "sideEffects": false, + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "lint": "eslint .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/is-core-module.git" + }, + "keywords": [ + "core", + "modules", + "module", + "npm", + "node", + "dependencies" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/is-core-module/issues" + }, + "homepage": "https://github.com/inspect-js/is-core-module", + "dependencies": { + "hasown": "^2.0.2" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "mock-property": "^1.0.3", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "semver": "^6.3.1", + "tape": "^5.8.1" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/is-core-module/test/index.js b/node_modules/is-core-module/test/index.js new file mode 100644 index 0000000..912808b --- /dev/null +++ b/node_modules/is-core-module/test/index.js @@ -0,0 +1,133 @@ +'use strict'; + +var test = require('tape'); +var keys = require('object-keys'); +var semver = require('semver'); +var mockProperty = require('mock-property'); + +var isCore = require('../'); +var data = require('../core.json'); + +var supportsNodePrefix = semver.satisfies(process.versions.node, '^14.18 || >= 16', { includePrerelease: true }); + +test('core modules', function (t) { + t.test('isCore()', function (st) { + st.ok(isCore('fs')); + st.ok(isCore('net')); + st.ok(isCore('http')); + + st.ok(!isCore('seq')); + st.ok(!isCore('../')); + + st.ok(!isCore('toString')); + + st.end(); + }); + + t.test('core list', function (st) { + var cores = keys(data); + st.plan(cores.length); + + for (var i = 0; i < cores.length; ++i) { + var mod = cores[i]; + var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func + if (isCore(mod)) { + st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw'); + } else { + st['throws'](requireFunc, mod + ' not supported; requiring throws'); + } + } + + st.end(); + }); + + t.test('core via repl module', { skip: !data.repl }, function (st) { + var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle + if (!libs) { + st.skip('repl._builtinLibs does not exist'); + } else { + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + st.ok(data[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + if (mod.slice(0, 5) !== 'node:') { + if (supportsNodePrefix) { + st.doesNotThrow( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' does not throw' + ); + } else { + st['throws']( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' throws' + ); + } + } + } + } + st.end(); + }); + + t.test('core via builtinModules list', { skip: !data.module }, function (st) { + var libs = require('module').builtinModules; + if (!libs) { + st.skip('module.builtinModules does not exist'); + } else { + var excludeList = [ + '_debug_agent', + 'v8/tools/tickprocessor-driver', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor', + 'v8/tools/profile' + ]; + // see https://github.com/nodejs/node/issues/42785 + if (semver.satisfies(process.version, '>= 18')) { + libs = libs.concat('node:test'); + } + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + if (excludeList.indexOf(mod) === -1) { + st.ok(data[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + if (mod.slice(0, 5) !== 'node:') { + if (supportsNodePrefix) { + st.doesNotThrow( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' does not throw' + ); + } else { + st['throws']( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' throws' + ); + } + } + } + } + } + st.end(); + }); + + t.test('Object.prototype pollution', function (st) { + var nonKey = 'not a core module'; + st.teardown(mockProperty(Object.prototype, 'fs', { value: false })); + st.teardown(mockProperty(Object.prototype, 'path', { value: '>= 999999999' })); + st.teardown(mockProperty(Object.prototype, 'http', { value: data.http })); + st.teardown(mockProperty(Object.prototype, nonKey, { value: true })); + + st.equal(isCore('fs'), true, 'fs is a core module even if Object.prototype lies'); + st.equal(isCore('path'), true, 'path is a core module even if Object.prototype lies'); + st.equal(isCore('http'), true, 'path is a core module even if Object.prototype matches data'); + st.equal(isCore(nonKey), false, '"' + nonKey + '" is not a core module even if Object.prototype lies'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/is-decimal/index.js b/node_modules/is-decimal/index.js new file mode 100644 index 0000000..a522104 --- /dev/null +++ b/node_modules/is-decimal/index.js @@ -0,0 +1,11 @@ +'use strict' + +module.exports = decimal + +// Check if the given character code, or the character code at the first +// character, is decimal. +function decimal(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character + + return code >= 48 && code <= 57 /* 0-9 */ +} diff --git a/node_modules/is-decimal/license b/node_modules/is-decimal/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-decimal/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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. diff --git a/node_modules/is-decimal/package.json b/node_modules/is-decimal/package.json new file mode 100644 index 0000000..5589c2a --- /dev/null +++ b/node_modules/is-decimal/package.json @@ -0,0 +1,72 @@ +{ + "name": "is-decimal", + "version": "1.0.4", + "description": "Check if a character is decimal", + "license": "MIT", + "keywords": [ + "string", + "character", + "char", + "code", + "decimal" + ], + "repository": "wooorm/is-decimal", + "bugs": "https://github.com/wooorm/is-decimal/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" + ], + "dependencies": {}, + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify . -s isDecimal -o is-decimal.js", + "build-mangle": "browserify . -s isDecimal -p tinyify -o is-decimal.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "is-decimal.js" + ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/node_modules/is-decimal/readme.md b/node_modules/is-decimal/readme.md new file mode 100644 index 0000000..d24a3d2 --- /dev/null +++ b/node_modules/is-decimal/readme.md @@ -0,0 +1,69 @@ +# is-decimal + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is decimal. + +## Install + +[npm][]: + +```sh +npm install is-decimal +``` + +## Use + +```js +var decimal = require('is-decimal') + +decimal('0') // => true +decimal('9') // => true +decimal('a') // => false +decimal('💩') // => false +``` + +## API + +### `decimal(character|code)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is decimal. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-decimal.svg + +[build]: https://travis-ci.org/wooorm/is-decimal + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-decimal.svg + +[coverage]: https://codecov.io/github/wooorm/is-decimal + +[downloads-badge]: https://img.shields.io/npm/dm/is-decimal.svg + +[downloads]: https://www.npmjs.com/package/is-decimal + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-decimal.svg + +[size]: https://bundlephobia.com/result?p=is-decimal + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-expression/CHANGELOG.md b/node_modules/is-expression/CHANGELOG.md new file mode 100644 index 0000000..abf03e8 --- /dev/null +++ b/node_modules/is-expression/CHANGELOG.md @@ -0,0 +1,48 @@ +# Change Log + +Version 4.0.0 onwards are documented in [Releases](https://github.com/pugjs/is-expression/releases). + +This project adheres to [Semantic Versioning](http://semver.org/). + +## 3.0.0 - 2016-09-11 +### Added +- Updated to acorn ~4.0.0 + - ES2016 has been made the default `ecmaVersion`. + - Async functions are now implemented for `{ecmaVersion: 8}`. + - See [acorn's CHANGELOG][acorn-4.0.0] for a full list of changes. + +## 2.1.0 - 2016-07-27 +### Added +- Updated to acorn ~3.3.0 + - The ES2016 check for strict mode in function parameters is now implemented + for `{ecmaVersion: 7}`. + - See [acorn's CHANGELOG][acorn-3.3.0] for a full list of changes. + +## 2.0.1 - 2016-06-04 +### Added +- Updated to acorn ~3.1.0 + - See [acorn's CHANGELOG][acorn-3.1.0] for a list of changes. + - Even though it is a minor version bump for acorn, the new features are not + in parts of acorn we are using, and thus a patch level bump is warranted. + +## 2.0.0 - 2016-02-12 +### Added +- Updated to acorn ~3.0.2 + - See [acorn's CHANGELOG][acorn-3.0.0] for a list of breaking changes. + +## 1.0.2 - 2016-01-06 +### Added +- Updated to acorn ~2.7.0 + +## 1.0.1 - 2015-11-12 +### Fixed +- Use a stricter version range for Acorn since we depend on Acorn internals. + +## 1.0.0 - 2015-11-11 +### Added +- Initial release + +[acorn-4.0.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#400-2016-08-07 +[acorn-3.3.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#330-2016-07-25 +[acorn-3.1.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#310-2016-04-18 +[acorn-3.0.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#300-2016-02-10 diff --git a/node_modules/is-expression/LICENSE.md b/node_modules/is-expression/LICENSE.md new file mode 100644 index 0000000..6ee7c4a --- /dev/null +++ b/node_modules/is-expression/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (c) 2015 Tiancheng “Timothy” Gu + +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. diff --git a/node_modules/is-expression/README.md b/node_modules/is-expression/README.md new file mode 100644 index 0000000..9c66c38 --- /dev/null +++ b/node_modules/is-expression/README.md @@ -0,0 +1,67 @@ +# is-expression + +Validates a string as a JavaScript expression + +[![Build Status](https://img.shields.io/travis/pugjs/is-expression/master.svg)](https://travis-ci.org/pugjs/is-expression) +[![Dependency Status](https://img.shields.io/david/pugjs/is-expression.svg)](https://david-dm.org/pugjs/is-expression) +[![Rolling Versions](https://img.shields.io/badge/Rolling%20Versions-Enabled-brightgreen)](https://rollingversions.com/pugjs/is-expression) +[![npm version](https://img.shields.io/npm/v/is-expression.svg)](https://www.npmjs.org/package/is-expression) + +## Installation + + npm install is-expression + +## Usage + +### `isExpression(src[, options])` + +Validates a string as a JavaScript expression. + +`src` contains the source. + +`options` can contain any Acorn options (since we use Acorn under-the-hood), +or any of the following: + +- `throw`: Throw an error if the string is not an expression. The error can + be an Acorn error, with location information in `err.loc` and `err.pos`. + Defaults to `false`. +- `strict`: Use strict mode when trying to parse the string. Defaults to + `false`. Even if this option is `false`, if you have provided + `options.sourceType === 'module'` which imples strict mode under ES2015, + strict mode will be used. +- `lineComment`: When `true`, allows line comments in the expression. + Defaults to `false` for safety. + +See the examples below for usage. + +## Examples + +```js +var isExpression = require('is-expression') + +isExpression('myVar') +//=> true +isExpression('var') +//=> false +isExpression('["an", "array", "\'s"].indexOf("index")') +//=> true + +isExpression('var', {throw: true}) +// SyntaxError: Unexpected token (1:0) +// at Parser.pp.raise (acorn/dist/acorn.js:940:13) +// at ... + +isExpression('public') +//=> true +isExpression('public', {strict: true}) +//=> false + +isExpression('abc // my comment') +//=> false +isExpression('abc // my comment', {lineComment: true}) +//=> true +``` + +## License + +MIT diff --git a/node_modules/is-expression/index.js b/node_modules/is-expression/index.js new file mode 100644 index 0000000..7724c97 --- /dev/null +++ b/node_modules/is-expression/index.js @@ -0,0 +1,45 @@ +'use strict'; + +var acorn = require('acorn'); +var objectAssign = require('object-assign'); + +module.exports = isExpression; + +var DEFAULT_OPTIONS = { + throw: false, + strict: false, + lineComment: false +}; + +function isExpression(src, options) { + options = objectAssign({}, DEFAULT_OPTIONS, options); + + try { + var parser = new acorn.Parser(options, src, 0); + + if (options.strict) { + parser.strict = true; + } + + if (!options.lineComment) { + parser.skipLineComment = function (startSkip) { + this.raise(this.pos, 'Line comments not allowed in an expression'); + }; + } + + parser.nextToken(); + parser.parseExpression(); + + if (parser.type !== acorn.tokTypes.eof) { + parser.unexpected(); + } + } catch (ex) { + if (!options.throw) { + return false; + } + + throw ex; + } + + return true; +} diff --git a/node_modules/is-expression/package.json b/node_modules/is-expression/package.json new file mode 100644 index 0000000..07f77c4 --- /dev/null +++ b/node_modules/is-expression/package.json @@ -0,0 +1,30 @@ +{ + "name": "is-expression", + "version": "4.0.0", + "files": [ + "index.js" + ], + "description": "Check if a string is a valid JavaScript expression", + "keywords": [ + "javascript", + "expression" + ], + "dependencies": { + "acorn": "^7.1.1", + "object-assign": "^4.1.1" + }, + "devDependencies": { + "nyc": "^15.0.1", + "testit": "^3.1.0" + }, + "scripts": { + "test": "node test && npm run coverage", + "coverage": "nyc node test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/pugjs/is-expression.git" + }, + "author": "Timothy Gu ", + "license": "MIT" +} diff --git a/node_modules/is-extendable/LICENSE b/node_modules/is-extendable/LICENSE new file mode 100644 index 0000000..65f90ac --- /dev/null +++ b/node_modules/is-extendable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +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. diff --git a/node_modules/is-extendable/README.md b/node_modules/is-extendable/README.md new file mode 100644 index 0000000..e4cfaeb --- /dev/null +++ b/node_modules/is-extendable/README.md @@ -0,0 +1,72 @@ +# is-extendable [![NPM version](https://badge.fury.io/js/is-extendable.svg)](http://badge.fury.io/js/is-extendable) + +> Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?" + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-extendable --save +``` + +## Usage + +```js +var isExtendable = require('is-extendable'); +``` + +Returns true if the value is any of the following: + +* `array` +* `regexp` +* `plain object` +* `function` +* `date` +* `error` + +## Notes + +All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: + +* the value is not a primitive, or +* that the object is an `object`, `function` + +Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. + +## Related projects + +* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._ \ No newline at end of file diff --git a/node_modules/is-extendable/index.js b/node_modules/is-extendable/index.js new file mode 100644 index 0000000..4ee71a4 --- /dev/null +++ b/node_modules/is-extendable/index.js @@ -0,0 +1,13 @@ +/*! + * is-extendable + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +module.exports = function isExtendable(val) { + return typeof val !== 'undefined' && val !== null + && (typeof val === 'object' || typeof val === 'function'); +}; diff --git a/node_modules/is-extendable/package.json b/node_modules/is-extendable/package.json new file mode 100644 index 0000000..5dd006e --- /dev/null +++ b/node_modules/is-extendable/package.json @@ -0,0 +1,51 @@ +{ + "name": "is-extendable", + "description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"", + "version": "0.1.1", + "homepage": "https://github.com/jonschlinkert/is-extendable", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extendable", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extendable/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "mocha": "*" + }, + "keywords": [ + "array", + "assign", + "check", + "date", + "extend", + "extensible", + "function", + "is", + "object", + "regex", + "test" + ], + "verbiage": { + "related": { + "list": [ + "isobject", + "is-plain-object", + "kind-of", + "is-extendable", + "is-equal-shallow", + "extend-shallow", + "assign-deep" + ] + } + } +} diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100644 index 0000000..842218c --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +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. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100644 index 0000000..0416af5 --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100644 index 0000000..c1d986f --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * 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; +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100644 index 0000000..7a90836 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,69 @@ +{ + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/is-fullwidth-code-point/index.d.ts b/node_modules/is-fullwidth-code-point/index.d.ts new file mode 100644 index 0000000..729d202 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/index.d.ts @@ -0,0 +1,17 @@ +/** +Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms). + +@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. + +@example +``` +import isFullwidthCodePoint from 'is-fullwidth-code-point'; + +isFullwidthCodePoint('谢'.codePointAt(0)); +//=> true + +isFullwidthCodePoint('a'.codePointAt(0)); +//=> false +``` +*/ +export default function isFullwidthCodePoint(codePoint: number): boolean; diff --git a/node_modules/is-fullwidth-code-point/index.js b/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 0000000..671f97f --- /dev/null +++ b/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,50 @@ +/* eslint-disable yoda */ +'use strict'; + +const isFullwidthCodePoint = codePoint => { + if (Number.isNaN(codePoint)) { + return false; + } + + // Code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + codePoint >= 0x1100 && ( + codePoint <= 0x115F || // Hangul Jamo + codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET + codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= codePoint && codePoint <= 0x4DBF) || + // CJK Unified Ideographs .. Yi Radicals + (0x4E00 <= codePoint && codePoint <= 0xA4C6) || + // Hangul Jamo Extended-A + (0xA960 <= codePoint && codePoint <= 0xA97C) || + // Hangul Syllables + (0xAC00 <= codePoint && codePoint <= 0xD7A3) || + // CJK Compatibility Ideographs + (0xF900 <= codePoint && codePoint <= 0xFAFF) || + // Vertical Forms + (0xFE10 <= codePoint && codePoint <= 0xFE19) || + // CJK Compatibility Forms .. Small Form Variants + (0xFE30 <= codePoint && codePoint <= 0xFE6B) || + // Halfwidth and Fullwidth Forms + (0xFF01 <= codePoint && codePoint <= 0xFF60) || + (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || + // Kana Supplement + (0x1B000 <= codePoint && codePoint <= 0x1B001) || + // Enclosed Ideographic Supplement + (0x1F200 <= codePoint && codePoint <= 0x1F251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= codePoint && codePoint <= 0x3FFFD) + ) + ) { + return true; + } + + return false; +}; + +module.exports = isFullwidthCodePoint; +module.exports.default = isFullwidthCodePoint; diff --git a/node_modules/is-fullwidth-code-point/license b/node_modules/is-fullwidth-code-point/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/node_modules/is-fullwidth-code-point/package.json b/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 0000000..2137e88 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,42 @@ +{ + "name": "is-fullwidth-code-point", + "version": "3.0.0", + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "license": "MIT", + "repository": "sindresorhus/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "string", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/is-fullwidth-code-point/readme.md b/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 0000000..4236bba --- /dev/null +++ b/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt(0)); +//=> true + +isFullwidthCodePoint('a'.codePointAt(0)); +//=> false +``` + + +## API + +### isFullwidthCodePoint(codePoint) + +#### codePoint + +Type: `number` + +The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100644 index 0000000..740724b --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,206 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +### Default behavior + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob('abc/?.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +### Option strict + +When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that +some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js', {strict: false}); +isGlob('*.js', {strict: false}); +isGlob('**/abc.js', {strict: false}); +isGlob('abc/*.js', {strict: false}); +isGlob('abc/(aaa|bbb).js', {strict: false}); +isGlob('abc/[a-z].js', {strict: false}); +isGlob('abc/{a,b}.js', {strict: false}); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js', {strict: false}); +isGlob('abc/!(a).js', {strict: false}); +isGlob('abc/+(a).js', {strict: false}); +isGlob('abc/*(a).js', {strict: false}); +isGlob('abc/?(a).js', {strict: false}); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('\\!foo.js', {strict: false}); +isGlob('\\*.js', {strict: false}); +isGlob('\\*\\*/abc.js', {strict: false}); +isGlob('abc/\\*.js', {strict: false}); +isGlob('abc/\\(aaa|bbb).js', {strict: false}); +isGlob('abc/\\[a-z].js', {strict: false}); +isGlob('abc/\\{a,b}.js', {strict: false}); +//=> false +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100644 index 0000000..620f563 --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,150 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = require('is-extglob'); +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); +}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100644 index 0000000..858af03 --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/is-glob", + "bugs": { + "url": "https://github.com/micromatch/is-glob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha && node benchmark.js" + }, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + } +} diff --git a/node_modules/is-json/.npmignore b/node_modules/is-json/.npmignore new file mode 100644 index 0000000..b0e8ee7 --- /dev/null +++ b/node_modules/is-json/.npmignore @@ -0,0 +1,12 @@ +.*.swp +._* +.DS_Store +.git +.hg +.lock-wscript +.svn +.wafpickle-* +CVS +npm-debug.log +*.sublime-project +*.sublime-workspace \ No newline at end of file diff --git a/node_modules/is-json/.travis.yml b/node_modules/is-json/.travis.yml new file mode 100644 index 0000000..250e5ab --- /dev/null +++ b/node_modules/is-json/.travis.yml @@ -0,0 +1,14 @@ + language: node_js + node_js: + - "0.12" + - "0.10" + - "0.8" + branches: + only: + - master + notifications: + email: + - joaquim.serafim@gmail.com + script: npm test + before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/is-json/LICENSE b/node_modules/is-json/LICENSE new file mode 100644 index 0000000..7773e29 --- /dev/null +++ b/node_modules/is-json/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Joaquim José F. Serafim + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/is-json/README.md b/node_modules/is-json/README.md new file mode 100644 index 0000000..2fea1b4 --- /dev/null +++ b/node_modules/is-json/README.md @@ -0,0 +1,41 @@ +# is-json + + + +[![Build Status](https://travis-ci.org/joaquimserafim/is-json.png?branch=master)](https://travis-ci.org/joaquimserafim/is-json) + + +check if a string is a valid JSON string without using Try/Catch and is a JSON object + + + +**V1.2** + + +isJSON(str*, [passObjects=bool]) + +*with `passObjects = true` can pass a JSON object in `str`, default to `false` + + + var isJSON = require('is-json'); + + var good_json = '{"a":"obja","b":[0,1,2],"c":{"d":"some object"}}'; + var bad_json = '{"a":"obja""b":[0,1,2],"c":{"d":"some object"}}'; + var str_number = '121212'; + + + console.log(isJSON(good_json)); // true + console.log(isJSON(bad_json)); // false + console.log(isJSON(str_number)); // false + + + + // check is an object + + var object = {a: 12, b: [1,2,3]}; + + console.log(isJSON(object, true)); // true + + // can use isJSON.strict (uses try/catch) if wants something more robust + + console.log(isJSON.strict('{\n "config": 123,\n "test": "abcde" \n}')); // true diff --git a/node_modules/is-json/index.js b/node_modules/is-json/index.js new file mode 100644 index 0000000..2a09a3a --- /dev/null +++ b/node_modules/is-json/index.js @@ -0,0 +1,48 @@ +'use strict' + +module.exports = isJSON; +isJSON.strict = strict; + +function isJSON (str, pass_object) { + if (pass_object && isObject(str)) return true; + + if (!isString(str)) return false; + + str = str.replace(/\s/g, '').replace(/\n|\r/, ''); + + if (/^\{(.*?)\}$/.test(str)) + return /"(.*?)":(.*?)/g.test(str); + + if (/^\[(.*?)\]$/.test(str)) { + return str.replace(/^\[/, '') + .replace(/\]$/, '') + .replace(/},{/g, '}\n{') + .split(/\n/) + .map(function (s) { return isJSON(s); }) + .reduce(function (prev, curr) { return !!curr; }); + } + + return false; +} + + +function strict (str) { + if (isObject(str)) { + return true; + } + + try { + return JSON.parse(str) && true; + } catch (ex) { + return false; + } +} + +function isString (x) { + return Object.prototype.toString.call(x) === '[object String]'; +} + +function isObject (obj) { + return Object.prototype.toString.call(obj) === '[object Object]'; +} + diff --git a/node_modules/is-json/package.json b/node_modules/is-json/package.json new file mode 100644 index 0000000..75ac1af --- /dev/null +++ b/node_modules/is-json/package.json @@ -0,0 +1,29 @@ +{ + "name": "is-json", + "version": "2.0.1", + "description": "check if a string is a valid JSON string without using Try/Catch", + "main": "index.js", + "directories": { + "test": "test" + }, + "scripts": { + "test": "node test" + }, + "repository": { + "type": "git", + "url": "git@github.com:joaquimserafim/is-json.git" + }, + "keywords": [ + "JSON", + "validation" + ], + "author": "@joaquimserafim", + "license": "ISC", + "bugs": { + "url": "https://github.com/joaquimserafim/is-json/issues" + }, + "homepage": "https://github.com/joaquimserafim/is-json", + "devDependencies": { + "tape": "^2.13.1" + } +} diff --git a/node_modules/is-json/test/index.js b/node_modules/is-json/test/index.js new file mode 100644 index 0000000..134d614 --- /dev/null +++ b/node_modules/is-json/test/index.js @@ -0,0 +1,33 @@ +var test = require('tape'); +var isJSON = require('../'); + + +test('performe isJSON verifications', function (assert) { + assert.deepEqual(isJSON('asdada[]asdadada sd asdasda das das'), false, '`asdada[]asdadada sd asdasda das das`, should return false'); + assert.deepEqual(isJSON(null), false, '`null`, should return false'); + assert.deepEqual(isJSON(false), false, '`false`, should return false'); + assert.deepEqual(isJSON(''), false, '`\'\'`, should return false'); + assert.deepEqual(isJSON('normal string'), false, '\'normal string\', should return false'); + assert.deepEqual(isJSON(2014), false, '`2014`, should return false'); + assert.deepEqual(isJSON(2014.5), false, '`2014.5`, should return false'); + assert.deepEqual(isJSON([1,2,3,4]), false, '`[1,2,3,4]`, should return false'); + assert.deepEqual(isJSON({a: 12, b: [1,2,3]}), false, 'a JSON object `{a: 12, b: [1,2,3]},`, should return false'); + assert.deepEqual(isJSON({a: 12, b: [1,2,3]}, true), true, + 'a JSON object `{a: 12, b: [1,2,3]}` but pass the 2 arg as true (check objects too), should return true'); + assert.deepEqual(isJSON('{"a":"obja","b":[0,1,2],"c":{"d":"some object"}}'), true, + '`{"a":"obja","b":[0,1,2],"c":{"d":"some object"}}`, should return true'); + assert.deepEqual(isJSON('1,2,3'), false, '`1,2,3`, should return false'); + assert.deepEqual(isJSON('{1,2,3}'), false, '`{1,2,3}`, should return false'); + assert.deepEqual(isJSON('[{"a": 123}, {1,2,3}}]'), false, '`[{"a": 123, {1,2,3}}]`, should return false'); + var cobj = '[{"a": {"aa": [1,2,3,4], "aaa": {"d": 1212}}}, {"b": "test", "c": [1,2,3], "date": "' + new Date() + '"}]'; + + assert.deepEqual(isJSON(cobj), true, cobj + ', should return true'); + assert.deepEqual(isJSON(new Date()), false, '`Date`, should return false'); + assert.deepEqual(isJSON.strict('{\n "config": 123,\n "test": "abcde" \n}'), true, '`{\n "config": 123,\n "test": "abcde" \n}`, should return true'); + assert.deepEqual( + isJSON.strict({a: 1}), + true, + 'should return true when passing a js object into `strict`' + ); + assert.end(); +}); diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE new file mode 100644 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +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. diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md new file mode 100644 index 0000000..eb8149e --- /dev/null +++ b/node_modules/is-number/README.md @@ -0,0 +1,187 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a finite number. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Why is this needed? + +In JavaScript, it's not always as straightforward as it should be to reliably check if a value is a number. It's common for devs to use `+`, `-`, or `Number()` to cast a string value to a number (for example, when values are returned from user input, regex matches, parsers, etc). But there are many non-intuitive edge cases that yield unexpected results: + +```js +console.log(+[]); //=> 0 +console.log(+''); //=> 0 +console.log(+' '); //=> 0 +console.log(typeof NaN); //=> 'number' +``` + +This library offers a performant way to smooth out edge cases like these. + +## Usage + +```js +const isNumber = require('is-number'); +``` + +See the [tests](./test.js) for more examples. + +### true + +```js +isNumber(5e3); // true +isNumber(0xff); // true +isNumber(-1.1); // true +isNumber(0); // true +isNumber(1); // true +isNumber(1.1); // true +isNumber(10); // true +isNumber(10.10); // true +isNumber(100); // true +isNumber('-1.1'); // true +isNumber('0'); // true +isNumber('012'); // true +isNumber('0xff'); // true +isNumber('1'); // true +isNumber('1.1'); // true +isNumber('10'); // true +isNumber('10.10'); // true +isNumber('100'); // true +isNumber('5e3'); // true +isNumber(parseInt('012')); // true +isNumber(parseFloat('012')); // true +``` + +### False + +Everything else is false, as you would expect: + +```js +isNumber(Infinity); // false +isNumber(NaN); // false +isNumber(null); // false +isNumber(undefined); // false +isNumber(''); // false +isNumber(' '); // false +isNumber('foo'); // false +isNumber([1]); // false +isNumber([]); // false +isNumber(function () {}); // false +isNumber({}); // false +``` + +## Release history + +### 7.0.0 + +* Refactor. Now uses `.isFinite` if it exists. +* Performance is about the same as v6.0 when the value is a string or number. But it's now 3x-4x faster when the value is not a string or number. + +### 6.0.0 + +* Optimizations, thanks to @benaadams. + +### 5.0.0 + +**Breaking changes** + +* removed support for `instanceof Number` and `instanceof String` + +## Benchmarks + +As with all benchmarks, take these with a grain of salt. See the [benchmarks](./benchmark/index.js) for more detail. + +``` +# all +v7.0 x 413,222 ops/sec ±2.02% (86 runs sampled) +v6.0 x 111,061 ops/sec ±1.29% (85 runs sampled) +parseFloat x 317,596 ops/sec ±1.36% (86 runs sampled) +fastest is 'v7.0' + +# string +v7.0 x 3,054,496 ops/sec ±1.05% (89 runs sampled) +v6.0 x 2,957,781 ops/sec ±0.98% (88 runs sampled) +parseFloat x 3,071,060 ops/sec ±1.13% (88 runs sampled) +fastest is 'parseFloat,v7.0' + +# number +v7.0 x 3,146,895 ops/sec ±0.89% (89 runs sampled) +v6.0 x 3,214,038 ops/sec ±1.07% (89 runs sampled) +parseFloat x 3,077,588 ops/sec ±1.07% (87 runs sampled) +fastest is 'v6.0' +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 49 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [charlike-old](https://github.com/charlike-old) | +| 1 | [benaadams](https://github.com/benaadams) | +| 1 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 15, 2018._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js new file mode 100644 index 0000000..27f19b7 --- /dev/null +++ b/node_modules/is-number/index.js @@ -0,0 +1,18 @@ +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +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; +}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json new file mode 100644 index 0000000..3715072 --- /dev/null +++ b/node_modules/is-number/package.json @@ -0,0 +1,82 @@ +{ + "name": "is-number", + "description": "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.", + "version": "7.0.0", + "homepage": "https://github.com/jonschlinkert/is-number", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Olsten Larck (https://i.am.charlike.online)", + "Rouven Weßling (www.rouvenwessling.de)" + ], + "repository": "jonschlinkert/is-number", + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.12.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "keywords": [ + "cast", + "check", + "coerce", + "coercion", + "finite", + "integer", + "is", + "isnan", + "is-nan", + "is-num", + "is-number", + "isnumber", + "isfinite", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "parseFloat", + "parseInt", + "test", + "type", + "typeof", + "value" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "is-plain-object", + "is-primitive", + "isobject", + "kind-of" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/is-promise/LICENSE b/node_modules/is-promise/LICENSE new file mode 100644 index 0000000..27cc9f3 --- /dev/null +++ b/node_modules/is-promise/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/is-promise/index.js b/node_modules/is-promise/index.js new file mode 100644 index 0000000..1bed087 --- /dev/null +++ b/node_modules/is-promise/index.js @@ -0,0 +1,6 @@ +module.exports = isPromise; +module.exports.default = isPromise; + +function isPromise(obj) { + return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; +} diff --git a/node_modules/is-promise/index.mjs b/node_modules/is-promise/index.mjs new file mode 100644 index 0000000..bf9e99b --- /dev/null +++ b/node_modules/is-promise/index.mjs @@ -0,0 +1,3 @@ +export default function isPromise(obj) { + return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; +} diff --git a/node_modules/is-promise/package.json b/node_modules/is-promise/package.json new file mode 100644 index 0000000..d70c7d8 --- /dev/null +++ b/node_modules/is-promise/package.json @@ -0,0 +1,23 @@ +{ + "name": "is-promise", + "version": "2.2.2", + "description": "Test whether an object looks like a promises-a+ promise", + "main": "./index.js", + "scripts": { + "test": "mocha -R spec" + }, + "files": [ + "index.js", + "index.mjs" + ], + "repository": { + "type": "git", + "url": "https://github.com/then/is-promise.git" + }, + "author": "ForbesLindesay", + "license": "MIT", + "devDependencies": { + "better-assert": "^1.0.2", + "mocha": "~1.7.4" + } +} \ No newline at end of file diff --git a/node_modules/is-promise/readme.md b/node_modules/is-promise/readme.md new file mode 100644 index 0000000..d53d34b --- /dev/null +++ b/node_modules/is-promise/readme.md @@ -0,0 +1,33 @@ + + +# is-promise + + Test whether an object looks like a promises-a+ promise + + [![Build Status](https://img.shields.io/travis/then/is-promise/master.svg)](https://travis-ci.org/then/is-promise) + [![Dependency Status](https://img.shields.io/david/then/is-promise.svg)](https://david-dm.org/then/is-promise) + [![NPM version](https://img.shields.io/npm/v/is-promise.svg)](https://www.npmjs.org/package/is-promise) + + + +## Installation + + $ npm install is-promise + +You can also use it client side via npm. + +## API + +```typescript +import isPromise from 'is-promise'; + +isPromise(Promise.resolve());//=>true +isPromise({then:function () {...}});//=>true +isPromise(null);//=>false +isPromise({});//=>false +isPromise({then: true})//=>false +``` + +## License + + MIT diff --git a/node_modules/is-regex/.editorconfig b/node_modules/is-regex/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/is-regex/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/is-regex/.eslintignore b/node_modules/is-regex/.eslintignore new file mode 100644 index 0000000..404abb2 --- /dev/null +++ b/node_modules/is-regex/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/node_modules/is-regex/.eslintrc b/node_modules/is-regex/.eslintrc new file mode 100644 index 0000000..1f6f127 --- /dev/null +++ b/node_modules/is-regex/.eslintrc @@ -0,0 +1,19 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": [1], + "operator-linebreak": [2, "before"], + }, + + "overrides": [ + { + "files": ["test/**/*.js"], + "globals": { + "Proxy": false, + }, + }, + ], +} diff --git a/node_modules/is-regex/.nycrc b/node_modules/is-regex/.nycrc new file mode 100644 index 0000000..a69aa2d --- /dev/null +++ b/node_modules/is-regex/.nycrc @@ -0,0 +1,10 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test", + "test-corejs.js" + ] +} diff --git a/node_modules/is-regex/CHANGELOG.md b/node_modules/is-regex/CHANGELOG.md new file mode 100644 index 0000000..b7496b2 --- /dev/null +++ b/node_modules/is-regex/CHANGELOG.md @@ -0,0 +1,197 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.4](https://github.com/inspect-js/is-regex/compare/v1.1.3...v1.1.4) - 2021-08-05 + +### Commits + +- [Dev Deps] update `auto-changelog`, `core-js`, `eslint`, `tape` [`4b17cad`](https://github.com/inspect-js/is-regex/commit/4b17cad8496b1ae621b18335fa3afe94d0c65e83) +- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`2dad4af`](https://github.com/inspect-js/is-regex/commit/2dad4afffa15f07cbbf7675b77d1f650c92652c4) + +## [v1.1.3](https://github.com/inspect-js/is-regex/compare/v1.1.2...v1.1.3) - 2021-05-07 + +### Commits + +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`c681ab9`](https://github.com/inspect-js/is-regex/commit/c681ab99c07f8b3b7ae5f652b3105a30bce94f69) +- [Fix] do not use `Object.prototype.toString` when `Symbol.toStringTag` is shammed [`ca019fd`](https://github.com/inspect-js/is-regex/commit/ca019fdb828dc7d32e323213403ac9995d8604e3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`605a66f`](https://github.com/inspect-js/is-regex/commit/605a66f278900f1c8ae9d1dfcec31e5f61b10ad3) +- [readme] add actions and codecov badges [`8d7c6f0`](https://github.com/inspect-js/is-regex/commit/8d7c6f0e007bd982f21b958e0abc98b8a84e2a24) +- [meta] use `prepublishOnly` script for npm 7+ [`8e50e91`](https://github.com/inspect-js/is-regex/commit/8e50e91f51aa5038745526710ef2e030527982a7) +- [Deps] update `has-symbols` [`4742c81`](https://github.com/inspect-js/is-regex/commit/4742c81260c3db9a8c9ef57110981fb6175f58e0) + +## [v1.1.2](https://github.com/inspect-js/is-regex/compare/v1.1.1...v1.1.2) - 2021-02-01 + +### Commits + +- [Tests] migrate tests to Github Actions [`cc1686e`](https://github.com/inspect-js/is-regex/commit/cc1686e25f446ca6948f43b3f180d6e55e31fb4e) +- [readme] fix repo URLs; remove travis badge [`d1d1da6`](https://github.com/inspect-js/is-regex/commit/d1d1da647bb4e91589606f12470cd27a47b3bb81) +- [meta] do not publish github action workflow files [`9f84b99`](https://github.com/inspect-js/is-regex/commit/9f84b993a995f057b4d2d097ef47b1ff9c84115d) +- [Tests] run `nyc` on all tests [`c37aab9`](https://github.com/inspect-js/is-regex/commit/c37aab9d332c4834b08ada94736c45ab1d39cd2f) +- [Robustness] use `call-bind` [`fbb61bf`](https://github.com/inspect-js/is-regex/commit/fbb61bf3e19ccc178e6ed1e0d7ab9cc7c7167393) +- [actions] add "Allow Edits" workflow [`9022b53`](https://github.com/inspect-js/is-regex/commit/9022b53cb05b0f105cd179800cf96e055b249f08) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`d60f28f`](https://github.com/inspect-js/is-regex/commit/d60f28f7f2fb21dade7bce302b3e0246206423d3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`2c35c43`](https://github.com/inspect-js/is-regex/commit/2c35c437edf3eeb37129eea2404d8f465d27620f) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`1009e25`](https://github.com/inspect-js/is-regex/commit/1009e259d49a63753dc6e79e2b876a30c00c6de6) +- [meta] gitignore coverage output [`3b5fa9e`](https://github.com/inspect-js/is-regex/commit/3b5fa9ed2882c65ee81dff979f79f1a2751d3772) +- [actions] update workflows [`1843ef6`](https://github.com/inspect-js/is-regex/commit/1843ef65b8b8c24a44e91bc4ed5ee60dffc31c2d) + +## [v1.1.1](https://github.com/inspect-js/is-regex/compare/v1.1.0...v1.1.1) - 2020-08-03 + +### Commits + +- [Performance] Re-add lastIndex check to improve performance [`d8495cd`](https://github.com/inspect-js/is-regex/commit/d8495cd22d475ddca250818921b6088f631c1972) +- [Dev Deps] update `auto-changelog`, `eslint` [`778fa6b`](https://github.com/inspect-js/is-regex/commit/778fa6b9d2b182ee6d73993e103532855e956f85) + +## [v1.1.0](https://github.com/inspect-js/is-regex/compare/v1.0.5...v1.1.0) - 2020-06-03 + +### Commits + +- [New] use `badStringifier`‑based RegExp detection [`31eff67`](https://github.com/inspect-js/is-regex/commit/31eff673243d65c3d6c05848c0eb52f5380f1be3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`fc91458`](https://github.com/inspect-js/is-regex/commit/fc914588187b8bb00d8d792c84f06a6e15d883c1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`; add `safe-publish-latest` [`d43ed83`](https://github.com/inspect-js/is-regex/commit/d43ed83db54ea727bb0b1b77a50af79d1edb8a6d) +- [Dev Deps] update `auto-changelog`, `tape`; add `aud` [`56647d1`](https://github.com/inspect-js/is-regex/commit/56647d196be34ef3c118ad67726e75169fbcb875) +- [meta] only run `aud` on prod deps [`e0865b8`](https://github.com/inspect-js/is-regex/commit/e0865b8360b0ac1b9d17b7b81ae5f339e5c9036b) + +## [v1.0.5](https://github.com/inspect-js/is-regex/compare/v1.0.4...v1.0.5) - 2019-12-15 + +### Commits + +- [Tests] use shared travis-ci configs [`af728b2`](https://github.com/inspect-js/is-regex/commit/af728b21c5cc9e41234fb4015594bffdcfff597c) +- [Tests] remove `jscs` [`1b8cfe8`](https://github.com/inspect-js/is-regex/commit/1b8cfe8cfb14820c196775f19d370276e4034791) +- [meta] add `auto-changelog` [`c3131d8`](https://github.com/inspect-js/is-regex/commit/c3131d8ab5d06ea5fa05a4bb2ad28bbfb81668ad) +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`, `v4.8`; newer npm fails on older nodes [`660b658`](https://github.com/inspect-js/is-regex/commit/660b6585d1a9607dbdae879b70ce2f6a5684616c) +- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS [`7c25218`](https://github.com/inspect-js/is-regex/commit/7c25218d540ab17c18e4ae333677c5725806a778) +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`fa95547`](https://github.com/inspect-js/is-regex/commit/fa955478950a5ba0a920010d5daaa29487500b30) +- [meta] remove unused Makefile and associated utilities [`9fd2a29`](https://github.com/inspect-js/is-regex/commit/9fd2a29dc57ed125f3d61e94f6254a9dd8ee0044) +- [Tests] up to `node` `v11.3`, `v10.14`, `v8.14`, `v6.15` [`7f2ac41`](https://github.com/inspect-js/is-regex/commit/7f2ac41ef5dc4d53bfe2fb1c24486c688a2537bd) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`6fa2b0f`](https://github.com/inspect-js/is-regex/commit/6fa2b0fe171a5b02086a06679a92d989e83a8b8e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`697e1de`](https://github.com/inspect-js/is-regex/commit/697e1de1c9e69f08e591cc0040d81fdbbde6fe4e) +- [actions] add automatic rebasing / merge commit blocking [`ad86dc9`](https://github.com/inspect-js/is-regex/commit/ad86dc97a52e4f66fbfb3b8c9c78da3963588b54) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `nsp`, `replace`, `semver`, `tape` [`5c99c8e`](https://github.com/inspect-js/is-regex/commit/5c99c8e384d5ce2ef434be5853c301477cf35456) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `replace`, `semver`, `tape` [`bb63686`](https://github.com/inspect-js/is-regex/commit/bb63686a9d0fc586d121549cf484da95edec3b0a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config@`, `replace`, `semver`, `tape` [`ddf3670`](https://github.com/inspect-js/is-regex/commit/ddf36705e5f7bd29832721e4a23abf06195032c6) +- [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config` [`e7b5a62`](https://github.com/inspect-js/is-regex/commit/e7b5a626eef3b9648c7d52d4620ce2e2a98a9ab8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`c803db5`](https://github.com/inspect-js/is-regex/commit/c803db5cd94cf9e0a559617adbc1e4c9d22007ff) +- [Tests] switch from `nsp` to `npm audit` [`b7239be`](https://github.com/inspect-js/is-regex/commit/b7239be9da263a0f7066f79d087eaf700a9613e9) +- [Dev Deps] update `eslint`, `nsp`, `semver`, `tape` [`347ee6c`](https://github.com/inspect-js/is-regex/commit/347ee6c67ba0f56b03f21a5abe743658f6515963) +- Only apps should have lockfiles. [`3866575`](https://github.com/inspect-js/is-regex/commit/38665755ecf028061f15816059e26023890a0dc7) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`d099a39`](https://github.com/inspect-js/is-regex/commit/d099a3943eb7e156a3e64fb8b74e11d7c83a4bec) +- [meta] add `funding` field [`741aecd`](https://github.com/inspect-js/is-regex/commit/741aecd92cd49868b3606c8cc99ce299e5f3c7d5) +- [Tests] use `eclint` instead of `editorconfig-tools` [`bc6aa75`](https://github.com/inspect-js/is-regex/commit/bc6aa7539e506788709b96f7bf3d7549850a81c3) +- [Tests] on `node` `v10.1` [`262226f`](https://github.com/inspect-js/is-regex/commit/262226f08fa34dff9a8dffd16daabb3dc6e262eb) +- [Dev Deps] update `eslint` [`31fd719`](https://github.com/inspect-js/is-regex/commit/31fd719dd59a6111ca710cdb0d19a8adadf9b8c6) +- [Deps] update `has` [`e9e25a3`](https://github.com/inspect-js/is-regex/commit/e9e25a3de7e89faaa6aadf5010477074140e8218) +- [Dev Deps] update `replace` [`aeeb968`](https://github.com/inspect-js/is-regex/commit/aeeb968bf5a4fc07f0fa6905f2c699fc563b6c32) +- [Tests] set audit level [`2a6290e`](https://github.com/inspect-js/is-regex/commit/2a6290e78b58bf14b734d7998fe53b4a84db5e44) +- [Tests] remove `nsp` [`fc74c2b`](https://github.com/inspect-js/is-regex/commit/fc74c2bb6970a7f3280abe6eff3b492d77d89c9f) + +## [v1.0.4](https://github.com/inspect-js/is-regex/compare/v1.0.3...v1.0.4) - 2017-02-18 + +### Fixed + +- [Fix] ensure that `lastIndex` is not mutated [`#3`](https://github.com/inspect-js/is-regex/issues/3) + +### Commits + +- Update `eslint`, `tape`, `semver`; use my personal shared `eslint` config [`c4a41c3`](https://github.com/inspect-js/is-regex/commit/c4a41c3a8203a3919b01cd0d1b577daadf30a452) +- [Tests] on all node minors; improve test matrix [`58d7508`](https://github.com/inspect-js/is-regex/commit/58d7508a36eb92bd76717486b9e78bde502ffe3e) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`7290076`](https://github.com/inspect-js/is-regex/commit/729007606e9ed162953d1f5812c37eb06c554ec2) +- Update `covert`, `jscs`, `eslint`, `semver` [`dabc729`](https://github.com/inspect-js/is-regex/commit/dabc729cfc4458264c6f7642004d41dd5c214bfd) +- Update `eslint` [`a946b05`](https://github.com/inspect-js/is-regex/commit/a946b051159396b4311c564880f96e3d00e8b8e2) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`1744dde`](https://github.com/inspect-js/is-regex/commit/1744dde77526841f216fa2c1c866c5a82b1638c0) +- [Refactor] when try/catch is needed, bail early if the value lacks an own `lastIndex` data property. [`288ad93`](https://github.com/inspect-js/is-regex/commit/288ad93dbfed9f6828de20de67105ee6d6504425) +- Update `editorconfig-tools`, `eslint`, `semver`, `replace` [`4d895c6`](https://github.com/inspect-js/is-regex/commit/4d895c68a0cdbb5803185928963c15147aad0404) +- Update `eslint`, `tape`, `semver` [`f387f03`](https://github.com/inspect-js/is-regex/commit/f387f03b260b56372bfca301d4e79c4067633854) +- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. [`55e480f`](https://github.com/inspect-js/is-regex/commit/55e480f407cafb6c21a6c32aef04ccaa3ba4216c) +- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`89d9528`](https://github.com/inspect-js/is-regex/commit/89d95285b364913ebcd8ac7e0872570fe009a5d3) +- [Dev Deps] update `jscs` [`eb222a8`](https://github.com/inspect-js/is-regex/commit/eb222a8435e59909354f3700fd4880e4ce1cb13e) +- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`c65429c`](https://github.com/inspect-js/is-regex/commit/c65429cea0366508c10ad2ab773af7b83a34fc81) +- Update `nsp`, `eslint` [`c60fbd8`](https://github.com/inspect-js/is-regex/commit/c60fbd8680f7fb3508ec3c5be8ebb788672516c8) +- Update `eslint`, `semver` [`6a62116`](https://github.com/inspect-js/is-regex/commit/6a621168c63616bf004ca8b1f885b4eb8a58a3e5) +- [Tests] on `node` `v7.5`, `v4.7` [`e764651`](https://github.com/inspect-js/is-regex/commit/e764651336f5da5e239e9fe8869f3a3201c19d2b) +- Test up to `io.js` `v2.1` [`3bf326a`](https://github.com/inspect-js/is-regex/commit/3bf326a9bcd530fd16c9fc806e249a68e25ab7e3) +- Test on the latest `io.js` versions. [`693d047`](https://github.com/inspect-js/is-regex/commit/693d0477631c5d7671f6c99eca5594ffffa75771) +- [Refactor] use an early return instead of a ternary. [`31eaca2`](https://github.com/inspect-js/is-regex/commit/31eaca28b7d0aaac0599fe7a569b93b842f8ab16) +- Test on `io.js` `v2.2` [`c18c55a`](https://github.com/inspect-js/is-regex/commit/c18c55aee6358d70531f935e98851e42b698d93c) +- Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures. [`a1c237d`](https://github.com/inspect-js/is-regex/commit/a1c237d35f880fe0bcbc9275254611a6a2300aaf) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`aa3ea0f`](https://github.com/inspect-js/is-regex/commit/aa3ea0f148af31d75f7ef8a800412729d82def04) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`d97831d`](https://github.com/inspect-js/is-regex/commit/d97831d0e2ccd3d00d1f7354b7f81e2575f90953) +- [Dev Deps] Update `tape`, `eslint` [`95e6def`](https://github.com/inspect-js/is-regex/commit/95e6defe3178c45dc9df16e474e558979d5f5c05) +- Update `eslint`, `nsp` [`3844c93`](https://github.com/inspect-js/is-regex/commit/3844c935cfe7c52fae0dc74d27e884c417cb4616) +- Update `tape`, `jscs` [`0d6dac8`](https://github.com/inspect-js/is-regex/commit/0d6dac818ed251910171965932f021291919e770) +- Fix tests for faked @@toStringTag [`2ebef9f`](https://github.com/inspect-js/is-regex/commit/2ebef9f0759843e9a063de7a512b46e3e7daea7e) +- Test up to `io.js` `v3.0` [`ec1d2d4`](https://github.com/inspect-js/is-regex/commit/ec1d2d44481fa0fa11448527da8030c99fe47a12) +- [Refactor] bail earlier when the value is falsy. [`a9e333e`](https://github.com/inspect-js/is-regex/commit/a9e333e2ac8912ca05b7e31d30e4eea683c0da4b) +- [Dev Deps] update `tape` [`8cdcaae`](https://github.com/inspect-js/is-regex/commit/8cdcaae07be8c790cdb99849e6076ea7702a4c84) +- Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`281c4ef`](https://github.com/inspect-js/is-regex/commit/281c4efeb71c86dd380e741bcaee3f7dbf956151) +- Test on `io.js` `v2.4` [`4d54c68`](https://github.com/inspect-js/is-regex/commit/4d54c68a81b5332a3b76259d8aa8f514be5efd13) +- Test on `io.js` `v2.3` [`23170f5`](https://github.com/inspect-js/is-regex/commit/23170f5cae632d0377de73bd2febc53db8aebbc9) +- Test on `iojs-v1.6` [`4487ad0`](https://github.com/inspect-js/is-regex/commit/4487ad0194a5684223bfa2690da4e0a441f7132a) + +## [v1.0.3](https://github.com/inspect-js/is-regex/compare/v1.0.2...v1.0.3) - 2015-01-29 + +### Commits + +- Update npm run scripts. [`dc528dd`](https://github.com/inspect-js/is-regex/commit/dc528dd25e775089bc0a3f5a8f7ae7ffc4cdf52a) +- Add toStringTag tests. [`f48a83a`](https://github.com/inspect-js/is-regex/commit/f48a83a78720b78ab60ca586c16f6f3dbcfec825) +- If @@toStringTag is not present, use the old-school Object#toString test. [`50b0ffd`](https://github.com/inspect-js/is-regex/commit/50b0ffd9c7fdbd54aee8cde1b07e680ae84f6a0d) + +## [v1.0.2](https://github.com/inspect-js/is-regex/compare/v1.0.1...v1.0.2) - 2015-01-29 + +### Commits + +- `make release` [`a1de7ec`](https://github.com/inspect-js/is-regex/commit/a1de7eca4cecc8015fd27804669f8fc61bd16a68) +- Improve optimization by separating the try/catch, and bailing out early when not typeof "object". [`5ab7632`](https://github.com/inspect-js/is-regex/commit/5ab76322a348487fa8b16761e83f6824c3c27d11) + +## [v1.0.1](https://github.com/inspect-js/is-regex/compare/v1.0.0...v1.0.1) - 2015-01-28 + +### Commits + +- Using my standard jscs.json file [`1f1733a`](https://github.com/inspect-js/is-regex/commit/1f1733ac8433cdcceb25356f86b74136a4477cb9) +- Adding `npm run lint` [`51ea70f`](https://github.com/inspect-js/is-regex/commit/51ea70fa7e461d022f611c195f343ea8d0333d71) +- Use RegExp#exec to test if something is a regex, which works even with ES6 @@toStringTag. [`042c8c7`](https://github.com/inspect-js/is-regex/commit/042c8c734faade9015932b61f1e8ea4f3a93b1b3) +- Adding license and downloads badges [`366d619`](https://github.com/inspect-js/is-regex/commit/366d61965d3a4119126e78e09b2166bbcddd0c5a) +- Use SVG badges instead of PNG [`6a32e4f`](https://github.com/inspect-js/is-regex/commit/6a32e4fc87d7d3a3787b800dd033c9293aead6df) +- Update `tape`, `jscs` [`f1b9462`](https://github.com/inspect-js/is-regex/commit/f1b9462f86d1b69de07176e7f277f668757ba964) +- Update `jscs` [`1bff23f`](https://github.com/inspect-js/is-regex/commit/1bff23ff0fe88c8263e8bf04cf99e290af96d5b0) +- Update `tape`, `jscs` [`c22ea2e`](https://github.com/inspect-js/is-regex/commit/c22ea2e7967f45618deed01ff5ea483f918be216) +- Update `tape`, `jscs` [`b0479db`](https://github.com/inspect-js/is-regex/commit/b0479db99a1b1b872d1618fb0a71f0c74a78b29b) +- Use consistent quotes [`1a6e347`](https://github.com/inspect-js/is-regex/commit/1a6e34730d9270f3f20519139faa4c4e6ec2e1f5) +- Make travis builds faster. [`090a4ea`](https://github.com/inspect-js/is-regex/commit/090a4ea7c5fa709d108d596e3bc304e6ce973dec) +- Update `tape` [`7d76129`](https://github.com/inspect-js/is-regex/commit/7d7612928bdd43230fbd835db71797249ca24f35) +- Lock covert to v1.0.0. [`9a90b03`](https://github.com/inspect-js/is-regex/commit/9a90b03fb390e66f874223a34c58ba2bb109edd3) +- Updating tape [`bfbc7f5`](https://github.com/inspect-js/is-regex/commit/bfbc7f593a007acd0411152bbb55f724dc4ca935) +- Updating jscs [`13ad511`](https://github.com/inspect-js/is-regex/commit/13ad511d80cd67300c2c0c5387fc4b3b423e2768) +- Updating jscs [`cda1945`](https://github.com/inspect-js/is-regex/commit/cda1945d603dfe99e24d5a909a931d366451bc4d) +- Updating jscs [`de96c99`](https://github.com/inspect-js/is-regex/commit/de96c99d4bf5787df671de6df9138b6547a6545b) +- Running linter as part of tests [`2cb6567`](https://github.com/inspect-js/is-regex/commit/2cb656733b1ed0af14ad11fb584006d22de0c69d) +- Updating covert [`a56ae74`](https://github.com/inspect-js/is-regex/commit/a56ae74ec8d5f0473295a8b10519a18580f16624) +- Updating tape [`ffe47f7`](https://github.com/inspect-js/is-regex/commit/ffe47f7fe9cf6d16896b4bdc286bd1d0805d5c49) + +## [v1.0.0](https://github.com/inspect-js/is-regex/compare/v0.0.0...v1.0.0) - 2014-05-19 + +### Commits + +- Make sure old and unstable nodes don't break Travis [`05da747`](https://github.com/inspect-js/is-regex/commit/05da7478f960dc131ec3ad864e27e8c6b7d74a80) +- toString is a reserved var name in old Opera [`885c48c`](https://github.com/inspect-js/is-regex/commit/885c48c120f921a55f1842b0607d3e7875379821) +- Updating deps [`2ca0e79`](https://github.com/inspect-js/is-regex/commit/2ca0e79a2443ca34d85e8b2ea2e26f55855b74a7) +- Updating tape. [`9678435`](https://github.com/inspect-js/is-regex/commit/96784355611deb0c23b9064be774216d76e3e457) +- Updating covert [`c3bb898`](https://github.com/inspect-js/is-regex/commit/c3bb8985a422e3e0c81f9c43899b6c19a72c755f) +- Updating tape [`7811708`](https://github.com/inspect-js/is-regex/commit/78117089688258b8f939b397b37897b5b3e30f74) +- Testing on node 0.6 again [`dec36ae`](https://github.com/inspect-js/is-regex/commit/dec36ae58a39a3f80e832b702c3e19406363c160) +- Run code coverage as part of tests [`e6f4ebe`](https://github.com/inspect-js/is-regex/commit/e6f4ebec26894543747603f2cb360e839f2ca290) + +## v0.0.0 - 2014-01-15 + +### Commits + +- package.json [`aa60d43`](https://github.com/inspect-js/is-regex/commit/aa60d43d2c8adb9fdd47f5898e5e1e570bd238d8) +- read me [`861e944`](https://github.com/inspect-js/is-regex/commit/861e944de88e84010eaa662ea9ea9f17c90cff8c) +- Initial commit [`d0cdd71`](https://github.com/inspect-js/is-regex/commit/d0cdd71a637d8490b7ee3eaaf75c7e31d0f9242f) +- Tests. [`b533f74`](https://github.com/inspect-js/is-regex/commit/b533f741a88dff002790fb7af054b2a74e72d4da) +- Implementation. [`3c9a8c0`](https://github.com/inspect-js/is-regex/commit/3c9a8c06994003cdfffeb3620f251f4c4cae7755) +- Travis CI [`742c440`](https://github.com/inspect-js/is-regex/commit/742c4407015f9108875fd108fde137f5245e9e7a) diff --git a/node_modules/is-regex/LICENSE b/node_modules/is-regex/LICENSE new file mode 100644 index 0000000..47b7b50 --- /dev/null +++ b/node_modules/is-regex/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jordan Harband + +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. diff --git a/node_modules/is-regex/README.md b/node_modules/is-regex/README.md new file mode 100644 index 0000000..d61332b --- /dev/null +++ b/node_modules/is-regex/README.md @@ -0,0 +1,52 @@ +# is-regex [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Is this value a JS regex? +This module works cross-realm/iframe, and despite ES6 @@toStringTag. + +## Example + +```js +var isRegex = require('is-regex'); +var assert = require('assert'); + +assert.notOk(isRegex(undefined)); +assert.notOk(isRegex(null)); +assert.notOk(isRegex(false)); +assert.notOk(isRegex(true)); +assert.notOk(isRegex(42)); +assert.notOk(isRegex('foo')); +assert.notOk(isRegex(function () {})); +assert.notOk(isRegex([])); +assert.notOk(isRegex({})); + +assert.ok(isRegex(/a/g)); +assert.ok(isRegex(new RegExp('a', 'g'))); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-regex +[2]: https://versionbadg.es/inspect-js/is-regex.svg +[5]: https://david-dm.org/inspect-js/is-regex.svg +[6]: https://david-dm.org/inspect-js/is-regex +[7]: https://david-dm.org/inspect-js/is-regex/dev-status.svg +[8]: https://david-dm.org/inspect-js/is-regex#info=devDependencies +[11]: https://nodei.co/npm/is-regex.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/is-regex.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/is-regex.svg +[downloads-url]: https://npm-stat.com/charts.html?package=is-regex +[codecov-image]: https://codecov.io/gh/inspect-js/is-regex/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/is-regex/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-regex +[actions-url]: https://github.com/inspect-js/is-regex/actions diff --git a/node_modules/is-regex/index.js b/node_modules/is-regex/index.js new file mode 100644 index 0000000..19780f4 --- /dev/null +++ b/node_modules/is-regex/index.js @@ -0,0 +1,58 @@ +'use strict'; + +var callBound = require('call-bind/callBound'); +var hasToStringTag = require('has-tostringtag/shams')(); +var has; +var $exec; +var isRegexMarker; +var badStringifier; + +if (hasToStringTag) { + has = callBound('Object.prototype.hasOwnProperty'); + $exec = callBound('RegExp.prototype.exec'); + isRegexMarker = {}; + + var throwRegexMarker = function () { + throw isRegexMarker; + }; + badStringifier = { + toString: throwRegexMarker, + valueOf: throwRegexMarker + }; + + if (typeof Symbol.toPrimitive === 'symbol') { + badStringifier[Symbol.toPrimitive] = throwRegexMarker; + } +} + +var $toString = callBound('Object.prototype.toString'); +var gOPD = Object.getOwnPropertyDescriptor; +var regexClass = '[object RegExp]'; + +module.exports = hasToStringTag + // eslint-disable-next-line consistent-return + ? function isRegex(value) { + if (!value || typeof value !== 'object') { + return false; + } + + var descriptor = gOPD(value, 'lastIndex'); + var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); + if (!hasLastIndexDataProperty) { + return false; + } + + try { + $exec(value, badStringifier); + } catch (e) { + return e === isRegexMarker; + } + } + : function isRegex(value) { + // In older browsers, typeof regex incorrectly returns 'function' + if (!value || (typeof value !== 'object' && typeof value !== 'function')) { + return false; + } + + return $toString(value) === regexClass; + }; diff --git a/node_modules/is-regex/package.json b/node_modules/is-regex/package.json new file mode 100644 index 0000000..094fd41 --- /dev/null +++ b/node_modules/is-regex/package.json @@ -0,0 +1,86 @@ +{ + "name": "is-regex", + "version": "1.1.4", + "description": "Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag", + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "main": "index.js", + "scripts": { + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only && npm run test:harmony", + "tests-only": "nyc node test", + "test:harmony": "nyc node --harmony --es-staging test", + "test:corejs": "nyc tape test-corejs.js", + "posttest": "npx aud --production", + "lint": "eslint .", + "eccheck": "eclint check *.js **/*.js > /dev/null", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/is-regex.git" + }, + "bugs": { + "url": "https://github.com/inspect-js/is-regex/issues" + }, + "homepage": "https://github.com/inspect-js/is-regex", + "keywords": [ + "regex", + "regexp", + "is", + "regular expression", + "regular", + "expression" + ], + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "devDependencies": { + "@ljharb/eslint-config": "^17.6.0", + "aud": "^1.1.5", + "auto-changelog": "^2.3.0", + "core-js": "^3.16.0", + "eclint": "^2.8.1", + "eslint": "^7.32.0", + "foreach": "^2.0.5", + "nyc": "^10.3.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.3.0" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + } +} diff --git a/node_modules/is-regex/test/index.js b/node_modules/is-regex/test/index.js new file mode 100644 index 0000000..f6c0802 --- /dev/null +++ b/node_modules/is-regex/test/index.js @@ -0,0 +1,104 @@ +'use strict'; + +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('foreach'); +var test = require('tape'); +var isRegex = require('..'); + +test('not regexes', function (t) { + t.notOk(isRegex(), 'undefined is not regex'); + t.notOk(isRegex(null), 'null is not regex'); + t.notOk(isRegex(false), 'false is not regex'); + t.notOk(isRegex(true), 'true is not regex'); + t.notOk(isRegex(42), 'number is not regex'); + t.notOk(isRegex('foo'), 'string is not regex'); + t.notOk(isRegex([]), 'array is not regex'); + t.notOk(isRegex({}), 'object is not regex'); + t.notOk(isRegex(function () {}), 'function is not regex'); + t.end(); +}); + +test('@@toStringTag', { skip: !hasToStringTag }, function (t) { + var regex = /a/g; + var fakeRegex = { + toString: function () { return String(regex); }, + valueOf: function () { return regex; } + }; + fakeRegex[Symbol.toStringTag] = 'RegExp'; + t.notOk(isRegex(fakeRegex), 'fake RegExp with @@toStringTag "RegExp" is not regex'); + t.end(); +}); + +test('regexes', function (t) { + t.ok(isRegex(/a/g), 'regex literal is regex'); + t.ok(isRegex(new RegExp('a', 'g')), 'regex object is regex'); + t.end(); +}); + +test('does not mutate regexes', function (t) { + t.test('lastIndex is a marker object', function (st) { + var regex = /a/; + var marker = {}; + regex.lastIndex = marker; + st.equal(regex.lastIndex, marker, 'lastIndex is the marker object'); + st.ok(isRegex(regex), 'is regex'); + st.equal(regex.lastIndex, marker, 'lastIndex is the marker object after isRegex'); + st.end(); + }); + + t.test('lastIndex is nonzero', function (st) { + var regex = /a/; + regex.lastIndex = 3; + st.equal(regex.lastIndex, 3, 'lastIndex is 3'); + st.ok(isRegex(regex), 'is regex'); + st.equal(regex.lastIndex, 3, 'lastIndex is 3 after isRegex'); + st.end(); + }); + + t.end(); +}); + +test('does not perform operations observable to Proxies', { skip: typeof Proxy !== 'function' }, function (t) { + var Handler = function () { + this.trapCalls = []; + }; + + forEach([ + 'defineProperty', + 'deleteProperty', + 'get', + 'getOwnPropertyDescriptor', + 'getPrototypeOf', + 'has', + 'isExtensible', + 'ownKeys', + 'preventExtensions', + 'set', + 'setPrototypeOf' + ], function (trapName) { + Handler.prototype[trapName] = function () { + this.trapCalls.push(trapName); + return Reflect[trapName].apply(Reflect, arguments); + }; + }); + + t.test('proxy of object', function (st) { + var handler = new Handler(); + var proxy = new Proxy({ lastIndex: 0 }, handler); + + st.equal(isRegex(proxy), false, 'proxy of plain object is not regex'); + st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered'); + st.end(); + }); + + t.test('proxy of RegExp instance', function (st) { + var handler = new Handler(); + var proxy = new Proxy(/a/, handler); + + st.equal(isRegex(proxy), false, 'proxy of RegExp instance is not regex'); + st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered'); + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/isexe/.npmignore b/node_modules/isexe/.npmignore new file mode 100644 index 0000000..c1cb757 --- /dev/null +++ b/node_modules/isexe/.npmignore @@ -0,0 +1,2 @@ +.nyc_output/ +coverage/ diff --git a/node_modules/isexe/LICENSE b/node_modules/isexe/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/isexe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md new file mode 100644 index 0000000..35769e8 --- /dev/null +++ b/node_modules/isexe/README.md @@ -0,0 +1,51 @@ +# isexe + +Minimal module to check if a file is executable, and a normal file. + +Uses `fs.stat` and tests against the `PATHEXT` environment variable on +Windows. + +## USAGE + +```javascript +var isexe = require('isexe') +isexe('some-file-name', function (err, isExe) { + if (err) { + console.error('probably file does not exist or something', err) + } else if (isExe) { + console.error('this thing can be run') + } else { + console.error('cannot be run') + } +}) + +// same thing but synchronous, throws errors +var isExe = isexe.sync('some-file-name') + +// treat errors as just "not executable" +isexe('maybe-missing-file', { ignoreErrors: true }, callback) +var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) +``` + +## API + +### `isexe(path, [options], [callback])` + +Check if the path is executable. If no callback provided, and a +global `Promise` object is available, then a Promise will be returned. + +Will raise whatever errors may be raised by `fs.stat`, unless +`options.ignoreErrors` is set to true. + +### `isexe.sync(path, [options])` + +Same as `isexe` but returns the value and throws any errors raised. + +### Options + +* `ignoreErrors` Treat all errors as "no, this is not executable", but + don't raise them. +* `uid` Number to use as the user id +* `gid` Number to use as the group id +* `pathExt` List of path extensions to use instead of `PATHEXT` + environment variable on Windows. diff --git a/node_modules/isexe/index.js b/node_modules/isexe/index.js new file mode 100644 index 0000000..553fb32 --- /dev/null +++ b/node_modules/isexe/index.js @@ -0,0 +1,57 @@ +var fs = require('fs') +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = require('./windows.js') +} else { + core = require('./mode.js') +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } + + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } + } + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} diff --git a/node_modules/isexe/mode.js b/node_modules/isexe/mode.js new file mode 100644 index 0000000..1995ea4 --- /dev/null +++ b/node_modules/isexe/mode.js @@ -0,0 +1,41 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} + +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} + +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid + + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() + + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g + + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json new file mode 100644 index 0000000..e452689 --- /dev/null +++ b/node_modules/isexe/package.json @@ -0,0 +1,31 @@ +{ + "name": "isexe", + "version": "2.0.0", + "description": "Minimal module to check if a file is executable.", + "main": "index.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.5.0", + "tap": "^10.3.0" + }, + "scripts": { + "test": "tap test/*.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/isexe.git" + }, + "keywords": [], + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" + }, + "homepage": "https://github.com/isaacs/isexe#readme" +} diff --git a/node_modules/isexe/test/basic.js b/node_modules/isexe/test/basic.js new file mode 100644 index 0000000..d926df6 --- /dev/null +++ b/node_modules/isexe/test/basic.js @@ -0,0 +1,221 @@ +var t = require('tap') +var fs = require('fs') +var path = require('path') +var fixture = path.resolve(__dirname, 'fixtures') +var meow = fixture + '/meow.cat' +var mine = fixture + '/mine.cat' +var ours = fixture + '/ours.cat' +var fail = fixture + '/fail.false' +var noent = fixture + '/enoent.exe' +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var isWindows = process.platform === 'win32' +var hasAccess = typeof fs.access === 'function' +var winSkip = isWindows && 'windows' +var accessSkip = !hasAccess && 'no fs.access function' +var hasPromise = typeof Promise === 'function' +var promiseSkip = !hasPromise && 'no global Promise' + +function reset () { + delete require.cache[require.resolve('../')] + return require('../') +} + +t.test('setup fixtures', function (t) { + rimraf.sync(fixture) + mkdirp.sync(fixture) + fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') + fs.chmodSync(meow, parseInt('0755', 8)) + fs.writeFileSync(fail, '#!/usr/bin/env false\n') + fs.chmodSync(fail, parseInt('0644', 8)) + fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') + fs.chmodSync(mine, parseInt('0744', 8)) + fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') + fs.chmodSync(ours, parseInt('0754', 8)) + t.end() +}) + +t.test('promise', { skip: promiseSkip }, function (t) { + var isexe = reset() + t.test('meow async', function (t) { + isexe(meow).then(function (is) { + t.ok(is) + t.end() + }) + }) + t.test('fail async', function (t) { + isexe(fail).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.test('noent async', function (t) { + isexe(noent).catch(function (er) { + t.ok(er) + t.end() + }) + }) + t.test('noent ignore async', function (t) { + isexe(noent, { ignoreErrors: true }).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.end() +}) + +t.test('no promise', function (t) { + global.Promise = null + var isexe = reset() + t.throws('try to meow a promise', function () { + isexe(meow) + }) + t.end() +}) + +t.test('access', { skip: accessSkip || winSkip }, function (t) { + runTest(t) +}) + +t.test('mode', { skip: winSkip }, function (t) { + delete fs.access + delete fs.accessSync + var isexe = reset() + t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) + t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) + runTest(t) +}) + +t.test('windows', function (t) { + global.TESTING_WINDOWS = true + var pathExt = '.EXE;.CAT;.CMD;.COM' + t.test('pathExt option', function (t) { + runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) + }) + t.test('pathExt env', function (t) { + process.env.PATHEXT = pathExt + runTest(t) + }) + t.test('no pathExt', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: '', skipFail: true }) + }) + t.test('pathext with empty entry', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: ';' + pathExt, skipFail: true }) + }) + t.end() +}) + +t.test('cleanup', function (t) { + rimraf.sync(fixture) + t.end() +}) + +function runTest (t, options) { + var isexe = reset() + + var optionsIgnore = Object.create(options || {}) + optionsIgnore.ignoreErrors = true + + if (!options || !options.skipFail) { + t.notOk(isexe.sync(fail, options)) + } + t.notOk(isexe.sync(noent, optionsIgnore)) + if (!options) { + t.ok(isexe.sync(meow)) + } else { + t.ok(isexe.sync(meow, options)) + } + + t.ok(isexe.sync(mine, options)) + t.ok(isexe.sync(ours, options)) + t.throws(function () { + isexe.sync(noent, options) + }) + + t.test('meow async', function (t) { + if (!options) { + isexe(meow, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } else { + isexe(meow, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } + }) + + t.test('mine async', function (t) { + isexe(mine, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + t.test('ours async', function (t) { + isexe(ours, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + if (!options || !options.skipFail) { + t.test('fail async', function (t) { + isexe(fail, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + } + + t.test('noent async', function (t) { + isexe(noent, options, function (er, is) { + t.ok(er) + t.notOk(is) + t.end() + }) + }) + + t.test('noent ignore async', function (t) { + isexe(noent, optionsIgnore, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.test('directory is not executable', function (t) { + isexe(__dirname, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.end() +} diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js new file mode 100644 index 0000000..3499673 --- /dev/null +++ b/node_modules/isexe/windows.js @@ -0,0 +1,42 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT + + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} diff --git a/node_modules/iso-639-1/.eslintrc b/node_modules/iso-639-1/.eslintrc new file mode 100644 index 0000000..1ae9ef8 --- /dev/null +++ b/node_modules/iso-639-1/.eslintrc @@ -0,0 +1,38 @@ +{ + // 基于 airbnb 规则 + "extends": "airbnb", + // 使用 babel 解析器,支持一些还没有进入 ES6+ 标准的特性。比如 class property + "parser": "babel-eslint", + // 解析 webpack alias 中的模块名 + "settings": { + "import/resolver": "webpack" + }, + "env": { + "browser": true + }, + "rules": { + "no-plusplus": [ + "error", + { + // 允许 for 循环中的 i++ + "allowForLoopAfterthoughts": true + } + ], + "no-param-reassign": [ + "error", + { + // 允许修改参数的属性 + "props": false + } + ], + // 允许在循环里使用 await + "no-await-in-loop": 0, + // 允许在一个表达式里使用多种操作符,否则与 prettier 冲突 + // see https://github.com/prettier/eslint-config-prettier#no-mixed-operators + "no-mixed-operators": 0, + // 允许在 jsx 中使用 bind + "react/jsx-no-bind": 0, + // 允许所有类型的 proptype + "react/forbid-prop-types": 0 + } +} \ No newline at end of file diff --git a/node_modules/iso-639-1/.nvmrc b/node_modules/iso-639-1/.nvmrc new file mode 100644 index 0000000..ddc9289 --- /dev/null +++ b/node_modules/iso-639-1/.nvmrc @@ -0,0 +1 @@ +14.17 \ No newline at end of file diff --git a/node_modules/iso-639-1/.prettierrc b/node_modules/iso-639-1/.prettierrc new file mode 100644 index 0000000..dcb7279 --- /dev/null +++ b/node_modules/iso-639-1/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "all" +} \ No newline at end of file diff --git a/node_modules/iso-639-1/.travis.yml b/node_modules/iso-639-1/.travis.yml new file mode 100644 index 0000000..734ba64 --- /dev/null +++ b/node_modules/iso-639-1/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - '8.0' + - '6.1' +script: + - npm run test \ No newline at end of file diff --git a/node_modules/iso-639-1/.vscode/settings.json b/node_modules/iso-639-1/.vscode/settings.json new file mode 100644 index 0000000..d563084 --- /dev/null +++ b/node_modules/iso-639-1/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "eslint.enable": true, + "eslint.packageManager": "yarn", + "prettier.eslintIntegration": true +} \ No newline at end of file diff --git a/node_modules/iso-639-1/CHANGELOG.md b/node_modules/iso-639-1/CHANGELOG.md new file mode 100644 index 0000000..965378b --- /dev/null +++ b/node_modules/iso-639-1/CHANGELOG.md @@ -0,0 +1,34 @@ +# iso-639-1 Changelog + +## v2.1.14 +- Bump async from 2.6.0 to 2.6.4 [#53](https://github.com/meikidd/iso-639-1/pull/53) +- Add a type to list the langage codes in the TS definition file [#55](https://github.com/meikidd/iso-639-1/pull/55) + +## v2.1.13 +- update Arabic native name [#50](https://github.com/meikidd/iso-639-1/pull/50) + +## v2.1.12 +- remove 'bh' [#51](https://github.com/meikidd/iso-639-1/pull/51) +- fj native name changed to "vosa Vakaviti" [#51](https://github.com/meikidd/iso-639-1/pull/51) +- dv native name changed to "ދިވެހި" [#51](https://github.com/meikidd/iso-639-1/pull/51) +- lo native name changed to "ພາສາລາວ" [#51](https://github.com/meikidd/iso-639-1/pull/51) +- ms native name changed to "Bahasa Melayu" [#51](https://github.com/meikidd/iso-639-1/pull/51) +- lu native name changed to "Kiluba" [#51](https://github.com/meikidd/iso-639-1/pull/51) +- na native name changed to "Dorerin Naoero" [#51](https://github.com/meikidd/iso-639-1/pull/51) +- tk native name changed to "Türkmençe" [#51](https://github.com/meikidd/iso-639-1/pull/51) + +## v2.1.11 +- Slovenian native name "slovenski jezik" -> "slovenščina" [#49](https://github.com/meikidd/iso-639-1/pull/49) + +## v2.1.10 +- Polish native name "język polski" -> "Polski" [#48](https://github.com/meikidd/iso-639-1/pull/48) + +## v2.1.9 +- Change hu native name "Magyar" -> "magyar" [#40](https://github.com/meikidd/iso-639-1/pull/40) + +## v2.1.8 +- Change hr native name "hrvatski jezik" -> "Hrvatski" +- Change sl English name "Slovene" -> "Slovenian" + +## v2.1.0 +- Correctly handle prototype property names passed as codes [#20](https://github.com/meikidd/iso-639-1/issues/20) \ No newline at end of file diff --git a/node_modules/iso-639-1/LICENSE b/node_modules/iso-639-1/LICENSE new file mode 100644 index 0000000..8e3035e --- /dev/null +++ b/node_modules/iso-639-1/LICENSE @@ -0,0 +1,21 @@ +This software is licensed under the MIT License. + +Copyright(c) by Mei Qingguang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/iso-639-1/build/index.js b/node_modules/iso-639-1/build/index.js new file mode 100644 index 0000000..f1fcbb1 --- /dev/null +++ b/node_modules/iso-639-1/build/index.js @@ -0,0 +1,1643 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["ISO6391"] = factory(); + else + root["ISO6391"] = factory(); +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/babel-runtime/core-js/object/define-property.js": +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/define-property.js"), __esModule: true }; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/object/keys.js": +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/keys.js"), __esModule: true }; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/object/values.js": +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/values.js"), __esModule: true }; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/classCallCheck.js": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/createClass.js": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _defineProperty = __webpack_require__("./node_modules/babel-runtime/core-js/object/define-property.js"); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +/***/ }), + +/***/ "./node_modules/core-js/library/fn/object/define-property.js": +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__("./node_modules/core-js/library/modules/es6.object.define-property.js"); +var $Object = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object; +module.exports = function defineProperty(it, key, desc) { + return $Object.defineProperty(it, key, desc); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/fn/object/keys.js": +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__("./node_modules/core-js/library/modules/es6.object.keys.js"); +module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object.keys; + + +/***/ }), + +/***/ "./node_modules/core-js/library/fn/object/values.js": +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__("./node_modules/core-js/library/modules/es7.object.values.js"); +module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object.values; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_a-function.js": +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_an-object.js": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js"); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_array-includes.js": +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js"); +var toLength = __webpack_require__("./node_modules/core-js/library/modules/_to-length.js"); +var toAbsoluteIndex = __webpack_require__("./node_modules/core-js/library/modules/_to-absolute-index.js"); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_cof.js": +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_core.js": +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.6.9' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_ctx.js": +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__("./node_modules/core-js/library/modules/_a-function.js"); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_defined.js": +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_descriptors.js": +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__("./node_modules/core-js/library/modules/_fails.js")(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_dom-create.js": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js"); +var document = __webpack_require__("./node_modules/core-js/library/modules/_global.js").document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_enum-bug-keys.js": +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_export.js": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("./node_modules/core-js/library/modules/_global.js"); +var core = __webpack_require__("./node_modules/core-js/library/modules/_core.js"); +var ctx = __webpack_require__("./node_modules/core-js/library/modules/_ctx.js"); +var hide = __webpack_require__("./node_modules/core-js/library/modules/_hide.js"); +var has = __webpack_require__("./node_modules/core-js/library/modules/_has.js"); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && has(exports, key)) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_fails.js": +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_global.js": +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_has.js": +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_hide.js": +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js"); +var createDesc = __webpack_require__("./node_modules/core-js/library/modules/_property-desc.js"); +module.exports = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_ie8-dom-define.js": +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") && !__webpack_require__("./node_modules/core-js/library/modules/_fails.js")(function () { + return Object.defineProperty(__webpack_require__("./node_modules/core-js/library/modules/_dom-create.js")('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_iobject.js": +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__("./node_modules/core-js/library/modules/_cof.js"); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_is-object.js": +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_library.js": +/***/ (function(module, exports) { + +module.exports = true; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_object-dp.js": +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__("./node_modules/core-js/library/modules/_an-object.js"); +var IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/library/modules/_ie8-dom-define.js"); +var toPrimitive = __webpack_require__("./node_modules/core-js/library/modules/_to-primitive.js"); +var dP = Object.defineProperty; + +exports.f = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_object-keys-internal.js": +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__("./node_modules/core-js/library/modules/_has.js"); +var toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js"); +var arrayIndexOf = __webpack_require__("./node_modules/core-js/library/modules/_array-includes.js")(false); +var IE_PROTO = __webpack_require__("./node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_object-keys.js": +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys-internal.js"); +var enumBugKeys = __webpack_require__("./node_modules/core-js/library/modules/_enum-bug-keys.js"); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_object-pie.js": +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_object-sap.js": +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js"); +var core = __webpack_require__("./node_modules/core-js/library/modules/_core.js"); +var fails = __webpack_require__("./node_modules/core-js/library/modules/_fails.js"); +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_object-to-array.js": +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js"); +var getKeys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js"); +var toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js"); +var isEnum = __webpack_require__("./node_modules/core-js/library/modules/_object-pie.js").f; +module.exports = function (isEntries) { + return function (it) { + var O = toIObject(it); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!DESCRIPTORS || isEnum.call(O, key)) { + result.push(isEntries ? [key, O[key]] : O[key]); + } + } + return result; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_property-desc.js": +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_shared-key.js": +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__("./node_modules/core-js/library/modules/_shared.js")('keys'); +var uid = __webpack_require__("./node_modules/core-js/library/modules/_uid.js"); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_shared.js": +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__("./node_modules/core-js/library/modules/_core.js"); +var global = __webpack_require__("./node_modules/core-js/library/modules/_global.js"); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __webpack_require__("./node_modules/core-js/library/modules/_library.js") ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_to-absolute-index.js": +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__("./node_modules/core-js/library/modules/_to-integer.js"); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_to-integer.js": +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_to-iobject.js": +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__("./node_modules/core-js/library/modules/_iobject.js"); +var defined = __webpack_require__("./node_modules/core-js/library/modules/_defined.js"); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_to-length.js": +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__("./node_modules/core-js/library/modules/_to-integer.js"); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_to-object.js": +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__("./node_modules/core-js/library/modules/_defined.js"); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_to-primitive.js": +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js"); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/_uid.js": +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/es6.object.define-property.js": +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js"); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__("./node_modules/core-js/library/modules/_descriptors.js"), 'Object', { defineProperty: __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js").f }); + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/es6.object.keys.js": +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__("./node_modules/core-js/library/modules/_to-object.js"); +var $keys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js"); + +__webpack_require__("./node_modules/core-js/library/modules/_object-sap.js")('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/library/modules/es7.object.values.js": +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js"); +var $values = __webpack_require__("./node_modules/core-js/library/modules/_object-to-array.js")(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); + + +/***/ }), + +/***/ "./src/data.js": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var LANGUAGES_LIST = { + aa: { + name: 'Afar', + nativeName: 'Afaraf' + }, + ab: { + name: 'Abkhaz', + nativeName: 'аҧсуа бызшәа' + }, + ae: { + name: 'Avestan', + nativeName: 'avesta' + }, + af: { + name: 'Afrikaans', + nativeName: 'Afrikaans' + }, + ak: { + name: 'Akan', + nativeName: 'Akan' + }, + am: { + name: 'Amharic', + nativeName: 'አማርኛ' + }, + an: { + name: 'Aragonese', + nativeName: 'aragonés' + }, + ar: { + name: 'Arabic', + nativeName: 'اَلْعَرَبِيَّةُ' + }, + as: { + name: 'Assamese', + nativeName: 'অসমীয়া' + }, + av: { + name: 'Avaric', + nativeName: 'авар мацӀ' + }, + ay: { + name: 'Aymara', + nativeName: 'aymar aru' + }, + az: { + name: 'Azerbaijani', + nativeName: 'azərbaycan dili' + }, + ba: { + name: 'Bashkir', + nativeName: 'башҡорт теле' + }, + be: { + name: 'Belarusian', + nativeName: 'беларуская мова' + }, + bg: { + name: 'Bulgarian', + nativeName: 'български език' + }, + bi: { + name: 'Bislama', + nativeName: 'Bislama' + }, + bm: { + name: 'Bambara', + nativeName: 'bamanankan' + }, + bn: { + name: 'Bengali', + nativeName: 'বাংলা' + }, + bo: { + name: 'Tibetan', + nativeName: 'བོད་ཡིག' + }, + br: { + name: 'Breton', + nativeName: 'brezhoneg' + }, + bs: { + name: 'Bosnian', + nativeName: 'bosanski jezik' + }, + ca: { + name: 'Catalan', + nativeName: 'Català' + }, + ce: { + name: 'Chechen', + nativeName: 'нохчийн мотт' + }, + ch: { + name: 'Chamorro', + nativeName: 'Chamoru' + }, + co: { + name: 'Corsican', + nativeName: 'corsu' + }, + cr: { + name: 'Cree', + nativeName: 'ᓀᐦᐃᔭᐍᐏᐣ' + }, + cs: { + name: 'Czech', + nativeName: 'čeština' + }, + cu: { + name: 'Old Church Slavonic', + nativeName: 'ѩзыкъ словѣньскъ' + }, + cv: { + name: 'Chuvash', + nativeName: 'чӑваш чӗлхи' + }, + cy: { + name: 'Welsh', + nativeName: 'Cymraeg' + }, + da: { + name: 'Danish', + nativeName: 'dansk' + }, + de: { + name: 'German', + nativeName: 'Deutsch' + }, + dv: { + name: 'Divehi', + nativeName: 'ދިވެހި' + }, + dz: { + name: 'Dzongkha', + nativeName: 'རྫོང་ཁ' + }, + ee: { + name: 'Ewe', + nativeName: 'Eʋegbe' + }, + el: { + name: 'Greek', + nativeName: 'Ελληνικά' + }, + en: { + name: 'English', + nativeName: 'English' + }, + eo: { + name: 'Esperanto', + nativeName: 'Esperanto' + }, + es: { + name: 'Spanish', + nativeName: 'Español' + }, + et: { + name: 'Estonian', + nativeName: 'eesti' + }, + eu: { + name: 'Basque', + nativeName: 'euskara' + }, + fa: { + name: 'Persian', + nativeName: 'فارسی' + }, + ff: { + name: 'Fula', + nativeName: 'Fulfulde' + }, + fi: { + name: 'Finnish', + nativeName: 'suomi' + }, + fj: { + name: 'Fijian', + nativeName: 'vosa Vakaviti' + }, + fo: { + name: 'Faroese', + nativeName: 'føroyskt' + }, + fr: { + name: 'French', + nativeName: 'Français' + }, + fy: { + name: 'Western Frisian', + nativeName: 'Frysk' + }, + ga: { + name: 'Irish', + nativeName: 'Gaeilge' + }, + gd: { + name: 'Scottish Gaelic', + nativeName: 'Gàidhlig' + }, + gl: { + name: 'Galician', + nativeName: 'galego' + }, + gn: { + name: 'Guaraní', + nativeName: "Avañe'ẽ" + }, + gu: { + name: 'Gujarati', + nativeName: 'ગુજરાતી' + }, + gv: { + name: 'Manx', + nativeName: 'Gaelg' + }, + ha: { + name: 'Hausa', + nativeName: 'هَوُسَ' + }, + he: { + name: 'Hebrew', + nativeName: 'עברית' + }, + hi: { + name: 'Hindi', + nativeName: 'हिन्दी' + }, + ho: { + name: 'Hiri Motu', + nativeName: 'Hiri Motu' + }, + hr: { + name: 'Croatian', + nativeName: 'Hrvatski' + }, + ht: { + name: 'Haitian', + nativeName: 'Kreyòl ayisyen' + }, + hu: { + name: 'Hungarian', + nativeName: 'magyar' + }, + hy: { + name: 'Armenian', + nativeName: 'Հայերեն' + }, + hz: { + name: 'Herero', + nativeName: 'Otjiherero' + }, + ia: { + name: 'Interlingua', + nativeName: 'Interlingua' + }, + id: { + name: 'Indonesian', + nativeName: 'Bahasa Indonesia' + }, + ie: { + name: 'Interlingue', + nativeName: 'Interlingue' + }, + ig: { + name: 'Igbo', + nativeName: 'Asụsụ Igbo' + }, + ii: { + name: 'Nuosu', + nativeName: 'ꆈꌠ꒿ Nuosuhxop' + }, + ik: { + name: 'Inupiaq', + nativeName: 'Iñupiaq' + }, + io: { + name: 'Ido', + nativeName: 'Ido' + }, + is: { + name: 'Icelandic', + nativeName: 'Íslenska' + }, + it: { + name: 'Italian', + nativeName: 'Italiano' + }, + iu: { + name: 'Inuktitut', + nativeName: 'ᐃᓄᒃᑎᑐᑦ' + }, + ja: { + name: 'Japanese', + nativeName: '日本語' + }, + jv: { + name: 'Javanese', + nativeName: 'basa Jawa' + }, + ka: { + name: 'Georgian', + nativeName: 'ქართული' + }, + kg: { + name: 'Kongo', + nativeName: 'Kikongo' + }, + ki: { + name: 'Kikuyu', + nativeName: 'Gĩkũyũ' + }, + kj: { + name: 'Kwanyama', + nativeName: 'Kuanyama' + }, + kk: { + name: 'Kazakh', + nativeName: 'қазақ тілі' + }, + kl: { + name: 'Kalaallisut', + nativeName: 'kalaallisut' + }, + km: { + name: 'Khmer', + nativeName: 'ខេមរភាសា' + }, + kn: { + name: 'Kannada', + nativeName: 'ಕನ್ನಡ' + }, + ko: { + name: 'Korean', + nativeName: '한국어' + }, + kr: { + name: 'Kanuri', + nativeName: 'Kanuri' + }, + ks: { + name: 'Kashmiri', + nativeName: 'कश्मीरी' + }, + ku: { + name: 'Kurdish', + nativeName: 'Kurdî' + }, + kv: { + name: 'Komi', + nativeName: 'коми кыв' + }, + kw: { + name: 'Cornish', + nativeName: 'Kernewek' + }, + ky: { + name: 'Kyrgyz', + nativeName: 'Кыргызча' + }, + la: { + name: 'Latin', + nativeName: 'latine' + }, + lb: { + name: 'Luxembourgish', + nativeName: 'Lëtzebuergesch' + }, + lg: { + name: 'Ganda', + nativeName: 'Luganda' + }, + li: { + name: 'Limburgish', + nativeName: 'Limburgs' + }, + ln: { + name: 'Lingala', + nativeName: 'Lingála' + }, + lo: { + name: 'Lao', + nativeName: 'ພາສາລາວ' + }, + lt: { + name: 'Lithuanian', + nativeName: 'lietuvių kalba' + }, + lu: { + name: 'Luba-Katanga', + nativeName: 'Kiluba' + }, + lv: { + name: 'Latvian', + nativeName: 'latviešu valoda' + }, + mg: { + name: 'Malagasy', + nativeName: 'fiteny malagasy' + }, + mh: { + name: 'Marshallese', + nativeName: 'Kajin M̧ajeļ' + }, + mi: { + name: 'Māori', + nativeName: 'te reo Māori' + }, + mk: { + name: 'Macedonian', + nativeName: 'македонски јазик' + }, + ml: { + name: 'Malayalam', + nativeName: 'മലയാളം' + }, + mn: { + name: 'Mongolian', + nativeName: 'Монгол хэл' + }, + mr: { + name: 'Marathi', + nativeName: 'मराठी' + }, + ms: { + name: 'Malay', + nativeName: 'Bahasa Melayu' + }, + mt: { + name: 'Maltese', + nativeName: 'Malti' + }, + my: { + name: 'Burmese', + nativeName: 'ဗမာစာ' + }, + na: { + name: 'Nauru', + nativeName: 'Dorerin Naoero' + }, + nb: { + name: 'Norwegian Bokmål', + nativeName: 'Norsk bokmål' + }, + nd: { + name: 'Northern Ndebele', + nativeName: 'isiNdebele' + }, + ne: { + name: 'Nepali', + nativeName: 'नेपाली' + }, + ng: { + name: 'Ndonga', + nativeName: 'Owambo' + }, + nl: { + name: 'Dutch', + nativeName: 'Nederlands' + }, + nn: { + name: 'Norwegian Nynorsk', + nativeName: 'Norsk nynorsk' + }, + no: { + name: 'Norwegian', + nativeName: 'Norsk' + }, + nr: { + name: 'Southern Ndebele', + nativeName: 'isiNdebele' + }, + nv: { + name: 'Navajo', + nativeName: 'Diné bizaad' + }, + ny: { + name: 'Chichewa', + nativeName: 'chiCheŵa' + }, + oc: { + name: 'Occitan', + nativeName: 'occitan' + }, + oj: { + name: 'Ojibwe', + nativeName: 'ᐊᓂᔑᓈᐯᒧᐎᓐ' + }, + om: { + name: 'Oromo', + nativeName: 'Afaan Oromoo' + }, + or: { + name: 'Oriya', + nativeName: 'ଓଡ଼ିଆ' + }, + os: { + name: 'Ossetian', + nativeName: 'ирон æвзаг' + }, + pa: { + name: 'Panjabi', + nativeName: 'ਪੰਜਾਬੀ' + }, + pi: { + name: 'Pāli', + nativeName: 'पाऴि' + }, + pl: { + name: 'Polish', + nativeName: 'Polski' + }, + ps: { + name: 'Pashto', + nativeName: 'پښتو' + }, + pt: { + name: 'Portuguese', + nativeName: 'Português' + }, + qu: { + name: 'Quechua', + nativeName: 'Runa Simi' + }, + rm: { + name: 'Romansh', + nativeName: 'rumantsch grischun' + }, + rn: { + name: 'Kirundi', + nativeName: 'Ikirundi' + }, + ro: { + name: 'Romanian', + nativeName: 'Română' + }, + ru: { + name: 'Russian', + nativeName: 'Русский' + }, + rw: { + name: 'Kinyarwanda', + nativeName: 'Ikinyarwanda' + }, + sa: { + name: 'Sanskrit', + nativeName: 'संस्कृतम्' + }, + sc: { + name: 'Sardinian', + nativeName: 'sardu' + }, + sd: { + name: 'Sindhi', + nativeName: 'सिन्धी' + }, + se: { + name: 'Northern Sami', + nativeName: 'Davvisámegiella' + }, + sg: { + name: 'Sango', + nativeName: 'yângâ tî sängö' + }, + si: { + name: 'Sinhala', + nativeName: 'සිංහල' + }, + sk: { + name: 'Slovak', + nativeName: 'slovenčina' + }, + sl: { + name: 'Slovenian', + nativeName: 'slovenščina' + }, + sm: { + name: 'Samoan', + nativeName: "gagana fa'a Samoa" + }, + sn: { + name: 'Shona', + nativeName: 'chiShona' + }, + so: { + name: 'Somali', + nativeName: 'Soomaaliga' + }, + sq: { + name: 'Albanian', + nativeName: 'Shqip' + }, + sr: { + name: 'Serbian', + nativeName: 'српски језик' + }, + ss: { + name: 'Swati', + nativeName: 'SiSwati' + }, + st: { + name: 'Southern Sotho', + nativeName: 'Sesotho' + }, + su: { + name: 'Sundanese', + nativeName: 'Basa Sunda' + }, + sv: { + name: 'Swedish', + nativeName: 'Svenska' + }, + sw: { + name: 'Swahili', + nativeName: 'Kiswahili' + }, + ta: { + name: 'Tamil', + nativeName: 'தமிழ்' + }, + te: { + name: 'Telugu', + nativeName: 'తెలుగు' + }, + tg: { + name: 'Tajik', + nativeName: 'тоҷикӣ' + }, + th: { + name: 'Thai', + nativeName: 'ไทย' + }, + ti: { + name: 'Tigrinya', + nativeName: 'ትግርኛ' + }, + tk: { + name: 'Turkmen', + nativeName: 'Türkmençe' + }, + tl: { + name: 'Tagalog', + nativeName: 'Wikang Tagalog' + }, + tn: { + name: 'Tswana', + nativeName: 'Setswana' + }, + to: { + name: 'Tonga', + nativeName: 'faka Tonga' + }, + tr: { + name: 'Turkish', + nativeName: 'Türkçe' + }, + ts: { + name: 'Tsonga', + nativeName: 'Xitsonga' + }, + tt: { + name: 'Tatar', + nativeName: 'татар теле' + }, + tw: { + name: 'Twi', + nativeName: 'Twi' + }, + ty: { + name: 'Tahitian', + nativeName: 'Reo Tahiti' + }, + ug: { + name: 'Uyghur', + nativeName: 'ئۇيغۇرچە‎' + }, + uk: { + name: 'Ukrainian', + nativeName: 'Українська' + }, + ur: { + name: 'Urdu', + nativeName: 'اردو' + }, + uz: { + name: 'Uzbek', + nativeName: 'Ўзбек' + }, + ve: { + name: 'Venda', + nativeName: 'Tshivenḓa' + }, + vi: { + name: 'Vietnamese', + nativeName: 'Tiếng Việt' + }, + vo: { + name: 'Volapük', + nativeName: 'Volapük' + }, + wa: { + name: 'Walloon', + nativeName: 'walon' + }, + wo: { + name: 'Wolof', + nativeName: 'Wollof' + }, + xh: { + name: 'Xhosa', + nativeName: 'isiXhosa' + }, + yi: { + name: 'Yiddish', + nativeName: 'ייִדיש' + }, + yo: { + name: 'Yoruba', + nativeName: 'Yorùbá' + }, + za: { + name: 'Zhuang', + nativeName: 'Saɯ cueŋƅ' + }, + zh: { + name: 'Chinese', + nativeName: '中文' + }, + zu: { + name: 'Zulu', + nativeName: 'isiZulu' + } +}; + +exports.default = LANGUAGES_LIST; +module.exports = exports['default']; + +/***/ }), + +/***/ "./src/index.js": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _keys = __webpack_require__("./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +var _values = __webpack_require__("./node_modules/babel-runtime/core-js/object/values.js"); + +var _values2 = _interopRequireDefault(_values); + +var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js"); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _data = __webpack_require__("./src/data.js"); + +var _data2 = _interopRequireDefault(_data); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var ISO6391 = function () { + function ISO6391() { + (0, _classCallCheck3.default)(this, ISO6391); + } + + (0, _createClass3.default)(ISO6391, null, [{ + key: 'getLanguages', + value: function getLanguages() { + var codes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + return codes.map(function (code) { + return { + code: code, + name: ISO6391.getName(code), + nativeName: ISO6391.getNativeName(code) + }; + }); + } + }, { + key: 'getName', + value: function getName(code) { + return ISO6391.validate(code) ? _data2.default[code].name : ''; + } + }, { + key: 'getAllNames', + value: function getAllNames() { + return (0, _values2.default)(_data2.default).map(function (l) { + return l.name; + }); + } + }, { + key: 'getNativeName', + value: function getNativeName(code) { + return ISO6391.validate(code) ? _data2.default[code].nativeName : ''; + } + }, { + key: 'getAllNativeNames', + value: function getAllNativeNames() { + return (0, _values2.default)(_data2.default).map(function (l) { + return l.nativeName; + }); + } + }, { + key: 'getCode', + value: function getCode(name) { + var code = (0, _keys2.default)(_data2.default).find(function (code) { + var language = _data2.default[code]; + + return language.name.toLowerCase() === name.toLowerCase() || language.nativeName.toLowerCase() === name.toLowerCase(); + }); + return code || ''; + } + }, { + key: 'getAllCodes', + value: function getAllCodes() { + return (0, _keys2.default)(_data2.default); + } + }, { + key: 'validate', + value: function validate(code) { + return _data2.default.hasOwnProperty(code); + } + }]); + return ISO6391; +}(); + +exports.default = ISO6391; +module.exports = exports['default']; + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/iso-639-1/build/index.js.map b/node_modules/iso-639-1/build/index.js.map new file mode 100644 index 0000000..566c793 --- /dev/null +++ b/node_modules/iso-639-1/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 2540c00564a92261ab21","webpack:///./node_modules/babel-runtime/core-js/object/define-property.js","webpack:///./node_modules/babel-runtime/core-js/object/keys.js","webpack:///./node_modules/babel-runtime/core-js/object/values.js","webpack:///./node_modules/babel-runtime/helpers/classCallCheck.js","webpack:///./node_modules/babel-runtime/helpers/createClass.js","webpack:///./node_modules/core-js/library/fn/object/define-property.js","webpack:///./node_modules/core-js/library/fn/object/keys.js","webpack:///./node_modules/core-js/library/fn/object/values.js","webpack:///./node_modules/core-js/library/modules/_a-function.js","webpack:///./node_modules/core-js/library/modules/_an-object.js","webpack:///./node_modules/core-js/library/modules/_array-includes.js","webpack:///./node_modules/core-js/library/modules/_cof.js","webpack:///./node_modules/core-js/library/modules/_core.js","webpack:///./node_modules/core-js/library/modules/_ctx.js","webpack:///./node_modules/core-js/library/modules/_defined.js","webpack:///./node_modules/core-js/library/modules/_descriptors.js","webpack:///./node_modules/core-js/library/modules/_dom-create.js","webpack:///./node_modules/core-js/library/modules/_enum-bug-keys.js","webpack:///./node_modules/core-js/library/modules/_export.js","webpack:///./node_modules/core-js/library/modules/_fails.js","webpack:///./node_modules/core-js/library/modules/_global.js","webpack:///./node_modules/core-js/library/modules/_has.js","webpack:///./node_modules/core-js/library/modules/_hide.js","webpack:///./node_modules/core-js/library/modules/_ie8-dom-define.js","webpack:///./node_modules/core-js/library/modules/_iobject.js","webpack:///./node_modules/core-js/library/modules/_is-object.js","webpack:///./node_modules/core-js/library/modules/_library.js","webpack:///./node_modules/core-js/library/modules/_object-dp.js","webpack:///./node_modules/core-js/library/modules/_object-keys-internal.js","webpack:///./node_modules/core-js/library/modules/_object-keys.js","webpack:///./node_modules/core-js/library/modules/_object-pie.js","webpack:///./node_modules/core-js/library/modules/_object-sap.js","webpack:///./node_modules/core-js/library/modules/_object-to-array.js","webpack:///./node_modules/core-js/library/modules/_property-desc.js","webpack:///./node_modules/core-js/library/modules/_shared-key.js","webpack:///./node_modules/core-js/library/modules/_shared.js","webpack:///./node_modules/core-js/library/modules/_to-absolute-index.js","webpack:///./node_modules/core-js/library/modules/_to-integer.js","webpack:///./node_modules/core-js/library/modules/_to-iobject.js","webpack:///./node_modules/core-js/library/modules/_to-length.js","webpack:///./node_modules/core-js/library/modules/_to-object.js","webpack:///./node_modules/core-js/library/modules/_to-primitive.js","webpack:///./node_modules/core-js/library/modules/_uid.js","webpack:///./node_modules/core-js/library/modules/es6.object.define-property.js","webpack:///./node_modules/core-js/library/modules/es6.object.keys.js","webpack:///./node_modules/core-js/library/modules/es7.object.values.js","webpack:///./src/data.js","webpack:///./src/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ISO6391\"] = factory();\n\telse\n\t\troot[\"ISO6391\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2540c00564a92261ab21","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/object/define-property.js\n// module id = ./node_modules/babel-runtime/core-js/object/define-property.js\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/object/keys.js\n// module id = ./node_modules/babel-runtime/core-js/object/keys.js\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/values\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/object/values.js\n// module id = ./node_modules/babel-runtime/core-js/object/values.js\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/classCallCheck.js\n// module id = ./node_modules/babel-runtime/helpers/classCallCheck.js\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/createClass.js\n// module id = ./node_modules/babel-runtime/helpers/createClass.js\n// module chunks = 0","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/object/define-property.js\n// module id = ./node_modules/core-js/library/fn/object/define-property.js\n// module chunks = 0","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/object/keys.js\n// module id = ./node_modules/core-js/library/fn/object/keys.js\n// module chunks = 0","require('../../modules/es7.object.values');\nmodule.exports = require('../../modules/_core').Object.values;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/object/values.js\n// module id = ./node_modules/core-js/library/fn/object/values.js\n// module chunks = 0","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_a-function.js\n// module id = ./node_modules/core-js/library/modules/_a-function.js\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_an-object.js\n// module id = ./node_modules/core-js/library/modules/_an-object.js\n// module chunks = 0","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_array-includes.js\n// module id = ./node_modules/core-js/library/modules/_array-includes.js\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_cof.js\n// module id = ./node_modules/core-js/library/modules/_cof.js\n// module chunks = 0","var core = module.exports = { version: '2.6.9' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_core.js\n// module id = ./node_modules/core-js/library/modules/_core.js\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_ctx.js\n// module id = ./node_modules/core-js/library/modules/_ctx.js\n// module chunks = 0","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_defined.js\n// module id = ./node_modules/core-js/library/modules/_defined.js\n// module chunks = 0","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_descriptors.js\n// module id = ./node_modules/core-js/library/modules/_descriptors.js\n// module chunks = 0","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_dom-create.js\n// module id = ./node_modules/core-js/library/modules/_dom-create.js\n// module chunks = 0","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_enum-bug-keys.js\n// module id = ./node_modules/core-js/library/modules/_enum-bug-keys.js\n// module chunks = 0","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_export.js\n// module id = ./node_modules/core-js/library/modules/_export.js\n// module chunks = 0","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_fails.js\n// module id = ./node_modules/core-js/library/modules/_fails.js\n// module chunks = 0","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_global.js\n// module id = ./node_modules/core-js/library/modules/_global.js\n// module chunks = 0","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_has.js\n// module id = ./node_modules/core-js/library/modules/_has.js\n// module chunks = 0","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_hide.js\n// module id = ./node_modules/core-js/library/modules/_hide.js\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_ie8-dom-define.js\n// module id = ./node_modules/core-js/library/modules/_ie8-dom-define.js\n// module chunks = 0","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iobject.js\n// module id = ./node_modules/core-js/library/modules/_iobject.js\n// module chunks = 0","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_is-object.js\n// module id = ./node_modules/core-js/library/modules/_is-object.js\n// module chunks = 0","module.exports = true;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_library.js\n// module id = ./node_modules/core-js/library/modules/_library.js\n// module chunks = 0","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-dp.js\n// module id = ./node_modules/core-js/library/modules/_object-dp.js\n// module chunks = 0","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-keys-internal.js\n// module id = ./node_modules/core-js/library/modules/_object-keys-internal.js\n// module chunks = 0","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-keys.js\n// module id = ./node_modules/core-js/library/modules/_object-keys.js\n// module chunks = 0","exports.f = {}.propertyIsEnumerable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-pie.js\n// module id = ./node_modules/core-js/library/modules/_object-pie.js\n// module chunks = 0","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-sap.js\n// module id = ./node_modules/core-js/library/modules/_object-sap.js\n// module chunks = 0","var DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || isEnum.call(O, key)) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-to-array.js\n// module id = ./node_modules/core-js/library/modules/_object-to-array.js\n// module chunks = 0","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_property-desc.js\n// module id = ./node_modules/core-js/library/modules/_property-desc.js\n// module chunks = 0","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_shared-key.js\n// module id = ./node_modules/core-js/library/modules/_shared-key.js\n// module chunks = 0","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_shared.js\n// module id = ./node_modules/core-js/library/modules/_shared.js\n// module chunks = 0","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-absolute-index.js\n// module id = ./node_modules/core-js/library/modules/_to-absolute-index.js\n// module chunks = 0","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-integer.js\n// module id = ./node_modules/core-js/library/modules/_to-integer.js\n// module chunks = 0","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-iobject.js\n// module id = ./node_modules/core-js/library/modules/_to-iobject.js\n// module chunks = 0","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-length.js\n// module id = ./node_modules/core-js/library/modules/_to-length.js\n// module chunks = 0","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-object.js\n// module id = ./node_modules/core-js/library/modules/_to-object.js\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-primitive.js\n// module id = ./node_modules/core-js/library/modules/_to-primitive.js\n// module chunks = 0","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_uid.js\n// module id = ./node_modules/core-js/library/modules/_uid.js\n// module chunks = 0","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.object.define-property.js\n// module id = ./node_modules/core-js/library/modules/es6.object.define-property.js\n// module chunks = 0","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.object.keys.js\n// module id = ./node_modules/core-js/library/modules/es6.object.keys.js\n// module chunks = 0","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es7.object.values.js\n// module id = ./node_modules/core-js/library/modules/es7.object.values.js\n// module chunks = 0","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar LANGUAGES_LIST = {\n aa: {\n name: 'Afar',\n nativeName: 'Afaraf'\n },\n ab: {\n name: 'Abkhaz',\n nativeName: 'аҧсуа бызшәа'\n },\n ae: {\n name: 'Avestan',\n nativeName: 'avesta'\n },\n af: {\n name: 'Afrikaans',\n nativeName: 'Afrikaans'\n },\n ak: {\n name: 'Akan',\n nativeName: 'Akan'\n },\n am: {\n name: 'Amharic',\n nativeName: 'አማርኛ'\n },\n an: {\n name: 'Aragonese',\n nativeName: 'aragonés'\n },\n ar: {\n name: 'Arabic',\n nativeName: 'اَلْعَرَبِيَّةُ'\n },\n as: {\n name: 'Assamese',\n nativeName: 'অসমীয়া'\n },\n av: {\n name: 'Avaric',\n nativeName: 'авар мацӀ'\n },\n ay: {\n name: 'Aymara',\n nativeName: 'aymar aru'\n },\n az: {\n name: 'Azerbaijani',\n nativeName: 'azərbaycan dili'\n },\n ba: {\n name: 'Bashkir',\n nativeName: 'башҡорт теле'\n },\n be: {\n name: 'Belarusian',\n nativeName: 'беларуская мова'\n },\n bg: {\n name: 'Bulgarian',\n nativeName: 'български език'\n },\n bi: {\n name: 'Bislama',\n nativeName: 'Bislama'\n },\n bm: {\n name: 'Bambara',\n nativeName: 'bamanankan'\n },\n bn: {\n name: 'Bengali',\n nativeName: 'বাংলা'\n },\n bo: {\n name: 'Tibetan',\n nativeName: 'བོད་ཡིག'\n },\n br: {\n name: 'Breton',\n nativeName: 'brezhoneg'\n },\n bs: {\n name: 'Bosnian',\n nativeName: 'bosanski jezik'\n },\n ca: {\n name: 'Catalan',\n nativeName: 'Català'\n },\n ce: {\n name: 'Chechen',\n nativeName: 'нохчийн мотт'\n },\n ch: {\n name: 'Chamorro',\n nativeName: 'Chamoru'\n },\n co: {\n name: 'Corsican',\n nativeName: 'corsu'\n },\n cr: {\n name: 'Cree',\n nativeName: 'ᓀᐦᐃᔭᐍᐏᐣ'\n },\n cs: {\n name: 'Czech',\n nativeName: 'čeština'\n },\n cu: {\n name: 'Old Church Slavonic',\n nativeName: 'ѩзыкъ словѣньскъ'\n },\n cv: {\n name: 'Chuvash',\n nativeName: 'чӑваш чӗлхи'\n },\n cy: {\n name: 'Welsh',\n nativeName: 'Cymraeg'\n },\n da: {\n name: 'Danish',\n nativeName: 'dansk'\n },\n de: {\n name: 'German',\n nativeName: 'Deutsch'\n },\n dv: {\n name: 'Divehi',\n nativeName: 'ދިވެހި'\n },\n dz: {\n name: 'Dzongkha',\n nativeName: 'རྫོང་ཁ'\n },\n ee: {\n name: 'Ewe',\n nativeName: 'Eʋegbe'\n },\n el: {\n name: 'Greek',\n nativeName: 'Ελληνικά'\n },\n en: {\n name: 'English',\n nativeName: 'English'\n },\n eo: {\n name: 'Esperanto',\n nativeName: 'Esperanto'\n },\n es: {\n name: 'Spanish',\n nativeName: 'Español'\n },\n et: {\n name: 'Estonian',\n nativeName: 'eesti'\n },\n eu: {\n name: 'Basque',\n nativeName: 'euskara'\n },\n fa: {\n name: 'Persian',\n nativeName: 'فارسی'\n },\n ff: {\n name: 'Fula',\n nativeName: 'Fulfulde'\n },\n fi: {\n name: 'Finnish',\n nativeName: 'suomi'\n },\n fj: {\n name: 'Fijian',\n nativeName: 'vosa Vakaviti'\n },\n fo: {\n name: 'Faroese',\n nativeName: 'føroyskt'\n },\n fr: {\n name: 'French',\n nativeName: 'Français'\n },\n fy: {\n name: 'Western Frisian',\n nativeName: 'Frysk'\n },\n ga: {\n name: 'Irish',\n nativeName: 'Gaeilge'\n },\n gd: {\n name: 'Scottish Gaelic',\n nativeName: 'Gàidhlig'\n },\n gl: {\n name: 'Galician',\n nativeName: 'galego'\n },\n gn: {\n name: 'Guaraní',\n nativeName: \"Avañe'ẽ\"\n },\n gu: {\n name: 'Gujarati',\n nativeName: 'ગુજરાતી'\n },\n gv: {\n name: 'Manx',\n nativeName: 'Gaelg'\n },\n ha: {\n name: 'Hausa',\n nativeName: 'هَوُسَ'\n },\n he: {\n name: 'Hebrew',\n nativeName: 'עברית'\n },\n hi: {\n name: 'Hindi',\n nativeName: 'हिन्दी'\n },\n ho: {\n name: 'Hiri Motu',\n nativeName: 'Hiri Motu'\n },\n hr: {\n name: 'Croatian',\n nativeName: 'Hrvatski'\n },\n ht: {\n name: 'Haitian',\n nativeName: 'Kreyòl ayisyen'\n },\n hu: {\n name: 'Hungarian',\n nativeName: 'magyar'\n },\n hy: {\n name: 'Armenian',\n nativeName: 'Հայերեն'\n },\n hz: {\n name: 'Herero',\n nativeName: 'Otjiherero'\n },\n ia: {\n name: 'Interlingua',\n nativeName: 'Interlingua'\n },\n id: {\n name: 'Indonesian',\n nativeName: 'Bahasa Indonesia'\n },\n ie: {\n name: 'Interlingue',\n nativeName: 'Interlingue'\n },\n ig: {\n name: 'Igbo',\n nativeName: 'Asụsụ Igbo'\n },\n ii: {\n name: 'Nuosu',\n nativeName: 'ꆈꌠ꒿ Nuosuhxop'\n },\n ik: {\n name: 'Inupiaq',\n nativeName: 'Iñupiaq'\n },\n io: {\n name: 'Ido',\n nativeName: 'Ido'\n },\n is: {\n name: 'Icelandic',\n nativeName: 'Íslenska'\n },\n it: {\n name: 'Italian',\n nativeName: 'Italiano'\n },\n iu: {\n name: 'Inuktitut',\n nativeName: 'ᐃᓄᒃᑎᑐᑦ'\n },\n ja: {\n name: 'Japanese',\n nativeName: '日本語'\n },\n jv: {\n name: 'Javanese',\n nativeName: 'basa Jawa'\n },\n ka: {\n name: 'Georgian',\n nativeName: 'ქართული'\n },\n kg: {\n name: 'Kongo',\n nativeName: 'Kikongo'\n },\n ki: {\n name: 'Kikuyu',\n nativeName: 'Gĩkũyũ'\n },\n kj: {\n name: 'Kwanyama',\n nativeName: 'Kuanyama'\n },\n kk: {\n name: 'Kazakh',\n nativeName: 'қазақ тілі'\n },\n kl: {\n name: 'Kalaallisut',\n nativeName: 'kalaallisut'\n },\n km: {\n name: 'Khmer',\n nativeName: 'ខេមរភាសា'\n },\n kn: {\n name: 'Kannada',\n nativeName: 'ಕನ್ನಡ'\n },\n ko: {\n name: 'Korean',\n nativeName: '한국어'\n },\n kr: {\n name: 'Kanuri',\n nativeName: 'Kanuri'\n },\n ks: {\n name: 'Kashmiri',\n nativeName: 'कश्मीरी'\n },\n ku: {\n name: 'Kurdish',\n nativeName: 'Kurdî'\n },\n kv: {\n name: 'Komi',\n nativeName: 'коми кыв'\n },\n kw: {\n name: 'Cornish',\n nativeName: 'Kernewek'\n },\n ky: {\n name: 'Kyrgyz',\n nativeName: 'Кыргызча'\n },\n la: {\n name: 'Latin',\n nativeName: 'latine'\n },\n lb: {\n name: 'Luxembourgish',\n nativeName: 'Lëtzebuergesch'\n },\n lg: {\n name: 'Ganda',\n nativeName: 'Luganda'\n },\n li: {\n name: 'Limburgish',\n nativeName: 'Limburgs'\n },\n ln: {\n name: 'Lingala',\n nativeName: 'Lingála'\n },\n lo: {\n name: 'Lao',\n nativeName: 'ພາສາລາວ'\n },\n lt: {\n name: 'Lithuanian',\n nativeName: 'lietuvių kalba'\n },\n lu: {\n name: 'Luba-Katanga',\n nativeName: 'Kiluba'\n },\n lv: {\n name: 'Latvian',\n nativeName: 'latviešu valoda'\n },\n mg: {\n name: 'Malagasy',\n nativeName: 'fiteny malagasy'\n },\n mh: {\n name: 'Marshallese',\n nativeName: 'Kajin M̧ajeļ'\n },\n mi: {\n name: 'Māori',\n nativeName: 'te reo Māori'\n },\n mk: {\n name: 'Macedonian',\n nativeName: 'македонски јазик'\n },\n ml: {\n name: 'Malayalam',\n nativeName: 'മലയാളം'\n },\n mn: {\n name: 'Mongolian',\n nativeName: 'Монгол хэл'\n },\n mr: {\n name: 'Marathi',\n nativeName: 'मराठी'\n },\n ms: {\n name: 'Malay',\n nativeName: 'Bahasa Melayu'\n },\n mt: {\n name: 'Maltese',\n nativeName: 'Malti'\n },\n my: {\n name: 'Burmese',\n nativeName: 'ဗမာစာ'\n },\n na: {\n name: 'Nauru',\n nativeName: 'Dorerin Naoero'\n },\n nb: {\n name: 'Norwegian Bokmål',\n nativeName: 'Norsk bokmål'\n },\n nd: {\n name: 'Northern Ndebele',\n nativeName: 'isiNdebele'\n },\n ne: {\n name: 'Nepali',\n nativeName: 'नेपाली'\n },\n ng: {\n name: 'Ndonga',\n nativeName: 'Owambo'\n },\n nl: {\n name: 'Dutch',\n nativeName: 'Nederlands'\n },\n nn: {\n name: 'Norwegian Nynorsk',\n nativeName: 'Norsk nynorsk'\n },\n no: {\n name: 'Norwegian',\n nativeName: 'Norsk'\n },\n nr: {\n name: 'Southern Ndebele',\n nativeName: 'isiNdebele'\n },\n nv: {\n name: 'Navajo',\n nativeName: 'Diné bizaad'\n },\n ny: {\n name: 'Chichewa',\n nativeName: 'chiCheŵa'\n },\n oc: {\n name: 'Occitan',\n nativeName: 'occitan'\n },\n oj: {\n name: 'Ojibwe',\n nativeName: 'ᐊᓂᔑᓈᐯᒧᐎᓐ'\n },\n om: {\n name: 'Oromo',\n nativeName: 'Afaan Oromoo'\n },\n or: {\n name: 'Oriya',\n nativeName: 'ଓଡ଼ିଆ'\n },\n os: {\n name: 'Ossetian',\n nativeName: 'ирон æвзаг'\n },\n pa: {\n name: 'Panjabi',\n nativeName: 'ਪੰਜਾਬੀ'\n },\n pi: {\n name: 'Pāli',\n nativeName: 'पाऴि'\n },\n pl: {\n name: 'Polish',\n nativeName: 'Polski'\n },\n ps: {\n name: 'Pashto',\n nativeName: 'پښتو'\n },\n pt: {\n name: 'Portuguese',\n nativeName: 'Português'\n },\n qu: {\n name: 'Quechua',\n nativeName: 'Runa Simi'\n },\n rm: {\n name: 'Romansh',\n nativeName: 'rumantsch grischun'\n },\n rn: {\n name: 'Kirundi',\n nativeName: 'Ikirundi'\n },\n ro: {\n name: 'Romanian',\n nativeName: 'Română'\n },\n ru: {\n name: 'Russian',\n nativeName: 'Русский'\n },\n rw: {\n name: 'Kinyarwanda',\n nativeName: 'Ikinyarwanda'\n },\n sa: {\n name: 'Sanskrit',\n nativeName: 'संस्कृतम्'\n },\n sc: {\n name: 'Sardinian',\n nativeName: 'sardu'\n },\n sd: {\n name: 'Sindhi',\n nativeName: 'सिन्धी'\n },\n se: {\n name: 'Northern Sami',\n nativeName: 'Davvisámegiella'\n },\n sg: {\n name: 'Sango',\n nativeName: 'yângâ tî sängö'\n },\n si: {\n name: 'Sinhala',\n nativeName: 'සිංහල'\n },\n sk: {\n name: 'Slovak',\n nativeName: 'slovenčina'\n },\n sl: {\n name: 'Slovenian',\n nativeName: 'slovenščina'\n },\n sm: {\n name: 'Samoan',\n nativeName: \"gagana fa'a Samoa\"\n },\n sn: {\n name: 'Shona',\n nativeName: 'chiShona'\n },\n so: {\n name: 'Somali',\n nativeName: 'Soomaaliga'\n },\n sq: {\n name: 'Albanian',\n nativeName: 'Shqip'\n },\n sr: {\n name: 'Serbian',\n nativeName: 'српски језик'\n },\n ss: {\n name: 'Swati',\n nativeName: 'SiSwati'\n },\n st: {\n name: 'Southern Sotho',\n nativeName: 'Sesotho'\n },\n su: {\n name: 'Sundanese',\n nativeName: 'Basa Sunda'\n },\n sv: {\n name: 'Swedish',\n nativeName: 'Svenska'\n },\n sw: {\n name: 'Swahili',\n nativeName: 'Kiswahili'\n },\n ta: {\n name: 'Tamil',\n nativeName: 'தமிழ்'\n },\n te: {\n name: 'Telugu',\n nativeName: 'తెలుగు'\n },\n tg: {\n name: 'Tajik',\n nativeName: 'тоҷикӣ'\n },\n th: {\n name: 'Thai',\n nativeName: 'ไทย'\n },\n ti: {\n name: 'Tigrinya',\n nativeName: 'ትግርኛ'\n },\n tk: {\n name: 'Turkmen',\n nativeName: 'Türkmençe'\n },\n tl: {\n name: 'Tagalog',\n nativeName: 'Wikang Tagalog'\n },\n tn: {\n name: 'Tswana',\n nativeName: 'Setswana'\n },\n to: {\n name: 'Tonga',\n nativeName: 'faka Tonga'\n },\n tr: {\n name: 'Turkish',\n nativeName: 'Türkçe'\n },\n ts: {\n name: 'Tsonga',\n nativeName: 'Xitsonga'\n },\n tt: {\n name: 'Tatar',\n nativeName: 'татар теле'\n },\n tw: {\n name: 'Twi',\n nativeName: 'Twi'\n },\n ty: {\n name: 'Tahitian',\n nativeName: 'Reo Tahiti'\n },\n ug: {\n name: 'Uyghur',\n nativeName: 'ئۇيغۇرچە‎'\n },\n uk: {\n name: 'Ukrainian',\n nativeName: 'Українська'\n },\n ur: {\n name: 'Urdu',\n nativeName: 'اردو'\n },\n uz: {\n name: 'Uzbek',\n nativeName: 'Ўзбек'\n },\n ve: {\n name: 'Venda',\n nativeName: 'Tshivenḓa'\n },\n vi: {\n name: 'Vietnamese',\n nativeName: 'Tiếng Việt'\n },\n vo: {\n name: 'Volapük',\n nativeName: 'Volapük'\n },\n wa: {\n name: 'Walloon',\n nativeName: 'walon'\n },\n wo: {\n name: 'Wolof',\n nativeName: 'Wollof'\n },\n xh: {\n name: 'Xhosa',\n nativeName: 'isiXhosa'\n },\n yi: {\n name: 'Yiddish',\n nativeName: 'ייִדיש'\n },\n yo: {\n name: 'Yoruba',\n nativeName: 'Yorùbá'\n },\n za: {\n name: 'Zhuang',\n nativeName: 'Saɯ cueŋƅ'\n },\n zh: {\n name: 'Chinese',\n nativeName: '中文'\n },\n zu: {\n name: 'Zulu',\n nativeName: 'isiZulu'\n }\n};\n\nexports.default = LANGUAGES_LIST;\nmodule.exports = exports['default'];\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/data.js\n// module id = ./src/data.js\n// module chunks = 0","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _values = require('babel-runtime/core-js/object/values');\n\nvar _values2 = _interopRequireDefault(_values);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _data = require('./data');\n\nvar _data2 = _interopRequireDefault(_data);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ISO6391 = function () {\n function ISO6391() {\n (0, _classCallCheck3.default)(this, ISO6391);\n }\n\n (0, _createClass3.default)(ISO6391, null, [{\n key: 'getLanguages',\n value: function getLanguages() {\n var codes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n return codes.map(function (code) {\n return {\n code: code,\n name: ISO6391.getName(code),\n nativeName: ISO6391.getNativeName(code)\n };\n });\n }\n }, {\n key: 'getName',\n value: function getName(code) {\n return ISO6391.validate(code) ? _data2.default[code].name : '';\n }\n }, {\n key: 'getAllNames',\n value: function getAllNames() {\n return (0, _values2.default)(_data2.default).map(function (l) {\n return l.name;\n });\n }\n }, {\n key: 'getNativeName',\n value: function getNativeName(code) {\n return ISO6391.validate(code) ? _data2.default[code].nativeName : '';\n }\n }, {\n key: 'getAllNativeNames',\n value: function getAllNativeNames() {\n return (0, _values2.default)(_data2.default).map(function (l) {\n return l.nativeName;\n });\n }\n }, {\n key: 'getCode',\n value: function getCode(name) {\n var code = (0, _keys2.default)(_data2.default).find(function (code) {\n var language = _data2.default[code];\n\n return language.name.toLowerCase() === name.toLowerCase() || language.nativeName.toLowerCase() === name.toLowerCase();\n });\n return code || '';\n }\n }, {\n key: 'getAllCodes',\n value: function getAllCodes() {\n return (0, _keys2.default)(_data2.default);\n }\n }, {\n key: 'validate',\n value: function validate(code) {\n return _data2.default.hasOwnProperty(code);\n }\n }]);\n return ISO6391;\n}();\n\nexports.default = ISO6391;\nmodule.exports = exports['default'];\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/index.js\n// module id = ./src/index.js\n// module chunks = 0"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1BA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;;;;;;;;ACDA;AACA;;;;;;;;ACDA;AACA;AACA;AACA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACLA;AACA;AACA;AACA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACLA;AACA;AACA;;;;;;;;ACFA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACLA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACruBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;A","sourceRoot":""} \ No newline at end of file diff --git a/node_modules/iso-639-1/index.d.ts b/node_modules/iso-639-1/index.d.ts new file mode 100644 index 0000000..9ea0dc7 --- /dev/null +++ b/node_modules/iso-639-1/index.d.ts @@ -0,0 +1,205 @@ +declare module 'iso-639-1' { + export type LanguageCode = + 'aa' + | 'ab' + | 'ae' + | 'af' + | 'ak' + | 'am' + | 'an' + | 'ar' + | 'as' + | 'av' + | 'ay' + | 'az' + | 'ba' + | 'be' + | 'bg' + | 'bi' + | 'bm' + | 'bn' + | 'bo' + | 'br' + | 'bs' + | 'ca' + | 'ce' + | 'ch' + | 'co' + | 'cr' + | 'cs' + | 'cu' + | 'cv' + | 'cy' + | 'da' + | 'de' + | 'dv' + | 'dz' + | 'ee' + | 'el' + | 'en' + | 'eo' + | 'es' + | 'et' + | 'eu' + | 'fa' + | 'ff' + | 'fi' + | 'fj' + | 'fo' + | 'fr' + | 'fy' + | 'ga' + | 'gd' + | 'gl' + | 'gn' + | 'gu' + | 'gv' + | 'ha' + | 'he' + | 'hi' + | 'ho' + | 'hr' + | 'ht' + | 'hu' + | 'hy' + | 'hz' + | 'ia' + | 'id' + | 'ie' + | 'ig' + | 'ii' + | 'ik' + | 'io' + | 'is' + | 'it' + | 'iu' + | 'ja' + | 'jv' + | 'ka' + | 'kg' + | 'ki' + | 'kj' + | 'kk' + | 'kl' + | 'km' + | 'kn' + | 'ko' + | 'kr' + | 'ks' + | 'ku' + | 'kv' + | 'kw' + | 'ky' + | 'la' + | 'lb' + | 'lg' + | 'li' + | 'ln' + | 'lo' + | 'lt' + | 'lu' + | 'lv' + | 'mg' + | 'mh' + | 'mi' + | 'mk' + | 'ml' + | 'mn' + | 'mr' + | 'ms' + | 'mt' + | 'my' + | 'na' + | 'nb' + | 'nd' + | 'ne' + | 'ng' + | 'nl' + | 'nn' + | 'no' + | 'nr' + | 'nv' + | 'ny' + | 'oc' + | 'oj' + | 'om' + | 'or' + | 'os' + | 'pa' + | 'pi' + | 'pl' + | 'ps' + | 'pt' + | 'qu' + | 'rm' + | 'rn' + | 'ro' + | 'ru' + | 'rw' + | 'sa' + | 'sc' + | 'sd' + | 'se' + | 'sg' + | 'si' + | 'sk' + | 'sl' + | 'sm' + | 'sn' + | 'so' + | 'sq' + | 'sr' + | 'ss' + | 'st' + | 'su' + | 'sv' + | 'sw' + | 'ta' + | 'te' + | 'tg' + | 'th' + | 'ti' + | 'tk' + | 'tl' + | 'tn' + | 'to' + | 'tr' + | 'ts' + | 'tt' + | 'tw' + | 'ty' + | 'ug' + | 'uk' + | 'ur' + | 'uz' + | 've' + | 'vi' + | 'vo' + | 'wa' + | 'wo' + | 'xh' + | 'yi' + | 'yo' + | 'za' + | 'zh' + | 'zu' + + interface ISO6391 { + getName: (code: string) => string; + getAllNames: () => Array; + getNativeName: (code: string) => string; + getAllNativeNames: () => Array; + getCode: (name: string) => LanguageCode; + getAllCodes: () => Array; + validate: (code: string) => boolean; + getLanguages: (codes: Array) => Array<{ + code: LanguageCode; + name: string; + nativeName: string; + }>; + } + + let localeCode: ISO6391; + + export default localeCode; +} diff --git a/node_modules/iso-639-1/package.json b/node_modules/iso-639-1/package.json new file mode 100644 index 0000000..90163fd --- /dev/null +++ b/node_modules/iso-639-1/package.json @@ -0,0 +1,46 @@ +{ + "name": "iso-639-1", + "version": "2.1.15", + "description": "ISO-639-1 codes", + "main": "build/index.js", + "module": "src/index.js", + "typings": "index.d.ts", + "scripts": { + "build": "webpack", + "test": "mocha" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/meikidd/iso-639-1.git" + }, + "keywords": [ + "iso", + "iso-639", + "iso-639-1", + "language", + "language code", + "locale", + "locale code" + ], + "author": "meikidd ", + "license": "MIT", + "bugs": { + "url": "https://github.com/meikidd/iso-639-1/issues" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-loader": "^7.1.2", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-stage-0": "^6.24.1", + "clean-webpack-plugin": "^0.1.17", + "mocha": "^4.0.1", + "webpack": "^3.10.0" + }, + "homepage": "https://github.com/meikidd/iso-639-1#readme", + "engines": { + "node": ">=6.0" + } +} diff --git a/node_modules/iso-639-1/readme.md b/node_modules/iso-639-1/readme.md new file mode 100644 index 0000000..d32de7f --- /dev/null +++ b/node_modules/iso-639-1/readme.md @@ -0,0 +1,121 @@ +# ISO-639-1 +[![NPM Version][npm-image]][npm-url] +[![Build Status][travis-image]][travis-url] +[![Download Count][download-url]][npm-url] + +[travis-image]: https://travis-ci.org/meikidd/iso-639-1.svg?branch=master +[travis-url]: https://travis-ci.org/meikidd/iso-639-1 +[npm-image]: https://img.shields.io/npm/v/iso-639-1.svg?style=flat-square +[npm-url]: https://npmjs.org/package/iso-639-1 +[download-url]: https://img.shields.io/npm/dt/iso-639-1.svg?style=flat-square + + +Simple interface for [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes + +## Installation + +``` +npm install iso-639-1 +``` + +## Usage + +### Node.js + +```javascript +const ISO6391 = require('iso-639-1'); +console.log(ISO6391.getName('en')); // 'English' +``` + +### ES Module + +```javascript +import ISO6391 from 'iso-639-1'; +console.log(ISO6391.getName('en')); // 'English' +``` + +### Browsers + +HTML + +```html + +``` + +Visit global variable ISO6391 in js + +```javascript +console.log(ISO6391.getName('en')); // 'English' +``` + +## Methods + +### getName(code) + - @param code {string} + - @return {string} + +Lookup language english name by code + +### getAllNames() + - @return {array} + +Get array of all language english names + +### getNativeName(code) + - @param code {string} + - @return {string} + +Lookup language native name by code + +### getAllNativeNames() + - @return {array} + +Get array of all language native names + + +### getCode(name) + - @param name {string} + - @return {string} + +Lookup code by english name or native name + +### getAllCodes() + - @return {array} + +Get array of all codes + +### validate(code) + - @param code {string} + - @return {boolean} + +Check whether the given code is in the list of [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + +### getLanguages(codes) + - @param codes {array} + - @return {array} + +Get the array of the language objects by the given codes + +## Example + +``` +const ISO6391 = require('iso-639-1') + +console.log(ISO6391.getName('zh')) // 'Chinese' +console.log(ISO6391.getNativeName('zh')) // '中文' + +console.log(ISO6391.getAllNames()) // ['Afar','Abkhaz', ... ,'Zulu'] +console.log(ISO6391.getAllNativeNames()) //['Afaraf','аҧсуа бызшәа', ... ,'isiZulu' ] + +console.log(ISO6391.getCode('Chinese')) // 'zh' +console.log(ISO6391.getCode('中文')) // 'zh' + +console.log(ISO6391.getAllCodes()) //['aa','ab',...,'zu'] + +console.log(ISO6391.validate('en')) // true +console.log(ISO6391.validate('xx')) // false + +console.log(ISO6391.getLanguages(['en', 'zh'])) +// [{code:'en',name:'English',nativeName:'English'},{code:'zh',name:'Chinese',nativeName:'中文'}] + +``` diff --git a/node_modules/iso-639-1/src/data.js b/node_modules/iso-639-1/src/data.js new file mode 100644 index 0000000..e74cfa3 --- /dev/null +++ b/node_modules/iso-639-1/src/data.js @@ -0,0 +1,736 @@ +const LANGUAGES_LIST = { + aa: { + name: 'Afar', + nativeName: 'Afaraf', + }, + ab: { + name: 'Abkhaz', + nativeName: 'аҧсуа бызшәа', + }, + ae: { + name: 'Avestan', + nativeName: 'avesta', + }, + af: { + name: 'Afrikaans', + nativeName: 'Afrikaans', + }, + ak: { + name: 'Akan', + nativeName: 'Akan', + }, + am: { + name: 'Amharic', + nativeName: 'አማርኛ', + }, + an: { + name: 'Aragonese', + nativeName: 'aragonés', + }, + ar: { + name: 'Arabic', + nativeName: 'اَلْعَرَبِيَّةُ', + }, + as: { + name: 'Assamese', + nativeName: 'অসমীয়া', + }, + av: { + name: 'Avaric', + nativeName: 'авар мацӀ', + }, + ay: { + name: 'Aymara', + nativeName: 'aymar aru', + }, + az: { + name: 'Azerbaijani', + nativeName: 'azərbaycan dili', + }, + ba: { + name: 'Bashkir', + nativeName: 'башҡорт теле', + }, + be: { + name: 'Belarusian', + nativeName: 'беларуская мова', + }, + bg: { + name: 'Bulgarian', + nativeName: 'български език', + }, + bi: { + name: 'Bislama', + nativeName: 'Bislama', + }, + bm: { + name: 'Bambara', + nativeName: 'bamanankan', + }, + bn: { + name: 'Bengali', + nativeName: 'বাংলা', + }, + bo: { + name: 'Tibetan', + nativeName: 'བོད་ཡིག', + }, + br: { + name: 'Breton', + nativeName: 'brezhoneg', + }, + bs: { + name: 'Bosnian', + nativeName: 'bosanski jezik', + }, + ca: { + name: 'Catalan', + nativeName: 'Català', + }, + ce: { + name: 'Chechen', + nativeName: 'нохчийн мотт', + }, + ch: { + name: 'Chamorro', + nativeName: 'Chamoru', + }, + co: { + name: 'Corsican', + nativeName: 'corsu', + }, + cr: { + name: 'Cree', + nativeName: 'ᓀᐦᐃᔭᐍᐏᐣ', + }, + cs: { + name: 'Czech', + nativeName: 'čeština', + }, + cu: { + name: 'Old Church Slavonic', + nativeName: 'ѩзыкъ словѣньскъ', + }, + cv: { + name: 'Chuvash', + nativeName: 'чӑваш чӗлхи', + }, + cy: { + name: 'Welsh', + nativeName: 'Cymraeg', + }, + da: { + name: 'Danish', + nativeName: 'dansk', + }, + de: { + name: 'German', + nativeName: 'Deutsch', + }, + dv: { + name: 'Divehi', + nativeName: 'ދިވެހި', + }, + dz: { + name: 'Dzongkha', + nativeName: 'རྫོང་ཁ', + }, + ee: { + name: 'Ewe', + nativeName: 'Eʋegbe', + }, + el: { + name: 'Greek', + nativeName: 'Ελληνικά', + }, + en: { + name: 'English', + nativeName: 'English', + }, + eo: { + name: 'Esperanto', + nativeName: 'Esperanto', + }, + es: { + name: 'Spanish', + nativeName: 'Español', + }, + et: { + name: 'Estonian', + nativeName: 'eesti', + }, + eu: { + name: 'Basque', + nativeName: 'euskara', + }, + fa: { + name: 'Persian', + nativeName: 'فارسی', + }, + ff: { + name: 'Fula', + nativeName: 'Fulfulde', + }, + fi: { + name: 'Finnish', + nativeName: 'suomi', + }, + fj: { + name: 'Fijian', + nativeName: 'vosa Vakaviti', + }, + fo: { + name: 'Faroese', + nativeName: 'føroyskt', + }, + fr: { + name: 'French', + nativeName: 'Français', + }, + fy: { + name: 'Western Frisian', + nativeName: 'Frysk', + }, + ga: { + name: 'Irish', + nativeName: 'Gaeilge', + }, + gd: { + name: 'Scottish Gaelic', + nativeName: 'Gàidhlig', + }, + gl: { + name: 'Galician', + nativeName: 'galego', + }, + gn: { + name: 'Guaraní', + nativeName: "Avañe'ẽ", + }, + gu: { + name: 'Gujarati', + nativeName: 'ગુજરાતી', + }, + gv: { + name: 'Manx', + nativeName: 'Gaelg', + }, + ha: { + name: 'Hausa', + nativeName: 'هَوُسَ', + }, + he: { + name: 'Hebrew', + nativeName: 'עברית', + }, + hi: { + name: 'Hindi', + nativeName: 'हिन्दी', + }, + ho: { + name: 'Hiri Motu', + nativeName: 'Hiri Motu', + }, + hr: { + name: 'Croatian', + nativeName: 'Hrvatski', + }, + ht: { + name: 'Haitian', + nativeName: 'Kreyòl ayisyen', + }, + hu: { + name: 'Hungarian', + nativeName: 'magyar', + }, + hy: { + name: 'Armenian', + nativeName: 'Հայերեն', + }, + hz: { + name: 'Herero', + nativeName: 'Otjiherero', + }, + ia: { + name: 'Interlingua', + nativeName: 'Interlingua', + }, + id: { + name: 'Indonesian', + nativeName: 'Bahasa Indonesia', + }, + ie: { + name: 'Interlingue', + nativeName: 'Interlingue', + }, + ig: { + name: 'Igbo', + nativeName: 'Asụsụ Igbo', + }, + ii: { + name: 'Nuosu', + nativeName: 'ꆈꌠ꒿ Nuosuhxop', + }, + ik: { + name: 'Inupiaq', + nativeName: 'Iñupiaq', + }, + io: { + name: 'Ido', + nativeName: 'Ido', + }, + is: { + name: 'Icelandic', + nativeName: 'Íslenska', + }, + it: { + name: 'Italian', + nativeName: 'Italiano', + }, + iu: { + name: 'Inuktitut', + nativeName: 'ᐃᓄᒃᑎᑐᑦ', + }, + ja: { + name: 'Japanese', + nativeName: '日本語', + }, + jv: { + name: 'Javanese', + nativeName: 'basa Jawa', + }, + ka: { + name: 'Georgian', + nativeName: 'ქართული', + }, + kg: { + name: 'Kongo', + nativeName: 'Kikongo', + }, + ki: { + name: 'Kikuyu', + nativeName: 'Gĩkũyũ', + }, + kj: { + name: 'Kwanyama', + nativeName: 'Kuanyama', + }, + kk: { + name: 'Kazakh', + nativeName: 'қазақ тілі', + }, + kl: { + name: 'Kalaallisut', + nativeName: 'kalaallisut', + }, + km: { + name: 'Khmer', + nativeName: 'ខេមរភាសា', + }, + kn: { + name: 'Kannada', + nativeName: 'ಕನ್ನಡ', + }, + ko: { + name: 'Korean', + nativeName: '한국어', + }, + kr: { + name: 'Kanuri', + nativeName: 'Kanuri', + }, + ks: { + name: 'Kashmiri', + nativeName: 'कश्मीरी', + }, + ku: { + name: 'Kurdish', + nativeName: 'Kurdî', + }, + kv: { + name: 'Komi', + nativeName: 'коми кыв', + }, + kw: { + name: 'Cornish', + nativeName: 'Kernewek', + }, + ky: { + name: 'Kyrgyz', + nativeName: 'Кыргызча', + }, + la: { + name: 'Latin', + nativeName: 'latine', + }, + lb: { + name: 'Luxembourgish', + nativeName: 'Lëtzebuergesch', + }, + lg: { + name: 'Ganda', + nativeName: 'Luganda', + }, + li: { + name: 'Limburgish', + nativeName: 'Limburgs', + }, + ln: { + name: 'Lingala', + nativeName: 'Lingála', + }, + lo: { + name: 'Lao', + nativeName: 'ພາສາລາວ', + }, + lt: { + name: 'Lithuanian', + nativeName: 'lietuvių kalba', + }, + lu: { + name: 'Luba-Katanga', + nativeName: 'Kiluba', + }, + lv: { + name: 'Latvian', + nativeName: 'latviešu valoda', + }, + mg: { + name: 'Malagasy', + nativeName: 'fiteny malagasy', + }, + mh: { + name: 'Marshallese', + nativeName: 'Kajin M̧ajeļ', + }, + mi: { + name: 'Māori', + nativeName: 'te reo Māori', + }, + mk: { + name: 'Macedonian', + nativeName: 'македонски јазик', + }, + ml: { + name: 'Malayalam', + nativeName: 'മലയാളം', + }, + mn: { + name: 'Mongolian', + nativeName: 'Монгол хэл', + }, + mr: { + name: 'Marathi', + nativeName: 'मराठी', + }, + ms: { + name: 'Malay', + nativeName: 'Bahasa Melayu', + }, + mt: { + name: 'Maltese', + nativeName: 'Malti', + }, + my: { + name: 'Burmese', + nativeName: 'ဗမာစာ', + }, + na: { + name: 'Nauru', + nativeName: 'Dorerin Naoero', + }, + nb: { + name: 'Norwegian Bokmål', + nativeName: 'Norsk bokmål', + }, + nd: { + name: 'Northern Ndebele', + nativeName: 'isiNdebele', + }, + ne: { + name: 'Nepali', + nativeName: 'नेपाली', + }, + ng: { + name: 'Ndonga', + nativeName: 'Owambo', + }, + nl: { + name: 'Dutch', + nativeName: 'Nederlands', + }, + nn: { + name: 'Norwegian Nynorsk', + nativeName: 'Norsk nynorsk', + }, + no: { + name: 'Norwegian', + nativeName: 'Norsk', + }, + nr: { + name: 'Southern Ndebele', + nativeName: 'isiNdebele', + }, + nv: { + name: 'Navajo', + nativeName: 'Diné bizaad', + }, + ny: { + name: 'Chichewa', + nativeName: 'chiCheŵa', + }, + oc: { + name: 'Occitan', + nativeName: 'occitan', + }, + oj: { + name: 'Ojibwe', + nativeName: 'ᐊᓂᔑᓈᐯᒧᐎᓐ', + }, + om: { + name: 'Oromo', + nativeName: 'Afaan Oromoo', + }, + or: { + name: 'Oriya', + nativeName: 'ଓଡ଼ିଆ', + }, + os: { + name: 'Ossetian', + nativeName: 'ирон æвзаг', + }, + pa: { + name: 'Panjabi', + nativeName: 'ਪੰਜਾਬੀ', + }, + pi: { + name: 'Pāli', + nativeName: 'पाऴि', + }, + pl: { + name: 'Polish', + nativeName: 'Polski', + }, + ps: { + name: 'Pashto', + nativeName: 'پښتو', + }, + pt: { + name: 'Portuguese', + nativeName: 'Português', + }, + qu: { + name: 'Quechua', + nativeName: 'Runa Simi', + }, + rm: { + name: 'Romansh', + nativeName: 'rumantsch grischun', + }, + rn: { + name: 'Kirundi', + nativeName: 'Ikirundi', + }, + ro: { + name: 'Romanian', + nativeName: 'Română', + }, + ru: { + name: 'Russian', + nativeName: 'Русский', + }, + rw: { + name: 'Kinyarwanda', + nativeName: 'Ikinyarwanda', + }, + sa: { + name: 'Sanskrit', + nativeName: 'संस्कृतम्', + }, + sc: { + name: 'Sardinian', + nativeName: 'sardu', + }, + sd: { + name: 'Sindhi', + nativeName: 'सिन्धी', + }, + se: { + name: 'Northern Sami', + nativeName: 'Davvisámegiella', + }, + sg: { + name: 'Sango', + nativeName: 'yângâ tî sängö', + }, + si: { + name: 'Sinhala', + nativeName: 'සිංහල', + }, + sk: { + name: 'Slovak', + nativeName: 'slovenčina', + }, + sl: { + name: 'Slovenian', + nativeName: 'slovenščina', + }, + sm: { + name: 'Samoan', + nativeName: "gagana fa'a Samoa", + }, + sn: { + name: 'Shona', + nativeName: 'chiShona', + }, + so: { + name: 'Somali', + nativeName: 'Soomaaliga', + }, + sq: { + name: 'Albanian', + nativeName: 'Shqip', + }, + sr: { + name: 'Serbian', + nativeName: 'српски језик', + }, + ss: { + name: 'Swati', + nativeName: 'SiSwati', + }, + st: { + name: 'Southern Sotho', + nativeName: 'Sesotho', + }, + su: { + name: 'Sundanese', + nativeName: 'Basa Sunda', + }, + sv: { + name: 'Swedish', + nativeName: 'Svenska', + }, + sw: { + name: 'Swahili', + nativeName: 'Kiswahili', + }, + ta: { + name: 'Tamil', + nativeName: 'தமிழ்', + }, + te: { + name: 'Telugu', + nativeName: 'తెలుగు', + }, + tg: { + name: 'Tajik', + nativeName: 'тоҷикӣ', + }, + th: { + name: 'Thai', + nativeName: 'ไทย', + }, + ti: { + name: 'Tigrinya', + nativeName: 'ትግርኛ', + }, + tk: { + name: 'Turkmen', + nativeName: 'Türkmençe', + }, + tl: { + name: 'Tagalog', + nativeName: 'Wikang Tagalog', + }, + tn: { + name: 'Tswana', + nativeName: 'Setswana', + }, + to: { + name: 'Tonga', + nativeName: 'faka Tonga', + }, + tr: { + name: 'Turkish', + nativeName: 'Türkçe', + }, + ts: { + name: 'Tsonga', + nativeName: 'Xitsonga', + }, + tt: { + name: 'Tatar', + nativeName: 'татар теле', + }, + tw: { + name: 'Twi', + nativeName: 'Twi', + }, + ty: { + name: 'Tahitian', + nativeName: 'Reo Tahiti', + }, + ug: { + name: 'Uyghur', + nativeName: 'ئۇيغۇرچە‎', + }, + uk: { + name: 'Ukrainian', + nativeName: 'Українська', + }, + ur: { + name: 'Urdu', + nativeName: 'اردو', + }, + uz: { + name: 'Uzbek', + nativeName: 'Ўзбек', + }, + ve: { + name: 'Venda', + nativeName: 'Tshivenḓa', + }, + vi: { + name: 'Vietnamese', + nativeName: 'Tiếng Việt', + }, + vo: { + name: 'Volapük', + nativeName: 'Volapük', + }, + wa: { + name: 'Walloon', + nativeName: 'walon', + }, + wo: { + name: 'Wolof', + nativeName: 'Wollof', + }, + xh: { + name: 'Xhosa', + nativeName: 'isiXhosa', + }, + yi: { + name: 'Yiddish', + nativeName: 'ייִדיש', + }, + yo: { + name: 'Yoruba', + nativeName: 'Yorùbá', + }, + za: { + name: 'Zhuang', + nativeName: 'Saɯ cueŋƅ', + }, + zh: { + name: 'Chinese', + nativeName: '中文', + }, + zu: { + name: 'Zulu', + nativeName: 'isiZulu', + }, +}; + +export default LANGUAGES_LIST; diff --git a/node_modules/iso-639-1/src/index.js b/node_modules/iso-639-1/src/index.js new file mode 100644 index 0000000..9069e2d --- /dev/null +++ b/node_modules/iso-639-1/src/index.js @@ -0,0 +1,47 @@ +import LANGUAGES_LIST from './data'; + +export default class ISO6391 { + static getLanguages(codes = []) { + return codes.map(code => ({ + code, + name: ISO6391.getName(code), + nativeName: ISO6391.getNativeName(code), + })); + } + + static getName(code) { + return ISO6391.validate(code) ? LANGUAGES_LIST[code].name : ''; + } + + static getAllNames() { + return Object.values(LANGUAGES_LIST).map(l => l.name); + } + + static getNativeName(code) { + return ISO6391.validate(code) ? LANGUAGES_LIST[code].nativeName : ''; + } + + static getAllNativeNames() { + return Object.values(LANGUAGES_LIST).map(l => l.nativeName); + } + + static getCode(name) { + const code = Object.keys(LANGUAGES_LIST).find(code => { + const language = LANGUAGES_LIST[code]; + + return ( + language.name.toLowerCase() === name.toLowerCase() || + language.nativeName.toLowerCase() === name.toLowerCase() + ); + }); + return code || ''; + } + + static getAllCodes() { + return Object.keys(LANGUAGES_LIST); + } + + static validate(code) { + return LANGUAGES_LIST.hasOwnProperty(code); + } +} diff --git a/node_modules/iso-639-1/test/test.js b/node_modules/iso-639-1/test/test.js new file mode 100644 index 0000000..a84156c --- /dev/null +++ b/node_modules/iso-639-1/test/test.js @@ -0,0 +1,92 @@ +const assert = require('assert'); +const ISO6391 = require('../build/index'); + +describe('getName()', function() { + it('en', function() { + assert.equal(ISO6391.getName('en'), 'English'); + }); + it('zh', function() { + assert.equal(ISO6391.getName('zh'), 'Chinese'); + }); + it('xx', function() { + assert.equal(ISO6391.getName('xx'), ''); + }); + it('toString', function() { + assert.equal(ISO6391.getName('toString'), ''); + }); +}); + +describe('getNativeName()', function() { + it('en', function() { + assert.equal(ISO6391.getNativeName('en'), 'English'); + }); + it('zh', function() { + assert.equal(ISO6391.getNativeName('zh'), '中文'); + }); + it('xx', function() { + assert.equal(ISO6391.getNativeName('xx'), ''); + }); + it('toString', function() { + assert.equal(ISO6391.getNativeName('toString'), ''); + }); +}); + +describe('getCode()', function() { + it('English', function() { + assert.equal(ISO6391.getCode('English'), 'en'); + }); + it('Chinese', function() { + assert.equal(ISO6391.getCode('Chinese'), 'zh'); + }); + it('中文', function() { + assert.equal(ISO6391.getCode('中文'), 'zh'); + }); + it('xx', function() { + assert.equal(ISO6391.getCode('xx'), ''); + }); + it('toString', function() { + assert.equal(ISO6391.getCode('toString'), ''); + }); +}); + +describe('validate()', function() { + it('en', function() { + assert.equal(ISO6391.validate('en'), true); + }); + it('zh', function() { + assert.equal(ISO6391.validate('zh'), true); + }); + it('xx', function() { + assert.equal(ISO6391.validate('xx'), false); + }); + it('toString', function() { + assert.equal(ISO6391.validate('toString'), false); + }); +}); + +describe('getLanguages()', function() { + it('[en, zh, xx, toString]', function() { + assert.deepEqual(ISO6391.getLanguages(['en', 'zh', 'xx', 'toString']), [ + { + code: 'en', + name: 'English', + nativeName: 'English', + }, + { + code: 'zh', + name: 'Chinese', + nativeName: '中文', + }, + { + code: 'xx', + name: '', + nativeName: '', + }, + { + code: 'toString', + name: '', + nativeName: '', + }, + ]); + }); +}); diff --git a/node_modules/iso-639-1/webpack.config.js b/node_modules/iso-639-1/webpack.config.js new file mode 100644 index 0000000..926f6bb --- /dev/null +++ b/node_modules/iso-639-1/webpack.config.js @@ -0,0 +1,41 @@ +const path = require('path'); +const webpack = require('webpack'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); +// const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); + +// webpack 配置 +let webpackConfig = { + entry: { + index: './src/index.js', + }, + output: { + path: path.resolve(__dirname, `./build`), // 输出路径 + filename: '[name].js', // js 文件路径 + library: 'ISO6391', + libraryTarget: 'umd' + }, + devtool: 'cheap-source-map', + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + cacheDirectory: require('os').tmpdir(), + presets: ['es2015', 'stage-0'], + plugins: ['add-module-exports', 'transform-runtime'], + }, + }, + }, + ], + }, + plugins: [ + new webpack.NamedModulesPlugin(), + new CleanWebpackPlugin(['./build']), + // new UglifyJSPlugin() + ], +}; + +module.exports = webpackConfig; diff --git a/node_modules/jackspeak/LICENSE.md b/node_modules/jackspeak/LICENSE.md new file mode 100644 index 0000000..8cb5cc6 --- /dev/null +++ b/node_modules/jackspeak/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/node_modules/jackspeak/README.md b/node_modules/jackspeak/README.md new file mode 100644 index 0000000..4ffea4b --- /dev/null +++ b/node_modules/jackspeak/README.md @@ -0,0 +1,357 @@ +# jackspeak + +A very strict and proper argument parser. + +Validate string, boolean, and number options, from the command +line and the environment. + +Call the `jack` method with a config object, and then chain +methods off of it. + +At the end, call the `.parse()` method, and you'll get an object +with `positionals` and `values` members. + +Any unrecognized configs or invalid values will throw an error. + +As long as you define configs using object literals, types will +be properly inferred and TypeScript will know what kinds of +things you got. + +If you give it a prefix for environment variables, then defaults +will be read from the environment, and parsed values written back +to it, so you can easily pass configs through to child processes. + +Automatically generates a `usage`/`help` banner by calling the +`.usage()` method. + +Unless otherwise noted, all methods return the object itself. + +## USAGE + +```js +import { jack } from 'jackspeak' +// this works too: +// const { jack } = require('jackspeak') + +const { positionals, values } = jack({ envPrefix: 'FOO' }) + .flag({ + asdf: { description: 'sets the asfd flag', short: 'a', default: true }, + 'no-asdf': { description: 'unsets the asdf flag', short: 'A' }, + foo: { description: 'another boolean', short: 'f' }, + }) + .optList({ + 'ip-addrs': { + description: 'addresses to ip things', + delim: ',', // defaults to '\n' + default: ['127.0.0.1'], + }, + }) + .parse([ + 'some', + 'positional', + '--ip-addrs', + '192.168.0.1', + '--ip-addrs', + '1.1.1.1', + 'args', + '--foo', // sets the foo flag + '-A', // short for --no-asdf, sets asdf flag to false + ]) + +console.log(process.env.FOO_ASDF) // '0' +console.log(process.env.FOO_FOO) // '1' +console.log(values) // { +// 'ip-addrs': ['192.168.0.1', '1.1.1.1'], +// foo: true, +// asdf: false, +// } +console.log(process.env.FOO_IP_ADDRS) // '192.168.0.1,1.1.1.1' +console.log(positionals) // ['some', 'positional', 'args'] +``` + +## `jack(options: JackOptions = {}) => Jack` + +Returns a `Jack` object that can be used to chain and add +field definitions. The other methods (apart from `validate()`, +`parse()`, and `usage()` obviously) return the same Jack object, +updated with the new types, so they can be chained together as +shown in the code examples. + +Options: + +- `allowPositionals` Defaults to true. Set to `false` to not + allow any positional arguments. + +- `envPrefix` Set to a string to write configs to and read + configs from the environment. For example, if set to `MY_APP` + then the `foo-bar` config will default based on the value of + `env.MY_APP_FOO_BAR` and will write back to that when parsed. + + Boolean values are written as `'1'` and `'0'`, and will be + treated as `true` if they're `'1'` or false otherwise. + + Number values are written with their `toString()` + representation. + + Strings are just strings. + + Any value with `multiple: true` will be represented in the + environment split by a delimiter, which defaults to `\n`. + +- `env` The place to read/write environment variables. Defaults + to `process.env`. + +- `usage` A short usage string to print at the top of the help + banner. + +- `stopAtPositional` Boolean, default false. Stop parsing opts + and flags at the first positional argument. This is useful if + you want to pass certain options to subcommands, like some + programs do, so you can stop parsing and pass the positionals + to the subcommand to parse. + +- `stopAtPositionalTest` Conditional `stopAtPositional`. Provide + a function that takes a positional argument string and returns + boolean. If it returns `true`, then parsing will stop. Useful + when _some_ subcommands should parse the rest of the command + line options, and others should not. + +### `Jack.heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6)` + +Define a short string heading, used in the `usage()` output. + +Indentation of the heading and subsequent description/config +usage entries (up until the next heading) is set by the heading +level. + +If the first usage item defined is a heading, it is always +treated as level 1, regardless of the argument provided. + +Headings level 1 and 2 will have a line of padding underneath +them. Headings level 3 through 6 will not. + +### `Jack.description(text: string, { pre?: boolean } = {})` + +Define a long string description, used in the `usage()` output. + +If the `pre` option is set to `true`, then whitespace will not be +normalized. However, if any line is too long for the width +allotted, it will still be wrapped. + +## Option Definitions + +Configs are defined by calling the appropriate field definition +method with an object where the keys are the long option name, +and the value defines the config. + +Options: + +- `type` Only needed for the `addFields` method, as the others + set it implicitly. Can be `'string'`, `'boolean'`, or + `'number'`. +- `multiple` Only needed for the `addFields` method, as the + others set it implicitly. Set to `true` to define an array + type. This means that it can be set on the CLI multiple times, + set as an array in the `values` + and it is represented in the environment as a delimited string. +- `short` A one-character shorthand for the option. +- `description` Some words to describe what this option is and + why you'd set it. +- `hint` (Only relevant for non-boolean types) The thing to show + in the usage output, like `--option=` +- `validate` A function that returns false (or throws) if an + option value is invalid. +- `validOptions` An array of strings or numbers that define the + valid values that can be set. This is not allowed on `boolean` + (flag) options. May be used along with a `validate()` method. +- `default` A default value for the field. Note that this may be + overridden by an environment variable, if present. + +### `Jack.flag({ [option: string]: definition, ... })` + +Define one or more boolean fields. + +Boolean options may be set to `false` by using a +`--no-${optionName}` argument, which will be implicitly created +if it's not defined to be something else. + +If a boolean option named `no-${optionName}` with the same +`multiple` setting is in the configuration, then that will be +treated as a negating flag. + +### `Jack.flagList({ [option: string]: definition, ... })` + +Define one or more boolean array fields. + +### `Jack.num({ [option: string]: definition, ... })` + +Define one or more number fields. These will be set in the +environment as a stringified number, and included in the `values` +object as a number. + +### `Jack.numList({ [option: string]: definition, ... })` + +Define one or more number list fields. These will be set in the +environment as a delimited set of stringified numbers, and +included in the `values` as a number array. + +### `Jack.opt({ [option: string]: definition, ... })` + +Define one or more string option fields. + +### `Jack.optList({ [option: string]: definition, ... })` + +Define one or more string list fields. + +### `Jack.addFields({ [option: string]: definition, ... })` + +Define one or more fields of any type. Note that `type` and +`multiple` must be set explicitly on each definition when using +this method. + +## Actions + +Use these methods on a Jack object that's already had its config +fields defined. + +### `Jack.parse(args: string[] = process.argv): { positionals: string[], values: OptionsResults }` + +Parse the arguments list, write to the environment if `envPrefix` +is set, and returned the parsed values and remaining positional +arguments. + +### `Jack.validate(o: any): asserts o is OptionsResults` + +Throws an error if the object provided is not a valid result set, +for the configurations defined thusfar. + +### `Jack.usage(): string` + +Returns the compiled `usage` string, with all option descriptions +and heading/description text, wrapped to the appropriate width +for the terminal. + +### `Jack.setConfigValues(options: OptionsResults, src?: string)` + +Validate the `options` argument, and set the default value for +each field that appears in the options. + +Values provided will be overridden by environment variables or +command line arguments. + +### `Jack.usageMarkdown(): string` + +Returns the compiled `usage` string, with all option descriptions +and heading/description text, but as markdown instead of +formatted for a terminal, for generating HTML documentation for +your CLI. + +## Some Example Code + +Also see [the examples +folder](https://github.com/isaacs/jackspeak/tree/master/examples) + +```js +import { jack } from 'jackspeak' + +const j = jack({ + // Optional + // This will be auto-generated from the descriptions if not supplied + // top level usage line, printed by -h + // will be auto-generated if not specified + usage: 'foo [options] ', +}) + .heading('The best Foo that ever Fooed') + .description( + ` + Executes all the files and interprets their output as + TAP formatted test result data. + + To parse TAP data from stdin, specify "-" as a filename. + `, + ) + + // flags don't take a value, they're boolean on or off, and can be + // turned off by prefixing with `--no-` + // so this adds support for -b to mean --bail, or -B to mean --no-bail + .flag({ + flag: { + // specify a short value if you like. this must be a single char + short: 'f', + // description is optional as well. + description: `Make the flags wave`, + // default value for flags is 'false', unless you change it + default: true, + }, + 'no-flag': { + // you can can always negate a flag with `--no-flag` + // specifying a negate option will let you define a short + // single-char option for negation. + short: 'F', + description: `Do not wave the flags`, + }, + }) + + // Options that take a value are specified with `opt()` + .opt({ + reporter: { + short: 'R', + description: 'the style of report to display', + }, + }) + + // if you want a number, say so, and jackspeak will enforce it + .num({ + jobs: { + short: 'j', + description: 'how many jobs to run in parallel', + default: 1, + }, + }) + + // A list is an option that can be specified multiple times, + // to expand into an array of all the settings. Normal opts + // will just give you the last value specified. + .optList({ + 'node-arg': {}, + }) + + // a flagList is an array of booleans, so `-ddd` is [true, true, true] + // count the `true` values to treat it as a counter. + .flagList({ + debug: { short: 'd' }, + }) + + // opts take a value, and is set to the string in the results + // you can combine multiple short-form flags together, but + // an opt will end the combine chain, posix-style. So, + // -bofilename would be like --bail --output-file=filename + .opt({ + 'output-file': { + short: 'o', + // optional: make it -o in the help output insead of -o + hint: 'file', + description: `Send the raw output to the specified file.`, + }, + }) + +// now we can parse argv like this: +const { values, positionals } = j.parse(process.argv) + +// or decide to show the usage banner +console.log(j.usage()) + +// or validate an object config we got from somewhere else +try { + j.validate(someConfig) +} catch (er) { + console.error('someConfig is not valid!', er) +} +``` + +## Name + +The inspiration for this module is [yargs](http://npm.im/yargs), which +is pirate talk themed. Yargs has all the features, and is infinitely +flexible. "Jackspeak" is the slang of the royal navy. This module +does not have all the features. It is declarative and rigid by design. diff --git a/node_modules/jackspeak/dist/commonjs/index.d.ts b/node_modules/jackspeak/dist/commonjs/index.d.ts new file mode 100644 index 0000000..d28bcc1 --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/index.d.ts @@ -0,0 +1,315 @@ +/// +export type ConfigType = 'number' | 'string' | 'boolean'; +/** + * Given a Jack object, get the typeof its ConfigSet + */ +export type Unwrap = J extends Jack ? C : never; +import { inspect, InspectOptions } from 'node:util'; +/** + * Defines the type of value that is valid, given a config definition's + * {@link ConfigType} and boolean multiple setting + */ +export type ValidValue = [ + T, + M +] extends ['number', true] ? number[] : [T, M] extends ['string', true] ? string[] : [T, M] extends ['boolean', true] ? boolean[] : [T, M] extends ['number', false] ? number : [T, M] extends ['string', false] ? string : [T, M] extends ['boolean', false] ? boolean : [T, M] extends ['string', boolean] ? string | string[] : [T, M] extends ['boolean', boolean] ? boolean | boolean[] : [T, M] extends ['number', boolean] ? number | number[] : [T, M] extends [ConfigType, false] ? string | number | boolean : [T, M] extends [ConfigType, true] ? string[] | number[] | boolean[] : string | number | boolean | string[] | number[] | boolean[]; +/** + * The meta information for a config option definition, when the + * type and multiple values can be inferred by the method being used + */ +export type ConfigOptionMeta = { + default?: undefined | (ValidValue & (O extends number[] | string[] ? M extends false ? O[number] : O[number][] : unknown)); + validOptions?: O; + description?: string; + validate?: ((v: unknown) => v is ValidValue) | ((v: unknown) => boolean); + short?: string | undefined; + type?: T; + hint?: T extends 'boolean' ? never : string; + delim?: M extends true ? string : never; +} & (M extends false ? { + multiple?: false | undefined; +} : M extends true ? { + multiple: true; +} : { + multiple?: boolean; +}); +/** + * A set of {@link ConfigOptionMeta} fields, referenced by their longOption + * string values. + */ +export type ConfigMetaSet = { + [longOption: string]: ConfigOptionMeta; +}; +/** + * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet} + */ +export type ConfigSetFromMetaSet> = { + [longOption in keyof S]: ConfigOptionBase; +}; +/** + * Fields that can be set on a {@link ConfigOptionBase} or + * {@link ConfigOptionMeta} based on whether or not the field is known to be + * multiple. + */ +export type MultiType = M extends true ? { + multiple: true; + delim?: string | undefined; +} : M extends false ? { + multiple?: false | undefined; + delim?: undefined; +} : { + multiple?: boolean | undefined; + delim?: string | undefined; +}; +/** + * A config field definition, in its full representation. + */ +export type ConfigOptionBase = { + type: T; + short?: string | undefined; + default?: ValidValue | undefined; + description?: string; + hint?: T extends 'boolean' ? undefined : string | undefined; + validate?: (v: unknown) => v is ValidValue; + validOptions?: T extends 'boolean' ? undefined : T extends 'string' ? readonly string[] : T extends 'number' ? readonly number[] : readonly number[] | readonly string[]; +} & MultiType; +export declare const isConfigType: (t: string) => t is ConfigType; +export declare const isConfigOption: (o: any, type: T, multi: M) => o is ConfigOptionBase; +/** + * A set of {@link ConfigOptionBase} objects, referenced by their longOption + * string values. + */ +export type ConfigSet = { + [longOption: string]: ConfigOptionBase; +}; +/** + * The 'values' field returned by {@link Jack#parse} + */ +export type OptionsResults = { + [k in keyof T]?: T[k]['validOptions'] extends (readonly string[] | readonly number[]) ? T[k] extends ConfigOptionBase<'string' | 'number', false> ? T[k]['validOptions'][number] : T[k] extends ConfigOptionBase<'string' | 'number', true> ? T[k]['validOptions'][number][] : never : T[k] extends ConfigOptionBase<'string', false> ? string : T[k] extends ConfigOptionBase<'string', true> ? string[] : T[k] extends ConfigOptionBase<'number', false> ? number : T[k] extends ConfigOptionBase<'number', true> ? number[] : T[k] extends ConfigOptionBase<'boolean', false> ? boolean : T[k] extends ConfigOptionBase<'boolean', true> ? boolean[] : never; +}; +/** + * The object retured by {@link Jack#parse} + */ +export type Parsed = { + values: OptionsResults; + positionals: string[]; +}; +/** + * A row used when generating the {@link Jack#usage} string + */ +export interface Row { + left?: string; + text: string; + skipLine?: boolean; + type?: string; +} +/** + * A heading for a section in the usage, created by the jack.heading() + * method. + * + * First heading is always level 1, subsequent headings default to 2. + * + * The level of the nearest heading level sets the indentation of the + * description that follows. + */ +export interface Heading extends Row { + type: 'heading'; + text: string; + left?: ''; + skipLine?: boolean; + level: number; + pre?: boolean; +} +/** + * An arbitrary blob of text describing some stuff, set by the + * jack.description() method. + * + * Indentation determined by level of the nearest header. + */ +export interface Description extends Row { + type: 'description'; + text: string; + left?: ''; + skipLine?: boolean; + pre?: boolean; +} +/** + * A heading or description row used when generating the {@link Jack#usage} + * string + */ +export type TextRow = Heading | Description; +/** + * Either a {@link TextRow} or a reference to a {@link ConfigOptionBase} + */ +export type UsageField = TextRow | { + type: 'config'; + name: string; + value: ConfigOptionBase; +}; +/** + * Options provided to the {@link Jack} constructor + */ +export interface JackOptions { + /** + * Whether to allow positional arguments + * + * @default true + */ + allowPositionals?: boolean; + /** + * Prefix to use when reading/writing the environment variables + * + * If not specified, environment behavior will not be available. + */ + envPrefix?: string; + /** + * Environment object to read/write. Defaults `process.env`. + * No effect if `envPrefix` is not set. + */ + env?: { + [k: string]: string | undefined; + }; + /** + * A short usage string. If not provided, will be generated from the + * options provided, but that can of course be rather verbose if + * there are a lot of options. + */ + usage?: string; + /** + * Stop parsing flags and opts at the first positional argument. + * This is to support cases like `cmd [flags] [options]`, where + * each subcommand may have different options. This effectively treats + * any positional as a `--` argument. Only relevant if `allowPositionals` + * is true. + * + * To do subcommands, set this option, look at the first positional, and + * parse the remaining positionals as appropriate. + * + * @default false + */ + stopAtPositional?: boolean; + /** + * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function, + * will be called with each positional argument encountered. If the function + * returns true, then parsing will stop at that point. + */ + stopAtPositionalTest?: (arg: string) => boolean; +} +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +export declare class Jack { + #private; + constructor(options?: JackOptions); + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values: OptionsResults, source?: string): this; + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args?: string[]): Parsed; + loadEnvDefaults(): void; + applyDefaults(p: Parsed): void; + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args: string[]): Parsed; + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o: unknown): asserts o is Parsed['values']; + writeEnv(p: Parsed): void; + /** + * Add a heading to the usage output banner + */ + heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add a long-form description to the usage output at this position. + */ + description(text: string, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add one or more number fields. + */ + num>(fields: F): Jack>; + /** + * Add one or more multiple number fields. + */ + numList>(fields: F): Jack>; + /** + * Add one or more string option fields. + */ + opt>(fields: F): Jack>; + /** + * Add one or more multiple string option fields. + */ + optList>(fields: F): Jack>; + /** + * Add one or more flag fields. + */ + flag>(fields: F): Jack>; + /** + * Add one or more multiple flag fields. + */ + flagList>(fields: F): Jack>; + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields: F): Jack; + /** + * Return the usage banner for the given configuration + */ + usage(): string; + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown(): string; + /** + * Return the configuration options as a plain object + */ + toJSON(): { + [k: string]: { + hint?: string | undefined; + default?: string | number | boolean | string[] | number[] | boolean[] | undefined; + validOptions?: readonly number[] | readonly string[] | undefined; + validate?: ((v: unknown) => v is string | number | boolean | string[] | number[] | boolean[]) | undefined; + description?: string | undefined; + short?: string | undefined; + delim?: string | undefined; + multiple?: boolean | undefined; + type: ConfigType; + }; + }; + /** + * Custom printer for `util.inspect` + */ + [inspect.custom](_: number, options: InspectOptions): string; +} +/** + * Main entry point. Create and return a {@link Jack} object. + */ +export declare const jack: (options?: JackOptions) => Jack<{}>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/commonjs/index.d.ts.map b/node_modules/jackspeak/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..faf9ddd --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAmB,MAAM,WAAW,CAAA;AA2DpE;;;GAGG;AACH,MAAM,MAAM,UAAU,CACpB,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,OAAO,GAAG,OAAO,IAE3B;IAAC,CAAC;IAAE,CAAC;CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,GACxC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,GAC1C,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,OAAO,EAAE,GAC5C,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,MAAM,GACzC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,E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EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAItD;;OAEG;IACH,QAAQ,CAAC,CAAC,SAAS,aAAa,CAAC,SAAS,CAAC,EACzC,MAAM,EAAE,CAAC,GACR,IAAI,CAAC,CAAC,GAAG,oBAAoB,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAIrD;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IA4EtD;;OAEG;IACH,KAAK,IAAI,MAAM;IAgGf;;OAEG;IACH,aAAa,IAAI,MAAM;IAgIvB;;OAEG;IACH,MAAM;;;;;;;;;;;;;IAqBN;;OAEG;IACH,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;CAGpD;AAsED;;GAEG;AACH,eAAO,MAAM,IAAI,aAAa,WAAW,aAA2B,CAAA"} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/commonjs/index.js b/node_modules/jackspeak/dist/commonjs/index.js new file mode 100644 index 0000000..b0e016d --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/index.js @@ -0,0 +1,1010 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.jack = exports.Jack = exports.isConfigOption = exports.isConfigType = void 0; +const node_util_1 = require("node:util"); +const parse_args_js_1 = require("./parse-args.js"); +// it's a tiny API, just cast it inline, it's fine +//@ts-ignore +const cliui_1 = __importDefault(require("@isaacs/cliui")); +const node_path_1 = require("node:path"); +const width = Math.min((process && process.stdout && process.stdout.columns) || 80, 80); +// indentation spaces from heading level +const indent = (n) => (n - 1) * 2; +const toEnvKey = (pref, key) => { + return [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')] + .join(' ') + .trim() + .toUpperCase() + .replace(/ /g, '_'); +}; +const toEnvVal = (value, delim = '\n') => { + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' + : '0' + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; + if (typeof str !== 'string') { + throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`); + } + /* c8 ignore stop */ + return str; +}; +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) + : [] + : type === 'string' ? env + : type === 'boolean' ? env === '1' + : +env.trim()); +const isConfigType = (t) => typeof t === 'string' && + (t === 'string' || t === 'number' || t === 'boolean'); +exports.isConfigType = isConfigType; +const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +const isValidOption = (v, vo) => Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v); +// print the value type, for error message reporting +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' + : `${v.type}${v.multiple ? '[]' : ''}`; +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] + : `(${types.join('|')})`; +const isValidValue = (v, type, multi) => { + if (multi) { + if (!Array.isArray(v)) + return false; + return !v.some((v) => !isValidValue(v, type, false)); + } + if (Array.isArray(v)) + return false; + return typeof v === type; +}; +const isConfigOption = (o, type, multi) => !!o && + typeof o === 'object' && + (0, exports.isConfigType)(o.type) && + o.type === type && + undefOrType(o.short, 'string') && + undefOrType(o.description, 'string') && + undefOrType(o.hint, 'string') && + undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && + (o.default === undefined || isValidValue(o.default, type, multi)) && + !!o.multiple === multi; +exports.isConfigOption = isConfigOption; +function num(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'number', false)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'number', + multiple: false, + }; +} +function numList(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'number', true)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'number', + multiple: true, + }; +} +function opt(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'string', false)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'string', + multiple: false, + }; +} +function optList(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'string', true)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'string', + multiple: true, + }; +} +function flag(o = {}) { + const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; + if (def !== undefined && !isValidValue(def, 'boolean', false)) { + throw new TypeError('invalid default value'); + } + const validate = val ? + val + : undefined; + if (hint !== undefined) { + throw new TypeError('cannot provide hint for flag'); + } + return { + ...rest, + default: def, + validate, + type: 'boolean', + multiple: false, + }; +} +function flagList(o = {}) { + const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; + if (def !== undefined && !isValidValue(def, 'boolean', true)) { + throw new TypeError('invalid default value'); + } + const validate = val ? + val + : undefined; + if (hint !== undefined) { + throw new TypeError('cannot provide hint for flag list'); + } + return { + ...rest, + default: def, + validate, + type: 'boolean', + multiple: true, + }; +} +const toParseArgsOptionsConfig = (options) => { + const c = {}; + for (const longOption in options) { + const config = options[longOption]; + /* c8 ignore start */ + if (!config) { + throw new Error('config must be an object: ' + longOption); + } + /* c8 ignore start */ + if ((0, exports.isConfigOption)(config, 'number', true)) { + c[longOption] = { + type: 'string', + multiple: true, + default: config.default?.map(c => String(c)), + }; + } + else if ((0, exports.isConfigOption)(config, 'number', false)) { + c[longOption] = { + type: 'string', + multiple: false, + default: config.default === undefined ? + undefined + : String(config.default), + }; + } + else { + const conf = config; + c[longOption] = { + type: conf.type, + multiple: !!conf.multiple, + default: conf.default, + }; + } + const clo = c[longOption]; + if (typeof config.short === 'string') { + clo.short = config.short; + } + if (config.type === 'boolean' && + !longOption.startsWith('no-') && + !options[`no-${longOption}`]) { + c[`no-${longOption}`] = { + type: 'boolean', + multiple: config.multiple, + }; + } + } + return c; +}; +const isHeading = (r) => r.type === 'heading'; +const isDescription = (r) => r.type === 'description'; +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +class Jack { + #configSet; + #shorts; + #options; + #fields = []; + #env; + #envPrefix; + #allowPositionals; + #usage; + #usageMarkdown; + constructor(options = {}) { + this.#options = options; + this.#allowPositionals = options.allowPositionals !== false; + this.#env = + this.#options.env === undefined ? process.env : this.#options.env; + this.#envPrefix = options.envPrefix; + // We need to fib a little, because it's always the same object, but it + // starts out as having an empty config set. Then each method that adds + // fields returns `this as Jack` + this.#configSet = Object.create(null); + this.#shorts = Object.create(null); + } + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values, source = '') { + try { + this.validate(values); + } + catch (er) { + const e = er; + if (source && e && typeof e === 'object') { + if (e.cause && typeof e.cause === 'object') { + Object.assign(e.cause, { path: source }); + } + else { + e.cause = { path: source }; + } + } + throw e; + } + for (const [field, value] of Object.entries(values)) { + const my = this.#configSet[field]; + // already validated, just for TS's benefit + /* c8 ignore start */ + if (!my) { + throw new Error('unexpected field in config set: ' + field, { + cause: { found: field }, + }); + } + /* c8 ignore stop */ + my.default = value; + } + return this; + } + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args = process.argv) { + this.loadEnvDefaults(); + const p = this.parseRaw(args); + this.applyDefaults(p); + this.writeEnv(p); + return p; + } + loadEnvDefaults() { + if (this.#envPrefix) { + for (const [field, my] of Object.entries(this.#configSet)) { + const ek = toEnvKey(this.#envPrefix, field); + const env = this.#env[ek]; + if (env !== undefined) { + my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim); + } + } + } + } + applyDefaults(p) { + for (const [field, c] of Object.entries(this.#configSet)) { + if (c.default !== undefined && !(field in p.values)) { + //@ts-ignore + p.values[field] = c.default; + } + } + } + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args) { + if (args === process.argv) { + args = args.slice(process._eval !== undefined ? 1 : 2); + } + const options = toParseArgsOptionsConfig(this.#configSet); + const result = (0, parse_args_js_1.parseArgs)({ + args, + options, + // always strict, but using our own logic + strict: false, + allowPositionals: this.#allowPositionals, + tokens: true, + }); + const p = { + values: {}, + positionals: [], + }; + for (const token of result.tokens) { + if (token.kind === 'positional') { + p.positionals.push(token.value); + if (this.#options.stopAtPositional || + this.#options.stopAtPositionalTest?.(token.value)) { + p.positionals.push(...args.slice(token.index + 1)); + break; + } + } + else if (token.kind === 'option') { + let value = undefined; + if (token.name.startsWith('no-')) { + const my = this.#configSet[token.name]; + const pname = token.name.substring('no-'.length); + const pos = this.#configSet[pname]; + if (pos && + pos.type === 'boolean' && + (!my || + (my.type === 'boolean' && !!my.multiple === !!pos.multiple))) { + value = false; + token.name = pname; + } + } + const my = this.#configSet[token.name]; + if (!my) { + throw new Error(`Unknown option '${token.rawName}'. ` + + `To specify a positional argument starting with a '-', ` + + `place it at the end of the command after '--', as in ` + + `'-- ${token.rawName}'`, { + cause: { + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); + } + if (value === undefined) { + if (token.value === undefined) { + if (my.type !== 'boolean') { + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + name: token.rawName, + wanted: valueType(my), + }, + }); + } + value = true; + } + else { + if (my.type === 'boolean') { + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { found: token } }); + } + if (my.type === 'string') { + value = token.value; + } + else { + value = +token.value; + if (value !== value) { + throw new Error(`Invalid value '${token.value}' provided for ` + + `'${token.rawName}' option, expected number`, { + cause: { + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); + } + } + } + } + if (my.multiple) { + const pv = p.values; + const tn = pv[token.name] ?? []; + pv[token.name] = tn; + tn.push(value); + } + else { + const pv = p.values; + pv[token.name] = value; + } + } + } + for (const [field, value] of Object.entries(p.values)) { + const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + let cause; + if (validOptions && !isValidOption(value, validOptions)) { + cause = { name: field, found: value, validOptions: validOptions }; + } + if (valid && !valid(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause }); + } + } + return p; + } + /** + * do not set fields as 'no-foo' if 'foo' exists and both are bools + * just set foo. + */ + #noNoFields(f, val, s = f) { + if (!f.startsWith('no-') || typeof val !== 'boolean') + return; + const yes = f.substring('no-'.length); + // recurse so we get the core config key we care about. + this.#noNoFields(yes, val, s); + if (this.#configSet[yes]?.type === 'boolean') { + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { found: s, wanted: yes } }); + } + } + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o) { + if (!o || typeof o !== 'object') { + throw new Error('Invalid config: not an object', { + cause: { found: o }, + }); + } + const opts = o; + for (const field in o) { + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); + const config = this.#configSet[field]; + if (!config) { + throw new Error(`Unknown config option: ${field}`, { + cause: { found: field }, + }); + } + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + name: field, + found: value, + wanted: valueType(config), + }, + }); + } + let cause; + if (config.validOptions && + !isValidOption(value, config.validOptions)) { + cause = { + name: field, + found: value, + validOptions: config.validOptions, + }; + } + if (config.validate && !config.validate(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid config value for ${field}: ${value}`, { + cause, + }); + } + } + } + writeEnv(p) { + if (!this.#env || !this.#envPrefix) + return; + for (const [field, value] of Object.entries(p.values)) { + const my = this.#configSet[field]; + this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim); + } + } + /** + * Add a heading to the usage output banner + */ + heading(text, level, { pre = false } = {}) { + if (level === undefined) { + level = this.#fields.some(r => isHeading(r)) ? 2 : 1; + } + this.#fields.push({ type: 'heading', text, level, pre }); + return this; + } + /** + * Add a long-form description to the usage output at this position. + */ + description(text, { pre } = {}) { + this.#fields.push({ type: 'description', text, pre }); + return this; + } + /** + * Add one or more number fields. + */ + num(fields) { + return this.#addFields(fields, num); + } + /** + * Add one or more multiple number fields. + */ + numList(fields) { + return this.#addFields(fields, numList); + } + /** + * Add one or more string option fields. + */ + opt(fields) { + return this.#addFields(fields, opt); + } + /** + * Add one or more multiple string option fields. + */ + optList(fields) { + return this.#addFields(fields, optList); + } + /** + * Add one or more flag fields. + */ + flag(fields) { + return this.#addFields(fields, flag); + } + /** + * Add one or more multiple flag fields. + */ + flagList(fields) { + return this.#addFields(fields, flagList); + } + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields) { + const next = this; + for (const [name, field] of Object.entries(fields)) { + this.#validateName(name, field); + next.#fields.push({ + type: 'config', + name, + value: field, + }); + } + Object.assign(next.#configSet, fields); + return next; + } + #addFields(fields, fn) { + const next = this; + Object.assign(next.#configSet, Object.fromEntries(Object.entries(fields).map(([name, field]) => { + this.#validateName(name, field); + const option = fn(field); + next.#fields.push({ + type: 'config', + name, + value: option, + }); + return [name, option]; + }))); + return next; + } + #validateName(name, field) { + if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) { + throw new TypeError(`Invalid option name: ${name}, ` + + `must be '-' delimited ASCII alphanumeric`); + } + if (this.#configSet[name]) { + throw new TypeError(`Cannot redefine option ${field}`); + } + if (this.#shorts[name]) { + throw new TypeError(`Cannot redefine option ${name}, already ` + + `in use for ${this.#shorts[name]}`); + } + if (field.short) { + if (!/^[a-zA-Z0-9]$/.test(field.short)) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + 'must be 1 ASCII alphanumeric character'); + } + if (this.#shorts[field.short]) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + `already in use for ${this.#shorts[field.short]}`); + } + this.#shorts[field.short] = name; + this.#shorts[name] = name; + } + } + /** + * Return the usage banner for the given configuration + */ + usage() { + if (this.#usage) + return this.#usage; + let headingLevel = 1; + const ui = (0, cliui_1.default)({ width }); + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + ui.div({ + padding: [0, 0, 0, 0], + text: normalize(first.text), + }); + } + ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' }); + if (this.#options.usage) { + ui.div({ + text: this.#options.usage, + padding: [0, 0, 0, 2], + }); + } + else { + const cmd = (0, node_path_1.basename)(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + ui.div({ + text: usage, + padding: [0, 0, 0, 2], + }); + } + ui.div({ padding: [0, 0, 0, 0], text: '' }); + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + const print = normalize(maybeDesc.text, maybeDesc.pre); + start++; + ui.div({ padding: [0, 0, 0, 0], text: print }); + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + const { rows, maxWidth } = this.#usageRows(start); + // every heading/description after the first gets indented by 2 + // extra spaces. + for (const row of rows) { + if (row.left) { + // If the row is too long, don't wrap it + // Bump the right-hand side down a line to make room + const configIndent = indent(Math.max(headingLevel, 2)); + if (row.left.length > maxWidth - 3) { + ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); + ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); + } + else { + ui.div({ + text: row.left, + padding: [0, 1, 0, configIndent], + width: maxWidth, + }, { padding: [0, 0, 0, 0], text: row.text }); + } + if (row.skipLine) { + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + } + else { + if (isHeading(row)) { + const { level } = row; + headingLevel = level; + // only h1 and h2 have bottom padding + // h3-h6 do not + const b = level <= 2 ? 1 : 0; + ui.div({ ...row, padding: [0, 0, b, indent(level)] }); + } + else { + ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); + } + } + } + return (this.#usage = ui.toString()); + } + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown() { + if (this.#usageMarkdown) + return this.#usageMarkdown; + const out = []; + let headingLevel = 1; + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + out.push(`# ${normalizeOneLine(first.text)}`); + } + out.push('Usage:'); + if (this.#options.usage) { + out.push(normalizeMarkdown(this.#options.usage, true)); + } + else { + const cmd = (0, node_path_1.basename)(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + out.push(normalizeMarkdown(usage, true)); + } + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre)); + start++; + } + const { rows } = this.#usageRows(start); + // heading level in markdown is number of # ahead of text + for (const row of rows) { + if (row.left) { + out.push('#'.repeat(headingLevel + 1) + + ' ' + + normalizeOneLine(row.left, true)); + if (row.text) + out.push(normalizeMarkdown(row.text)); + } + else if (isHeading(row)) { + const { level } = row; + headingLevel = level; + out.push(`${'#'.repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`); + } + else { + out.push(normalizeMarkdown(row.text, !!row.pre)); + } + } + return (this.#usageMarkdown = out.join('\n\n') + '\n'); + } + #usageRows(start) { + // turn each config type into a row, and figure out the width of the + // left hand indentation for the option descriptions. + let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3))); + let maxWidth = 8; + let prev = undefined; + const rows = []; + for (const field of this.#fields.slice(start)) { + if (field.type !== 'config') { + if (prev?.type === 'config') + prev.skipLine = true; + prev = undefined; + field.text = normalize(field.text, !!field.pre); + rows.push(field); + continue; + } + const { value } = field; + const desc = value.description || ''; + const mult = value.multiple ? 'Can be set multiple times' : ''; + const opts = value.validOptions?.length ? + `Valid options:${value.validOptions.map(v => ` ${JSON.stringify(v)}`)}` + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); + const hint = value.hint || + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name + : undefined); + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` + : `-${value.short}<${hint}> `; + const left = value.type === 'boolean' ? + `${short}--${field.name}` + : `${short}--${field.name}=<${hint}>`; + const row = { text, left, type: 'config' }; + if (text.length > width - maxMax) { + row.skipLine = true; + } + if (prev && left.length > maxMax) + prev.skipLine = true; + prev = row; + const len = left.length + 4; + if (len > maxWidth && len < maxMax) { + maxWidth = len; + } + rows.push(row); + } + return { rows, maxWidth }; + } + /** + * Return the configuration options as a plain object + */ + toJSON() { + return Object.fromEntries(Object.entries(this.#configSet).map(([field, def]) => [ + field, + { + type: def.type, + ...(def.multiple ? { multiple: true } : {}), + ...(def.delim ? { delim: def.delim } : {}), + ...(def.short ? { short: def.short } : {}), + ...(def.description ? + { description: normalize(def.description) } + : {}), + ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), + ...(def.default !== undefined ? { default: def.default } : {}), + ...(def.hint ? { hint: def.hint } : {}), + }, + ])); + } + /** + * Custom printer for `util.inspect` + */ + [node_util_1.inspect.custom](_, options) { + return `Jack ${(0, node_util_1.inspect)(this.toJSON(), options)}`; + } +} +exports.Jack = Jack; +// Unwrap and un-indent, so we can wrap description +// strings however makes them look nice in the code. +const normalize = (s, pre = false) => { + if (pre) + // prepend a ZWSP to each line so cliui doesn't strip it. + return s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n'); + return s + .split(/^\s*```\s*$/gm) + .map((s, i) => { + if (i % 2 === 1) { + if (!s.trim()) { + return `\`\`\`\n\`\`\`\n`; + } + // outdent the ``` blocks, but preserve whitespace otherwise. + const split = s.split('\n'); + // throw out the \n at the start and end + split.pop(); + split.shift(); + const si = split.reduce((shortest, l) => { + /* c8 ignore next */ + const ind = l.match(/^\s*/)?.[0] ?? ''; + if (ind.length) + return Math.min(ind.length, shortest); + else + return shortest; + }, Infinity); + /* c8 ignore next */ + const i = isFinite(si) ? si : 0; + return ('\n```\n' + + split.map(s => `\u200b${s.substring(i)}`).join('\n') + + '\n```\n'); + } + return (s + // remove single line breaks, except for lists + .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) + // normalize mid-line whitespace + .replace(/([^\n])[ \t]+([^\n])/g, '$1 $2') + // two line breaks are enough + .replace(/\n{3,}/g, '\n\n') + // remove any spaces at the start of a line + .replace(/\n[ \t]+/g, '\n') + .trim()); + }) + .join('\n'); +}; +// normalize for markdown printing, remove leading spaces on lines +const normalizeMarkdown = (s, pre = false) => { + const n = normalize(s, pre).replace(/\\/g, '\\\\'); + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + : n.replace(/\n +/g, '\n').trim(); +}; +const normalizeOneLine = (s, pre = false) => { + const n = normalize(s, pre) + .replace(/[\s\u200b]+/g, ' ') + .trim(); + return pre ? `\`${n}\`` : n; +}; +/** + * Main entry point. Create and return a {@link Jack} object. + */ +const jack = (options = {}) => new Jack(options); +exports.jack = jack; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/commonjs/index.js.map b/node_modules/jackspeak/dist/commonjs/index.js.map new file mode 100644 index 0000000..e30e58c --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAOA,yCAAoE;AACpE,mDAA2C;AAE3C,kDAAkD;AAClD,YAAY;AACZ,0DAAiC;AACjC,yCAAoC;AAEpC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CACpB,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAC3D,EAAE,CACH,CAAA;AAED,wCAAwC;AACxC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,GAAW,EAAU,EAAE;IACrD,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;SAC9C,IAAI,CAAC,GAAG,CAAC;SACT,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CACf,KAAkE,EAClE,QAAgB,IAAI,EACZ,EAAE;IACV,MAAM,GAAG,GACP,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK;QACjC,CAAC,CAAC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC;YAC5B,KAAK,CAAC,CAAC,CAAC,GAAG;gBACX,CAAC,CAAC,GAAG;YACP,CAAC,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C/C,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;AACrC,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAE,MAAe,KAAK,EAAE,EAAE;IAC3D,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,IAAI,EAAE,CAAA;IACT,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED;;GAEG;AACI,MAAM,IAAI,GAAG,CAAC,UAAuB,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;AAAvD,QAAA,IAAI,QAAmD","sourcesContent":["export type ConfigType = 'number' | 'string' | 'boolean'\n\n/**\n * Given a Jack object, get the typeof its ConfigSet\n */\nexport type Unwrap = J extends Jack ? C : never\n\nimport { inspect, InspectOptions, ParseArgsConfig } from 'node:util'\nimport { parseArgs } from './parse-args.js'\n\n// it's a tiny API, just cast it inline, it's fine\n//@ts-ignore\nimport cliui from '@isaacs/cliui'\nimport { basename } from 'node:path'\n\nconst width = Math.min(\n (process && process.stdout && process.stdout.columns) || 80,\n 80,\n)\n\n// indentation spaces from heading level\nconst indent = (n: number) => (n - 1) * 2\n\nconst toEnvKey = (pref: string, key: string): string => {\n return [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')]\n .join(' ')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_')\n}\n\nconst toEnvVal = (\n value: string | boolean | number | string[] | boolean[] | number[],\n delim: string = '\\n',\n): string => {\n const str =\n typeof value === 'string' ? value\n : typeof value === 'boolean' ?\n value ? '1'\n : '0'\n : typeof value === 'number' ? String(value)\n : Array.isArray(value) ?\n value.map((v: string | number | boolean) => toEnvVal(v)).join(delim)\n : /* c8 ignore start */ undefined\n if (typeof str !== 'string') {\n throw new Error(\n `could not serialize value to environment: ${JSON.stringify(value)}`,\n )\n }\n /* c8 ignore stop */\n return str\n}\n\nconst fromEnvVal = (\n env: string,\n type: T,\n multiple: M,\n delim: string = '\\n',\n): ValidValue =>\n (multiple ?\n env ? env.split(delim).map(v => fromEnvVal(v, type, false))\n : []\n : type === 'string' ? env\n : type === 'boolean' ? env === '1'\n : +env.trim()) as ValidValue\n\n/**\n * Defines the type of value that is valid, given a config definition's\n * {@link ConfigType} and boolean multiple setting\n */\nexport type ValidValue<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n> =\n [T, M] extends ['number', true] ? number[]\n : [T, M] extends ['string', true] ? string[]\n : [T, M] extends ['boolean', true] ? boolean[]\n : [T, M] extends ['number', false] ? number\n : [T, M] extends ['string', false] ? string\n : [T, M] extends ['boolean', false] ? boolean\n : [T, M] extends ['string', boolean] ? string | string[]\n : [T, M] extends ['boolean', boolean] ? boolean | boolean[]\n : [T, M] extends ['number', boolean] ? number | number[]\n : [T, M] extends [ConfigType, false] ? string | number | boolean\n : [T, M] extends [ConfigType, true] ? string[] | number[] | boolean[]\n : string | number | boolean | string[] | number[] | boolean[]\n\n/**\n * The meta information for a config option definition, when the\n * type and multiple values can be inferred by the method being used\n */\nexport type ConfigOptionMeta<\n T extends ConfigType,\n M extends boolean = boolean,\n O extends\n | undefined\n | (T extends 'boolean' ? never\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : readonly number[] | readonly string[]) =\n | undefined\n | (T extends 'boolean' ? never\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : readonly number[] | readonly string[]),\n> = {\n default?:\n | undefined\n | (ValidValue &\n (O extends number[] | string[] ?\n M extends false ?\n O[number]\n : O[number][]\n : unknown))\n validOptions?: O\n description?: string\n validate?:\n | ((v: unknown) => v is ValidValue)\n | ((v: unknown) => boolean)\n short?: string | undefined\n type?: T\n hint?: T extends 'boolean' ? never : string\n delim?: M extends true ? string : never\n} & (M extends false ? { multiple?: false | undefined }\n: M extends true ? { multiple: true }\n: { multiple?: boolean })\n\n/**\n * A set of {@link ConfigOptionMeta} fields, referenced by their longOption\n * string values.\n */\nexport type ConfigMetaSet<\n T extends ConfigType,\n M extends boolean = boolean,\n> = {\n [longOption: string]: ConfigOptionMeta\n}\n\n/**\n * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet}\n */\nexport type ConfigSetFromMetaSet<\n T extends ConfigType,\n M extends boolean,\n S extends ConfigMetaSet,\n> = {\n [longOption in keyof S]: ConfigOptionBase\n}\n\n/**\n * Fields that can be set on a {@link ConfigOptionBase} or\n * {@link ConfigOptionMeta} based on whether or not the field is known to be\n * multiple.\n */\nexport type MultiType =\n M extends true ?\n {\n multiple: true\n delim?: string | undefined\n }\n : M extends false ?\n {\n multiple?: false | undefined\n delim?: undefined\n }\n : {\n multiple?: boolean | undefined\n delim?: string | undefined\n }\n\n/**\n * A config field definition, in its full representation.\n */\nexport type ConfigOptionBase<\n T extends ConfigType,\n M extends boolean = boolean,\n> = {\n type: T\n short?: string | undefined\n default?: ValidValue | undefined\n description?: string\n hint?: T extends 'boolean' ? undefined : string | undefined\n validate?: (v: unknown) => v is ValidValue\n validOptions?: T extends 'boolean' ? undefined\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : readonly number[] | readonly string[]\n} & MultiType\n\nexport const isConfigType = (t: string): t is ConfigType =>\n typeof t === 'string' &&\n (t === 'string' || t === 'number' || t === 'boolean')\n\nconst undefOrType = (v: unknown, t: string): boolean =>\n v === undefined || typeof v === t\nconst undefOrTypeArray = (v: unknown, t: string): boolean =>\n v === undefined || (Array.isArray(v) && v.every(x => typeof x === t))\n\nconst isValidOption = (v: unknown, vo: readonly unknown[]): boolean =>\n Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v)\n\n// print the value type, for error message reporting\nconst valueType = (\n v:\n | string\n | number\n | boolean\n | string[]\n | number[]\n | boolean[]\n | { type: ConfigType; multiple?: boolean },\n): string =>\n typeof v === 'string' ? 'string'\n : typeof v === 'boolean' ? 'boolean'\n : typeof v === 'number' ? 'number'\n : Array.isArray(v) ?\n joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]'\n : `${v.type}${v.multiple ? '[]' : ''}`\n\nconst joinTypes = (types: string[]): string =>\n types.length === 1 && typeof types[0] === 'string' ?\n types[0]\n : `(${types.join('|')})`\n\nconst isValidValue = (\n v: unknown,\n type: T,\n multi: M,\n): v is ValidValue => {\n if (multi) {\n if (!Array.isArray(v)) return false\n return !v.some((v: unknown) => !isValidValue(v, type, false))\n }\n if (Array.isArray(v)) return false\n return typeof v === type\n}\n\nexport const isConfigOption = (\n o: any,\n type: T,\n multi: M,\n): o is ConfigOptionBase =>\n !!o &&\n typeof o === 'object' &&\n isConfigType(o.type) &&\n o.type === type &&\n undefOrType(o.short, 'string') &&\n undefOrType(o.description, 'string') &&\n undefOrType(o.hint, 'string') &&\n undefOrType(o.validate, 'function') &&\n (o.type === 'boolean' ?\n o.validOptions === undefined\n : undefOrTypeArray(o.validOptions, o.type)) &&\n (o.default === undefined || isValidValue(o.default, type, multi)) &&\n !!o.multiple === multi\n\n/**\n * A set of {@link ConfigOptionBase} objects, referenced by their longOption\n * string values.\n */\nexport type ConfigSet = {\n [longOption: string]: ConfigOptionBase\n}\n\n/**\n * The 'values' field returned by {@link Jack#parse}\n */\nexport type OptionsResults = {\n [k in keyof T]?: T[k]['validOptions'] extends (\n readonly string[] | readonly number[]\n ) ?\n T[k] extends ConfigOptionBase<'string' | 'number', false> ?\n T[k]['validOptions'][number]\n : T[k] extends ConfigOptionBase<'string' | 'number', true> ?\n T[k]['validOptions'][number][]\n : never\n : T[k] extends ConfigOptionBase<'string', false> ? string\n : T[k] extends ConfigOptionBase<'string', true> ? string[]\n : T[k] extends ConfigOptionBase<'number', false> ? number\n : T[k] extends ConfigOptionBase<'number', true> ? number[]\n : T[k] extends ConfigOptionBase<'boolean', false> ? boolean\n : T[k] extends ConfigOptionBase<'boolean', true> ? boolean[]\n : never\n}\n\n/**\n * The object retured by {@link Jack#parse}\n */\nexport type Parsed = {\n values: OptionsResults\n positionals: string[]\n}\n\nfunction num(\n o: ConfigOptionMeta<'number', false> = {},\n): ConfigOptionBase<'number', false> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'number', false)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'number',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'number')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'number[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'number', false>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'number',\n multiple: false,\n }\n}\n\nfunction numList(\n o: ConfigOptionMeta<'number'> = {},\n): ConfigOptionBase<'number', true> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'number', true)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'number[]',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'number')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'number[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'number', true>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'number',\n multiple: true,\n }\n}\n\nfunction opt(\n o: ConfigOptionMeta<'string', false> = {},\n): ConfigOptionBase<'string', false> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'string', false)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'string',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'string')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'string[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'string', false>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'string',\n multiple: false,\n }\n}\n\nfunction optList(\n o: ConfigOptionMeta<'string'> = {},\n): ConfigOptionBase<'string', true> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'string', true)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'string[]',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'string')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'string[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'string', true>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'string',\n multiple: true,\n }\n}\n\nfunction flag(\n o: ConfigOptionMeta<'boolean', false> = {},\n): ConfigOptionBase<'boolean', false> {\n const {\n hint,\n default: def,\n validate: val,\n ...rest\n } = o as ConfigOptionMeta<'boolean', false>\n delete (rest as ConfigOptionMeta<'string', false>).validOptions\n if (def !== undefined && !isValidValue(def, 'boolean', false)) {\n throw new TypeError('invalid default value')\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'boolean', false>)\n : undefined\n if (hint !== undefined) {\n throw new TypeError('cannot provide hint for flag')\n }\n return {\n ...rest,\n default: def,\n validate,\n type: 'boolean',\n multiple: false,\n }\n}\n\nfunction flagList(\n o: ConfigOptionMeta<'boolean'> = {},\n): ConfigOptionBase<'boolean', true> {\n const {\n hint,\n default: def,\n validate: val,\n ...rest\n } = o as ConfigOptionMeta<'boolean', false>\n delete (rest as ConfigOptionMeta<'string', false>).validOptions\n if (def !== undefined && !isValidValue(def, 'boolean', true)) {\n throw new TypeError('invalid default value')\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'boolean', true>)\n : undefined\n if (hint !== undefined) {\n throw new TypeError('cannot provide hint for flag list')\n }\n return {\n ...rest,\n default: def,\n validate,\n type: 'boolean',\n multiple: true,\n }\n}\nconst toParseArgsOptionsConfig = (\n options: ConfigSet,\n): Exclude => {\n const c: Exclude = {}\n for (const longOption in options) {\n const config = options[longOption]\n /* c8 ignore start */\n if (!config) {\n throw new Error('config must be an object: ' + longOption)\n }\n /* c8 ignore start */\n if (isConfigOption(config, 'number', true)) {\n c[longOption] = {\n type: 'string',\n multiple: true,\n default: config.default?.map(c => String(c)),\n }\n } else if (isConfigOption(config, 'number', false)) {\n c[longOption] = {\n type: 'string',\n multiple: false,\n default:\n config.default === undefined ?\n undefined\n : String(config.default),\n }\n } else {\n const conf = config as\n | ConfigOptionBase<'string'>\n | ConfigOptionBase<'boolean'>\n c[longOption] = {\n type: conf.type,\n multiple: !!conf.multiple,\n default: conf.default,\n }\n }\n const clo = c[longOption] as ConfigOptionBase\n if (typeof config.short === 'string') {\n clo.short = config.short\n }\n\n if (\n config.type === 'boolean' &&\n !longOption.startsWith('no-') &&\n !options[`no-${longOption}`]\n ) {\n c[`no-${longOption}`] = {\n type: 'boolean',\n multiple: config.multiple,\n }\n }\n }\n return c\n}\n\n/**\n * A row used when generating the {@link Jack#usage} string\n */\nexport interface Row {\n left?: string\n text: string\n skipLine?: boolean\n type?: string\n}\n\n/**\n * A heading for a section in the usage, created by the jack.heading()\n * method.\n *\n * First heading is always level 1, subsequent headings default to 2.\n *\n * The level of the nearest heading level sets the indentation of the\n * description that follows.\n */\nexport interface Heading extends Row {\n type: 'heading'\n text: string\n left?: ''\n skipLine?: boolean\n level: number\n pre?: boolean\n}\nconst isHeading = (r: { type?: string }): r is Heading =>\n r.type === 'heading'\n\n/**\n * An arbitrary blob of text describing some stuff, set by the\n * jack.description() method.\n *\n * Indentation determined by level of the nearest header.\n */\nexport interface Description extends Row {\n type: 'description'\n text: string\n left?: ''\n skipLine?: boolean\n pre?: boolean\n}\n\nconst isDescription = (r: { type?: string }): r is Description =>\n r.type === 'description'\n\n/**\n * A heading or description row used when generating the {@link Jack#usage}\n * string\n */\nexport type TextRow = Heading | Description\n\n/**\n * Either a {@link TextRow} or a reference to a {@link ConfigOptionBase}\n */\nexport type UsageField =\n | TextRow\n | {\n type: 'config'\n name: string\n value: ConfigOptionBase\n }\n\n/**\n * Options provided to the {@link Jack} constructor\n */\nexport interface JackOptions {\n /**\n * Whether to allow positional arguments\n *\n * @default true\n */\n allowPositionals?: boolean\n\n /**\n * Prefix to use when reading/writing the environment variables\n *\n * If not specified, environment behavior will not be available.\n */\n envPrefix?: string\n\n /**\n * Environment object to read/write. Defaults `process.env`.\n * No effect if `envPrefix` is not set.\n */\n env?: { [k: string]: string | undefined }\n\n /**\n * A short usage string. If not provided, will be generated from the\n * options provided, but that can of course be rather verbose if\n * there are a lot of options.\n */\n usage?: string\n\n /**\n * Stop parsing flags and opts at the first positional argument.\n * This is to support cases like `cmd [flags] [options]`, where\n * each subcommand may have different options. This effectively treats\n * any positional as a `--` argument. Only relevant if `allowPositionals`\n * is true.\n *\n * To do subcommands, set this option, look at the first positional, and\n * parse the remaining positionals as appropriate.\n *\n * @default false\n */\n stopAtPositional?: boolean\n\n /**\n * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function,\n * will be called with each positional argument encountered. If the function\n * returns true, then parsing will stop at that point.\n */\n stopAtPositionalTest?: (arg: string) => boolean\n}\n\n/**\n * Class returned by the {@link jack} function and all configuration\n * definition methods. This is what gets chained together.\n */\nexport class Jack {\n #configSet: C\n #shorts: { [k: string]: string }\n #options: JackOptions\n #fields: UsageField[] = []\n #env: { [k: string]: string | undefined }\n #envPrefix?: string\n #allowPositionals: boolean\n #usage?: string\n #usageMarkdown?: string\n\n constructor(options: JackOptions = {}) {\n this.#options = options\n this.#allowPositionals = options.allowPositionals !== false\n this.#env =\n this.#options.env === undefined ? process.env : this.#options.env\n this.#envPrefix = options.envPrefix\n // We need to fib a little, because it's always the same object, but it\n // starts out as having an empty config set. Then each method that adds\n // fields returns `this as Jack`\n this.#configSet = Object.create(null) as C\n this.#shorts = Object.create(null)\n }\n\n /**\n * Set the default value (which will still be overridden by env or cli)\n * as if from a parsed config file. The optional `source` param, if\n * provided, will be included in error messages if a value is invalid or\n * unknown.\n */\n setConfigValues(values: OptionsResults, source = '') {\n try {\n this.validate(values)\n } catch (er) {\n const e = er as Error\n if (source && e && typeof e === 'object') {\n if (e.cause && typeof e.cause === 'object') {\n Object.assign(e.cause, { path: source })\n } else {\n e.cause = { path: source }\n }\n }\n throw e\n }\n for (const [field, value] of Object.entries(values)) {\n const my = this.#configSet[field]\n // already validated, just for TS's benefit\n /* c8 ignore start */\n if (!my) {\n throw new Error('unexpected field in config set: ' + field, {\n cause: { found: field },\n })\n }\n /* c8 ignore stop */\n my.default = value\n }\n return this\n }\n\n /**\n * Parse a string of arguments, and return the resulting\n * `{ values, positionals }` object.\n *\n * If an {@link JackOptions#envPrefix} is set, then it will read default\n * values from the environment, and write the resulting values back\n * to the environment as well.\n *\n * Environment values always take precedence over any other value, except\n * an explicit CLI setting.\n */\n parse(args: string[] = process.argv): Parsed {\n this.loadEnvDefaults()\n const p = this.parseRaw(args)\n this.applyDefaults(p)\n this.writeEnv(p)\n return p\n }\n\n loadEnvDefaults() {\n if (this.#envPrefix) {\n for (const [field, my] of Object.entries(this.#configSet)) {\n const ek = toEnvKey(this.#envPrefix, field)\n const env = this.#env[ek]\n if (env !== undefined) {\n my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim)\n }\n }\n }\n }\n\n applyDefaults(p: Parsed) {\n for (const [field, c] of Object.entries(this.#configSet)) {\n if (c.default !== undefined && !(field in p.values)) {\n //@ts-ignore\n p.values[field] = c.default\n }\n }\n }\n\n /**\n * Only parse the command line arguments passed in.\n * Does not strip off the `node script.js` bits, so it must be just the\n * arguments you wish to have parsed.\n * Does not read from or write to the environment, or set defaults.\n */\n parseRaw(args: string[]): Parsed {\n if (args === process.argv) {\n args = args.slice(\n (process as { _eval?: string })._eval !== undefined ? 1 : 2,\n )\n }\n\n const options = toParseArgsOptionsConfig(this.#configSet)\n const result = parseArgs({\n args,\n options,\n // always strict, but using our own logic\n strict: false,\n allowPositionals: this.#allowPositionals,\n tokens: true,\n })\n\n const p: Parsed = {\n values: {},\n positionals: [],\n }\n for (const token of result.tokens) {\n if (token.kind === 'positional') {\n p.positionals.push(token.value)\n if (\n this.#options.stopAtPositional ||\n this.#options.stopAtPositionalTest?.(token.value)\n ) {\n p.positionals.push(...args.slice(token.index + 1))\n break\n }\n } else if (token.kind === 'option') {\n let value: string | number | boolean | undefined = undefined\n if (token.name.startsWith('no-')) {\n const my = this.#configSet[token.name]\n const pname = token.name.substring('no-'.length)\n const pos = this.#configSet[pname]\n if (\n pos &&\n pos.type === 'boolean' &&\n (!my ||\n (my.type === 'boolean' && !!my.multiple === !!pos.multiple))\n ) {\n value = false\n token.name = pname\n }\n }\n const my = this.#configSet[token.name]\n if (!my) {\n throw new Error(\n `Unknown option '${token.rawName}'. ` +\n `To specify a positional argument starting with a '-', ` +\n `place it at the end of the command after '--', as in ` +\n `'-- ${token.rawName}'`,\n {\n cause: {\n found:\n token.rawName + (token.value ? `=${token.value}` : ''),\n },\n },\n )\n }\n if (value === undefined) {\n if (token.value === undefined) {\n if (my.type !== 'boolean') {\n throw new Error(\n `No value provided for ${token.rawName}, expected ${my.type}`,\n {\n cause: {\n name: token.rawName,\n wanted: valueType(my),\n },\n },\n )\n }\n value = true\n } else {\n if (my.type === 'boolean') {\n throw new Error(\n `Flag ${token.rawName} does not take a value, received '${token.value}'`,\n { cause: { found: token } },\n )\n }\n if (my.type === 'string') {\n value = token.value\n } else {\n value = +token.value\n if (value !== value) {\n throw new Error(\n `Invalid value '${token.value}' provided for ` +\n `'${token.rawName}' option, expected number`,\n {\n cause: {\n name: token.rawName,\n found: token.value,\n wanted: 'number',\n },\n },\n )\n }\n }\n }\n }\n if (my.multiple) {\n const pv = p.values as {\n [k: string]: (string | number | boolean)[]\n }\n const tn = pv[token.name] ?? []\n pv[token.name] = tn\n tn.push(value)\n } else {\n const pv = p.values as { [k: string]: string | number | boolean }\n pv[token.name] = value\n }\n }\n }\n\n for (const [field, value] of Object.entries(p.values)) {\n const valid = this.#configSet[field]?.validate\n const validOptions = this.#configSet[field]?.validOptions\n let cause:\n | undefined\n | {\n name: string\n found: unknown\n validOptions?: readonly string[] | readonly number[]\n }\n if (validOptions && !isValidOption(value, validOptions)) {\n cause = { name: field, found: value, validOptions: validOptions }\n }\n if (valid && !valid(value)) {\n cause ??= { name: field, found: value }\n }\n if (cause) {\n throw new Error(\n `Invalid value provided for --${field}: ${JSON.stringify(\n value,\n )}`,\n { cause },\n )\n }\n }\n\n return p\n }\n\n /**\n * do not set fields as 'no-foo' if 'foo' exists and both are bools\n * just set foo.\n */\n #noNoFields(f: string, val: unknown, s: string = f) {\n if (!f.startsWith('no-') || typeof val !== 'boolean') return\n const yes = f.substring('no-'.length)\n // recurse so we get the core config key we care about.\n this.#noNoFields(yes, val, s)\n if (this.#configSet[yes]?.type === 'boolean') {\n throw new Error(\n `do not set '${s}', instead set '${yes}' as desired.`,\n { cause: { found: s, wanted: yes } },\n )\n }\n }\n\n /**\n * Validate that any arbitrary object is a valid configuration `values`\n * object. Useful when loading config files or other sources.\n */\n validate(o: unknown): asserts o is Parsed['values'] {\n if (!o || typeof o !== 'object') {\n throw new Error('Invalid config: not an object', {\n cause: { found: o },\n })\n }\n const opts = o as Record\n for (const field in o) {\n const value = opts[field]\n /* c8 ignore next - for TS */\n if (value === undefined) continue\n this.#noNoFields(field, value)\n const config = this.#configSet[field]\n if (!config) {\n throw new Error(`Unknown config option: ${field}`, {\n cause: { found: field },\n })\n }\n if (!isValidValue(value, config.type, !!config.multiple)) {\n throw new Error(\n `Invalid value ${valueType(\n value,\n )} for ${field}, expected ${valueType(config)}`,\n {\n cause: {\n name: field,\n found: value,\n wanted: valueType(config),\n },\n },\n )\n }\n let cause:\n | undefined\n | {\n name: string\n found: any\n validOptions?: readonly string[] | readonly number[]\n }\n if (\n config.validOptions &&\n !isValidOption(value, config.validOptions)\n ) {\n cause = {\n name: field,\n found: value,\n validOptions: config.validOptions,\n }\n }\n if (config.validate && !config.validate(value)) {\n cause ??= { name: field, found: value }\n }\n if (cause) {\n throw new Error(`Invalid config value for ${field}: ${value}`, {\n cause,\n })\n }\n }\n }\n\n writeEnv(p: Parsed) {\n if (!this.#env || !this.#envPrefix) return\n for (const [field, value] of Object.entries(p.values)) {\n const my = this.#configSet[field]\n this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(\n value,\n my?.delim,\n )\n }\n }\n\n /**\n * Add a heading to the usage output banner\n */\n heading(\n text: string,\n level?: 1 | 2 | 3 | 4 | 5 | 6,\n { pre = false }: { pre?: boolean } = {},\n ): Jack {\n if (level === undefined) {\n level = this.#fields.some(r => isHeading(r)) ? 2 : 1\n }\n this.#fields.push({ type: 'heading', text, level, pre })\n return this\n }\n\n /**\n * Add a long-form description to the usage output at this position.\n */\n description(text: string, { pre }: { pre?: boolean } = {}): Jack {\n this.#fields.push({ type: 'description', text, pre })\n return this\n }\n\n /**\n * Add one or more number fields.\n */\n num>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, num)\n }\n\n /**\n * Add one or more multiple number fields.\n */\n numList>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, numList)\n }\n\n /**\n * Add one or more string option fields.\n */\n opt>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, opt)\n }\n\n /**\n * Add one or more multiple string option fields.\n */\n optList>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, optList)\n }\n\n /**\n * Add one or more flag fields.\n */\n flag>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, flag)\n }\n\n /**\n * Add one or more multiple flag fields.\n */\n flagList>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, flagList)\n }\n\n /**\n * Generic field definition method. Similar to flag/flagList/number/etc,\n * but you must specify the `type` (and optionally `multiple` and `delim`)\n * fields on each one, or Jack won't know how to define them.\n */\n addFields(fields: F): Jack {\n const next = this as unknown as Jack\n for (const [name, field] of Object.entries(fields)) {\n this.#validateName(name, field)\n next.#fields.push({\n type: 'config',\n name,\n value: field as ConfigOptionBase,\n })\n }\n Object.assign(next.#configSet, fields)\n return next\n }\n\n #addFields<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n >(\n fields: F,\n fn: (m: ConfigOptionMeta) => ConfigOptionBase,\n ): Jack> {\n type NextC = C & ConfigSetFromMetaSet\n const next = this as unknown as Jack\n Object.assign(\n next.#configSet,\n Object.fromEntries(\n Object.entries(fields).map(([name, field]) => {\n this.#validateName(name, field)\n const option = fn(field)\n next.#fields.push({\n type: 'config',\n name,\n value: option as ConfigOptionBase,\n })\n return [name, option]\n }),\n ),\n )\n return next\n }\n\n #validateName(name: string, field: { short?: string }) {\n if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {\n throw new TypeError(\n `Invalid option name: ${name}, ` +\n `must be '-' delimited ASCII alphanumeric`,\n )\n }\n if (this.#configSet[name]) {\n throw new TypeError(`Cannot redefine option ${field}`)\n }\n if (this.#shorts[name]) {\n throw new TypeError(\n `Cannot redefine option ${name}, already ` +\n `in use for ${this.#shorts[name]}`,\n )\n }\n if (field.short) {\n if (!/^[a-zA-Z0-9]$/.test(field.short)) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n 'must be 1 ASCII alphanumeric character',\n )\n }\n if (this.#shorts[field.short]) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n `already in use for ${this.#shorts[field.short]}`,\n )\n }\n this.#shorts[field.short] = name\n this.#shorts[name] = name\n }\n }\n\n /**\n * Return the usage banner for the given configuration\n */\n usage(): string {\n if (this.#usage) return this.#usage\n\n let headingLevel = 1\n const ui = cliui({ width })\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n ui.div({\n padding: [0, 0, 0, 0],\n text: normalize(first.text),\n })\n }\n ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' })\n if (this.#options.usage) {\n ui.div({\n text: this.#options.usage,\n padding: [0, 0, 0, 2],\n })\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n ui.div({\n text: usage,\n padding: [0, 0, 0, 2],\n })\n }\n\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n const print = normalize(maybeDesc.text, maybeDesc.pre)\n start++\n ui.div({ padding: [0, 0, 0, 0], text: print })\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n\n const { rows, maxWidth } = this.#usageRows(start)\n\n // every heading/description after the first gets indented by 2\n // extra spaces.\n for (const row of rows) {\n if (row.left) {\n // If the row is too long, don't wrap it\n // Bump the right-hand side down a line to make room\n const configIndent = indent(Math.max(headingLevel, 2))\n if (row.left.length > maxWidth - 3) {\n ui.div({ text: row.left, padding: [0, 0, 0, configIndent] })\n ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] })\n } else {\n ui.div(\n {\n text: row.left,\n padding: [0, 1, 0, configIndent],\n width: maxWidth,\n },\n { padding: [0, 0, 0, 0], text: row.text },\n )\n }\n if (row.skipLine) {\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n } else {\n if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n // only h1 and h2 have bottom padding\n // h3-h6 do not\n const b = level <= 2 ? 1 : 0\n ui.div({ ...row, padding: [0, 0, b, indent(level)] })\n } else {\n ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] })\n }\n }\n }\n\n return (this.#usage = ui.toString())\n }\n\n /**\n * Return the usage banner markdown for the given configuration\n */\n usageMarkdown(): string {\n if (this.#usageMarkdown) return this.#usageMarkdown\n\n const out: string[] = []\n\n let headingLevel = 1\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n out.push(`# ${normalizeOneLine(first.text)}`)\n }\n out.push('Usage:')\n if (this.#options.usage) {\n out.push(normalizeMarkdown(this.#options.usage, true))\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n out.push(normalizeMarkdown(usage, true))\n }\n\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre))\n start++\n }\n\n const { rows } = this.#usageRows(start)\n\n // heading level in markdown is number of # ahead of text\n for (const row of rows) {\n if (row.left) {\n out.push(\n '#'.repeat(headingLevel + 1) +\n ' ' +\n normalizeOneLine(row.left, true),\n )\n if (row.text) out.push(normalizeMarkdown(row.text))\n } else if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n out.push(\n `${'#'.repeat(headingLevel)} ${normalizeOneLine(\n row.text,\n row.pre,\n )}`,\n )\n } else {\n out.push(normalizeMarkdown(row.text, !!(row as Description).pre))\n }\n }\n\n return (this.#usageMarkdown = out.join('\\n\\n') + '\\n')\n }\n\n #usageRows(start: number) {\n // turn each config type into a row, and figure out the width of the\n // left hand indentation for the option descriptions.\n let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)))\n let maxWidth = 8\n let prev: Row | TextRow | undefined = undefined\n const rows: (Row | TextRow)[] = []\n for (const field of this.#fields.slice(start)) {\n if (field.type !== 'config') {\n if (prev?.type === 'config') prev.skipLine = true\n prev = undefined\n field.text = normalize(field.text, !!field.pre)\n rows.push(field)\n continue\n }\n const { value } = field\n const desc = value.description || ''\n const mult = value.multiple ? 'Can be set multiple times' : ''\n const opts =\n value.validOptions?.length ?\n `Valid options:${value.validOptions.map(\n v => ` ${JSON.stringify(v)}`,\n )}`\n : ''\n const dmDelim = desc.includes('\\n') ? '\\n\\n' : '\\n'\n const extra = [opts, mult].join(dmDelim).trim()\n const text = (normalize(desc) + dmDelim + extra).trim()\n const hint =\n value.hint ||\n (value.type === 'number' ? 'n'\n : value.type === 'string' ? field.name\n : undefined)\n const short =\n !value.short ? ''\n : value.type === 'boolean' ? `-${value.short} `\n : `-${value.short}<${hint}> `\n const left =\n value.type === 'boolean' ?\n `${short}--${field.name}`\n : `${short}--${field.name}=<${hint}>`\n const row: Row = { text, left, type: 'config' }\n if (text.length > width - maxMax) {\n row.skipLine = true\n }\n if (prev && left.length > maxMax) prev.skipLine = true\n prev = row\n const len = left.length + 4\n if (len > maxWidth && len < maxMax) {\n maxWidth = len\n }\n\n rows.push(row)\n }\n\n return { rows, maxWidth }\n }\n\n /**\n * Return the configuration options as a plain object\n */\n toJSON() {\n return Object.fromEntries(\n Object.entries(this.#configSet).map(([field, def]) => [\n field,\n {\n type: def.type,\n ...(def.multiple ? { multiple: true } : {}),\n ...(def.delim ? { delim: def.delim } : {}),\n ...(def.short ? { short: def.short } : {}),\n ...(def.description ?\n { description: normalize(def.description) }\n : {}),\n ...(def.validate ? { validate: def.validate } : {}),\n ...(def.validOptions ? { validOptions: def.validOptions } : {}),\n ...(def.default !== undefined ? { default: def.default } : {}),\n ...(def.hint ? { hint: def.hint } : {}),\n },\n ]),\n )\n }\n\n /**\n * Custom printer for `util.inspect`\n */\n [inspect.custom](_: number, options: InspectOptions) {\n return `Jack ${inspect(this.toJSON(), options)}`\n }\n}\n\n// Unwrap and un-indent, so we can wrap description\n// strings however makes them look nice in the code.\nconst normalize = (s: string, pre = false) => {\n if (pre)\n // prepend a ZWSP to each line so cliui doesn't strip it.\n return s\n .split('\\n')\n .map(l => `\\u200b${l}`)\n .join('\\n')\n return s\n .split(/^\\s*```\\s*$/gm)\n .map((s, i) => {\n if (i % 2 === 1) {\n if (!s.trim()) {\n return `\\`\\`\\`\\n\\`\\`\\`\\n`\n }\n // outdent the ``` blocks, but preserve whitespace otherwise.\n const split = s.split('\\n')\n // throw out the \\n at the start and end\n split.pop()\n split.shift()\n const si = split.reduce((shortest, l) => {\n /* c8 ignore next */\n const ind = l.match(/^\\s*/)?.[0] ?? ''\n if (ind.length) return Math.min(ind.length, shortest)\n else return shortest\n }, Infinity)\n /* c8 ignore next */\n const i = isFinite(si) ? si : 0\n return (\n '\\n```\\n' +\n split.map(s => `\\u200b${s.substring(i)}`).join('\\n') +\n '\\n```\\n'\n )\n }\n return (\n s\n // remove single line breaks, except for lists\n .replace(/([^\\n])\\n[ \\t]*([^\\n])/g, (_, $1, $2) =>\n !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\\n${$2}`,\n )\n // normalize mid-line whitespace\n .replace(/([^\\n])[ \\t]+([^\\n])/g, '$1 $2')\n // two line breaks are enough\n .replace(/\\n{3,}/g, '\\n\\n')\n // remove any spaces at the start of a line\n .replace(/\\n[ \\t]+/g, '\\n')\n .trim()\n )\n })\n .join('\\n')\n}\n\n// normalize for markdown printing, remove leading spaces on lines\nconst normalizeMarkdown = (s: string, pre: boolean = false): string => {\n const n = normalize(s, pre).replace(/\\\\/g, '\\\\\\\\')\n return pre ?\n `\\`\\`\\`\\n${n.replace(/\\u200b/g, '')}\\n\\`\\`\\``\n : n.replace(/\\n +/g, '\\n').trim()\n}\n\nconst normalizeOneLine = (s: string, pre: boolean = false) => {\n const n = normalize(s, pre)\n .replace(/[\\s\\u200b]+/g, ' ')\n .trim()\n return pre ? `\\`${n}\\`` : n\n}\n\n/**\n * Main entry point. Create and return a {@link Jack} object.\n */\nexport const jack = (options: JackOptions = {}) => new Jack(options)\n"]} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/commonjs/package.json b/node_modules/jackspeak/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/jackspeak/dist/commonjs/parse-args-cjs.cjs.map b/node_modules/jackspeak/dist/commonjs/parse-args-cjs.cjs.map new file mode 100644 index 0000000..0a4a369 --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/parse-args-cjs.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-args-cjs.cjs","sourceRoot":"","sources":["../../src/parse-args-cjs.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAE5B,MAAM,EAAE,GACN,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,CACpC,CAAC,CAAC;IACD,OAAO,CAAC,OAAO;IACjB,CAAC,CAAC,QAAQ,CAAA;AACZ,MAAM,GAAG,GAAG,EAAE;KACX,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;KACjB,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAE5B,qBAAqB;AACrB,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAA;AAClC,oBAAoB;AAEpB,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,IAAI,CAAA;AAC5B,qBAAqB;AACrB,IACE,CAAC,EAAE;IACH,KAAK,GAAG,EAAE;IACV,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC;IAC5B,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC,EAC5B,CAAC;IACD,oBAAoB;IACpB,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAA;AAC5C,CAAC;AAEY,QAAA,SAAS,GAAG,EAAE,CAAA","sourcesContent":["import * as util from 'util'\n\nconst pv =\n (\n typeof process === 'object' &&\n !!process &&\n typeof process.version === 'string'\n ) ?\n process.version\n : 'v0.0.0'\nconst pvs = pv\n .replace(/^v/, '')\n .split('.')\n .map(s => parseInt(s, 10))\n\n/* c8 ignore start */\nconst [major = 0, minor = 0] = pvs\n/* c8 ignore stop */\n\nlet { parseArgs: pa } = util\n/* c8 ignore start */\nif (\n !pa ||\n major < 16 ||\n (major === 18 && minor < 11) ||\n (major === 16 && minor < 19)\n) {\n /* c8 ignore stop */\n pa = require('@pkgjs/parseargs').parseArgs\n}\n\nexport const parseArgs = pa\n"]} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/commonjs/parse-args-cjs.d.cts.map b/node_modules/jackspeak/dist/commonjs/parse-args-cjs.d.cts.map new file mode 100644 index 0000000..066287c --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/parse-args-cjs.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-args-cjs.d.cts","sourceRoot":"","sources":["../../src/parse-args-cjs.cts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AA+B5B,eAAO,MAAM,SAAS,uBAAK,CAAA"} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/commonjs/parse-args.d.ts b/node_modules/jackspeak/dist/commonjs/parse-args.d.ts new file mode 100644 index 0000000..07f995c --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/parse-args.d.ts @@ -0,0 +1,4 @@ +/// +import * as util from 'util'; +export declare const parseArgs: typeof util.parseArgs; +//# sourceMappingURL=parse-args-cjs.d.cts.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/commonjs/parse-args.js b/node_modules/jackspeak/dist/commonjs/parse-args.js new file mode 100644 index 0000000..fc918a4 --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/parse-args.js @@ -0,0 +1,50 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseArgs = void 0; +const util = __importStar(require("util")); +const pv = (typeof process === 'object' && + !!process && + typeof process.version === 'string') ? + process.version + : 'v0.0.0'; +const pvs = pv + .replace(/^v/, '') + .split('.') + .map(s => parseInt(s, 10)); +/* c8 ignore start */ +const [major = 0, minor = 0] = pvs; +/* c8 ignore stop */ +let { parseArgs: pa } = util; +/* c8 ignore start */ +if (!pa || + major < 16 || + (major === 18 && minor < 11) || + (major === 16 && minor < 19)) { + /* c8 ignore stop */ + pa = require('@pkgjs/parseargs').parseArgs; +} +exports.parseArgs = pa; +//# sourceMappingURL=parse-args-cjs.cjs.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/index.d.ts b/node_modules/jackspeak/dist/esm/index.d.ts new file mode 100644 index 0000000..214a177 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/index.d.ts @@ -0,0 +1,315 @@ +/// +export type ConfigType = 'number' | 'string' | 'boolean'; +/** + * Given a Jack object, get the typeof its ConfigSet + */ +export type Unwrap = J extends Jack ? C : never; +import { inspect, InspectOptions } from 'node:util'; +/** + * Defines the type of value that is valid, given a config definition's + * {@link ConfigType} and boolean multiple setting + */ +export type ValidValue = [ + T, + M +] extends ['number', true] ? number[] : [T, M] extends ['string', true] ? string[] : [T, M] extends ['boolean', true] ? boolean[] : [T, M] extends ['number', false] ? number : [T, M] extends ['string', false] ? string : [T, M] extends ['boolean', false] ? boolean : [T, M] extends ['string', boolean] ? string | string[] : [T, M] extends ['boolean', boolean] ? boolean | boolean[] : [T, M] extends ['number', boolean] ? number | number[] : [T, M] extends [ConfigType, false] ? string | number | boolean : [T, M] extends [ConfigType, true] ? string[] | number[] | boolean[] : string | number | boolean | string[] | number[] | boolean[]; +/** + * The meta information for a config option definition, when the + * type and multiple values can be inferred by the method being used + */ +export type ConfigOptionMeta = { + default?: undefined | (ValidValue & (O extends number[] | string[] ? M extends false ? O[number] : O[number][] : unknown)); + validOptions?: O; + description?: string; + validate?: ((v: unknown) => v is ValidValue) | ((v: unknown) => boolean); + short?: string | undefined; + type?: T; + hint?: T extends 'boolean' ? never : string; + delim?: M extends true ? string : never; +} & (M extends false ? { + multiple?: false | undefined; +} : M extends true ? { + multiple: true; +} : { + multiple?: boolean; +}); +/** + * A set of {@link ConfigOptionMeta} fields, referenced by their longOption + * string values. + */ +export type ConfigMetaSet = { + [longOption: string]: ConfigOptionMeta; +}; +/** + * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet} + */ +export type ConfigSetFromMetaSet> = { + [longOption in keyof S]: ConfigOptionBase; +}; +/** + * Fields that can be set on a {@link ConfigOptionBase} or + * {@link ConfigOptionMeta} based on whether or not the field is known to be + * multiple. + */ +export type MultiType = M extends true ? { + multiple: true; + delim?: string | undefined; +} : M extends false ? { + multiple?: false | undefined; + delim?: undefined; +} : { + multiple?: boolean | undefined; + delim?: string | undefined; +}; +/** + * A config field definition, in its full representation. + */ +export type ConfigOptionBase = { + type: T; + short?: string | undefined; + default?: ValidValue | undefined; + description?: string; + hint?: T extends 'boolean' ? undefined : string | undefined; + validate?: (v: unknown) => v is ValidValue; + validOptions?: T extends 'boolean' ? undefined : T extends 'string' ? readonly string[] : T extends 'number' ? readonly number[] : readonly number[] | readonly string[]; +} & MultiType; +export declare const isConfigType: (t: string) => t is ConfigType; +export declare const isConfigOption: (o: any, type: T, multi: M) => o is ConfigOptionBase; +/** + * A set of {@link ConfigOptionBase} objects, referenced by their longOption + * string values. + */ +export type ConfigSet = { + [longOption: string]: ConfigOptionBase; +}; +/** + * The 'values' field returned by {@link Jack#parse} + */ +export type OptionsResults = { + [k in keyof T]?: T[k]['validOptions'] extends (readonly string[] | readonly number[]) ? T[k] extends ConfigOptionBase<'string' | 'number', false> ? T[k]['validOptions'][number] : T[k] extends ConfigOptionBase<'string' | 'number', true> ? T[k]['validOptions'][number][] : never : T[k] extends ConfigOptionBase<'string', false> ? string : T[k] extends ConfigOptionBase<'string', true> ? string[] : T[k] extends ConfigOptionBase<'number', false> ? number : T[k] extends ConfigOptionBase<'number', true> ? number[] : T[k] extends ConfigOptionBase<'boolean', false> ? boolean : T[k] extends ConfigOptionBase<'boolean', true> ? boolean[] : never; +}; +/** + * The object retured by {@link Jack#parse} + */ +export type Parsed = { + values: OptionsResults; + positionals: string[]; +}; +/** + * A row used when generating the {@link Jack#usage} string + */ +export interface Row { + left?: string; + text: string; + skipLine?: boolean; + type?: string; +} +/** + * A heading for a section in the usage, created by the jack.heading() + * method. + * + * First heading is always level 1, subsequent headings default to 2. + * + * The level of the nearest heading level sets the indentation of the + * description that follows. + */ +export interface Heading extends Row { + type: 'heading'; + text: string; + left?: ''; + skipLine?: boolean; + level: number; + pre?: boolean; +} +/** + * An arbitrary blob of text describing some stuff, set by the + * jack.description() method. + * + * Indentation determined by level of the nearest header. + */ +export interface Description extends Row { + type: 'description'; + text: string; + left?: ''; + skipLine?: boolean; + pre?: boolean; +} +/** + * A heading or description row used when generating the {@link Jack#usage} + * string + */ +export type TextRow = Heading | Description; +/** + * Either a {@link TextRow} or a reference to a {@link ConfigOptionBase} + */ +export type UsageField = TextRow | { + type: 'config'; + name: string; + value: ConfigOptionBase; +}; +/** + * Options provided to the {@link Jack} constructor + */ +export interface JackOptions { + /** + * Whether to allow positional arguments + * + * @default true + */ + allowPositionals?: boolean; + /** + * Prefix to use when reading/writing the environment variables + * + * If not specified, environment behavior will not be available. + */ + envPrefix?: string; + /** + * Environment object to read/write. Defaults `process.env`. + * No effect if `envPrefix` is not set. + */ + env?: { + [k: string]: string | undefined; + }; + /** + * A short usage string. If not provided, will be generated from the + * options provided, but that can of course be rather verbose if + * there are a lot of options. + */ + usage?: string; + /** + * Stop parsing flags and opts at the first positional argument. + * This is to support cases like `cmd [flags] [options]`, where + * each subcommand may have different options. This effectively treats + * any positional as a `--` argument. Only relevant if `allowPositionals` + * is true. + * + * To do subcommands, set this option, look at the first positional, and + * parse the remaining positionals as appropriate. + * + * @default false + */ + stopAtPositional?: boolean; + /** + * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function, + * will be called with each positional argument encountered. If the function + * returns true, then parsing will stop at that point. + */ + stopAtPositionalTest?: (arg: string) => boolean; +} +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +export declare class Jack { + #private; + constructor(options?: JackOptions); + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values: OptionsResults, source?: string): this; + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args?: string[]): Parsed; + loadEnvDefaults(): void; + applyDefaults(p: Parsed): void; + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args: string[]): Parsed; + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o: unknown): asserts o is Parsed['values']; + writeEnv(p: Parsed): void; + /** + * Add a heading to the usage output banner + */ + heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add a long-form description to the usage output at this position. + */ + description(text: string, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add one or more number fields. + */ + num>(fields: F): Jack>; + /** + * Add one or more multiple number fields. + */ + numList>(fields: F): Jack>; + /** + * Add one or more string option fields. + */ + opt>(fields: F): Jack>; + /** + * Add one or more multiple string option fields. + */ + optList>(fields: F): Jack>; + /** + * Add one or more flag fields. + */ + flag>(fields: F): Jack>; + /** + * Add one or more multiple flag fields. + */ + flagList>(fields: F): Jack>; + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields: F): Jack; + /** + * Return the usage banner for the given configuration + */ + usage(): string; + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown(): string; + /** + * Return the configuration options as a plain object + */ + toJSON(): { + [k: string]: { + hint?: string | undefined; + default?: string | number | boolean | string[] | number[] | boolean[] | undefined; + validOptions?: readonly number[] | readonly string[] | undefined; + validate?: ((v: unknown) => v is string | number | boolean | string[] | number[] | boolean[]) | undefined; + description?: string | undefined; + short?: string | undefined; + delim?: string | undefined; + multiple?: boolean | undefined; + type: ConfigType; + }; + }; + /** + * Custom printer for `util.inspect` + */ + [inspect.custom](_: number, options: InspectOptions): string; +} +/** + * Main entry point. Create and return a {@link Jack} object. + */ +export declare const jack: (options?: JackOptions) => Jack<{}>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/index.d.ts.map b/node_modules/jackspeak/dist/esm/index.d.ts.map new file mode 100644 index 0000000..faf9ddd --- /dev/null +++ b/node_modules/jackspeak/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAmB,MAAM,WAAW,CAAA;AA2DpE;;;GAGG;AACH,MAAM,MAAM,UAAU,CACpB,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,OAAO,GAAG,OAAO,IAE3B;IAAC,CAAC;IAAE,CAAC;CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,GACxC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,GAC1C,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,OAAO,EAAE,GAC5C,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,MAAM,GACzC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,MAAM,GACzC,CAAC,CAAC,EAAE,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,QAAQ,CAAC,CAAC,SAAS,aAAa,CAAC,SAAS,CAAC,EACzC,MAAM,EAAE,CAAC,GACR,IAAI,CAAC,CAAC,GAAG,oBAAoB,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAIrD;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IA4EtD;;OAEG;IACH,KAAK,IAAI,MAAM;IAgGf;;OAEG;IACH,aAAa,IAAI,MAAM;IAgIvB;;OAEG;IACH,MAAM;;;;;;;;;;;;;IAqBN;;OAEG;IACH,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;CAGpD;AAsED;;GAEG;AACH,eAAO,MAAM,IAAI,aAAa,WAAW,aAA2B,CAAA"} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/index.js b/node_modules/jackspeak/dist/esm/index.js new file mode 100644 index 0000000..8eef5b4 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/index.js @@ -0,0 +1,1000 @@ +import { inspect } from 'node:util'; +import { parseArgs } from './parse-args.js'; +// it's a tiny API, just cast it inline, it's fine +//@ts-ignore +import cliui from '@isaacs/cliui'; +import { basename } from 'node:path'; +const width = Math.min((process && process.stdout && process.stdout.columns) || 80, 80); +// indentation spaces from heading level +const indent = (n) => (n - 1) * 2; +const toEnvKey = (pref, key) => { + return [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')] + .join(' ') + .trim() + .toUpperCase() + .replace(/ /g, '_'); +}; +const toEnvVal = (value, delim = '\n') => { + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' + : '0' + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; + if (typeof str !== 'string') { + throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`); + } + /* c8 ignore stop */ + return str; +}; +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) + : [] + : type === 'string' ? env + : type === 'boolean' ? env === '1' + : +env.trim()); +export const isConfigType = (t) => typeof t === 'string' && + (t === 'string' || t === 'number' || t === 'boolean'); +const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +const isValidOption = (v, vo) => Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v); +// print the value type, for error message reporting +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' + : `${v.type}${v.multiple ? '[]' : ''}`; +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] + : `(${types.join('|')})`; +const isValidValue = (v, type, multi) => { + if (multi) { + if (!Array.isArray(v)) + return false; + return !v.some((v) => !isValidValue(v, type, false)); + } + if (Array.isArray(v)) + return false; + return typeof v === type; +}; +export const isConfigOption = (o, type, multi) => !!o && + typeof o === 'object' && + isConfigType(o.type) && + o.type === type && + undefOrType(o.short, 'string') && + undefOrType(o.description, 'string') && + undefOrType(o.hint, 'string') && + undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && + (o.default === undefined || isValidValue(o.default, type, multi)) && + !!o.multiple === multi; +function num(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'number', false)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'number', + multiple: false, + }; +} +function numList(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'number', true)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'number', + multiple: true, + }; +} +function opt(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'string', false)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'string', + multiple: false, + }; +} +function optList(o = {}) { + const { default: def, validate: val, validOptions, ...rest } = o; + if (def !== undefined && !isValidValue(def, 'string', true)) { + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val + : undefined; + return { + ...rest, + default: def, + validate, + validOptions, + type: 'string', + multiple: true, + }; +} +function flag(o = {}) { + const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; + if (def !== undefined && !isValidValue(def, 'boolean', false)) { + throw new TypeError('invalid default value'); + } + const validate = val ? + val + : undefined; + if (hint !== undefined) { + throw new TypeError('cannot provide hint for flag'); + } + return { + ...rest, + default: def, + validate, + type: 'boolean', + multiple: false, + }; +} +function flagList(o = {}) { + const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; + if (def !== undefined && !isValidValue(def, 'boolean', true)) { + throw new TypeError('invalid default value'); + } + const validate = val ? + val + : undefined; + if (hint !== undefined) { + throw new TypeError('cannot provide hint for flag list'); + } + return { + ...rest, + default: def, + validate, + type: 'boolean', + multiple: true, + }; +} +const toParseArgsOptionsConfig = (options) => { + const c = {}; + for (const longOption in options) { + const config = options[longOption]; + /* c8 ignore start */ + if (!config) { + throw new Error('config must be an object: ' + longOption); + } + /* c8 ignore start */ + if (isConfigOption(config, 'number', true)) { + c[longOption] = { + type: 'string', + multiple: true, + default: config.default?.map(c => String(c)), + }; + } + else if (isConfigOption(config, 'number', false)) { + c[longOption] = { + type: 'string', + multiple: false, + default: config.default === undefined ? + undefined + : String(config.default), + }; + } + else { + const conf = config; + c[longOption] = { + type: conf.type, + multiple: !!conf.multiple, + default: conf.default, + }; + } + const clo = c[longOption]; + if (typeof config.short === 'string') { + clo.short = config.short; + } + if (config.type === 'boolean' && + !longOption.startsWith('no-') && + !options[`no-${longOption}`]) { + c[`no-${longOption}`] = { + type: 'boolean', + multiple: config.multiple, + }; + } + } + return c; +}; +const isHeading = (r) => r.type === 'heading'; +const isDescription = (r) => r.type === 'description'; +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +export class Jack { + #configSet; + #shorts; + #options; + #fields = []; + #env; + #envPrefix; + #allowPositionals; + #usage; + #usageMarkdown; + constructor(options = {}) { + this.#options = options; + this.#allowPositionals = options.allowPositionals !== false; + this.#env = + this.#options.env === undefined ? process.env : this.#options.env; + this.#envPrefix = options.envPrefix; + // We need to fib a little, because it's always the same object, but it + // starts out as having an empty config set. Then each method that adds + // fields returns `this as Jack` + this.#configSet = Object.create(null); + this.#shorts = Object.create(null); + } + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values, source = '') { + try { + this.validate(values); + } + catch (er) { + const e = er; + if (source && e && typeof e === 'object') { + if (e.cause && typeof e.cause === 'object') { + Object.assign(e.cause, { path: source }); + } + else { + e.cause = { path: source }; + } + } + throw e; + } + for (const [field, value] of Object.entries(values)) { + const my = this.#configSet[field]; + // already validated, just for TS's benefit + /* c8 ignore start */ + if (!my) { + throw new Error('unexpected field in config set: ' + field, { + cause: { found: field }, + }); + } + /* c8 ignore stop */ + my.default = value; + } + return this; + } + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args = process.argv) { + this.loadEnvDefaults(); + const p = this.parseRaw(args); + this.applyDefaults(p); + this.writeEnv(p); + return p; + } + loadEnvDefaults() { + if (this.#envPrefix) { + for (const [field, my] of Object.entries(this.#configSet)) { + const ek = toEnvKey(this.#envPrefix, field); + const env = this.#env[ek]; + if (env !== undefined) { + my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim); + } + } + } + } + applyDefaults(p) { + for (const [field, c] of Object.entries(this.#configSet)) { + if (c.default !== undefined && !(field in p.values)) { + //@ts-ignore + p.values[field] = c.default; + } + } + } + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args) { + if (args === process.argv) { + args = args.slice(process._eval !== undefined ? 1 : 2); + } + const options = toParseArgsOptionsConfig(this.#configSet); + const result = parseArgs({ + args, + options, + // always strict, but using our own logic + strict: false, + allowPositionals: this.#allowPositionals, + tokens: true, + }); + const p = { + values: {}, + positionals: [], + }; + for (const token of result.tokens) { + if (token.kind === 'positional') { + p.positionals.push(token.value); + if (this.#options.stopAtPositional || + this.#options.stopAtPositionalTest?.(token.value)) { + p.positionals.push(...args.slice(token.index + 1)); + break; + } + } + else if (token.kind === 'option') { + let value = undefined; + if (token.name.startsWith('no-')) { + const my = this.#configSet[token.name]; + const pname = token.name.substring('no-'.length); + const pos = this.#configSet[pname]; + if (pos && + pos.type === 'boolean' && + (!my || + (my.type === 'boolean' && !!my.multiple === !!pos.multiple))) { + value = false; + token.name = pname; + } + } + const my = this.#configSet[token.name]; + if (!my) { + throw new Error(`Unknown option '${token.rawName}'. ` + + `To specify a positional argument starting with a '-', ` + + `place it at the end of the command after '--', as in ` + + `'-- ${token.rawName}'`, { + cause: { + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); + } + if (value === undefined) { + if (token.value === undefined) { + if (my.type !== 'boolean') { + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + name: token.rawName, + wanted: valueType(my), + }, + }); + } + value = true; + } + else { + if (my.type === 'boolean') { + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { found: token } }); + } + if (my.type === 'string') { + value = token.value; + } + else { + value = +token.value; + if (value !== value) { + throw new Error(`Invalid value '${token.value}' provided for ` + + `'${token.rawName}' option, expected number`, { + cause: { + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); + } + } + } + } + if (my.multiple) { + const pv = p.values; + const tn = pv[token.name] ?? []; + pv[token.name] = tn; + tn.push(value); + } + else { + const pv = p.values; + pv[token.name] = value; + } + } + } + for (const [field, value] of Object.entries(p.values)) { + const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + let cause; + if (validOptions && !isValidOption(value, validOptions)) { + cause = { name: field, found: value, validOptions: validOptions }; + } + if (valid && !valid(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause }); + } + } + return p; + } + /** + * do not set fields as 'no-foo' if 'foo' exists and both are bools + * just set foo. + */ + #noNoFields(f, val, s = f) { + if (!f.startsWith('no-') || typeof val !== 'boolean') + return; + const yes = f.substring('no-'.length); + // recurse so we get the core config key we care about. + this.#noNoFields(yes, val, s); + if (this.#configSet[yes]?.type === 'boolean') { + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { found: s, wanted: yes } }); + } + } + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o) { + if (!o || typeof o !== 'object') { + throw new Error('Invalid config: not an object', { + cause: { found: o }, + }); + } + const opts = o; + for (const field in o) { + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); + const config = this.#configSet[field]; + if (!config) { + throw new Error(`Unknown config option: ${field}`, { + cause: { found: field }, + }); + } + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + name: field, + found: value, + wanted: valueType(config), + }, + }); + } + let cause; + if (config.validOptions && + !isValidOption(value, config.validOptions)) { + cause = { + name: field, + found: value, + validOptions: config.validOptions, + }; + } + if (config.validate && !config.validate(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid config value for ${field}: ${value}`, { + cause, + }); + } + } + } + writeEnv(p) { + if (!this.#env || !this.#envPrefix) + return; + for (const [field, value] of Object.entries(p.values)) { + const my = this.#configSet[field]; + this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim); + } + } + /** + * Add a heading to the usage output banner + */ + heading(text, level, { pre = false } = {}) { + if (level === undefined) { + level = this.#fields.some(r => isHeading(r)) ? 2 : 1; + } + this.#fields.push({ type: 'heading', text, level, pre }); + return this; + } + /** + * Add a long-form description to the usage output at this position. + */ + description(text, { pre } = {}) { + this.#fields.push({ type: 'description', text, pre }); + return this; + } + /** + * Add one or more number fields. + */ + num(fields) { + return this.#addFields(fields, num); + } + /** + * Add one or more multiple number fields. + */ + numList(fields) { + return this.#addFields(fields, numList); + } + /** + * Add one or more string option fields. + */ + opt(fields) { + return this.#addFields(fields, opt); + } + /** + * Add one or more multiple string option fields. + */ + optList(fields) { + return this.#addFields(fields, optList); + } + /** + * Add one or more flag fields. + */ + flag(fields) { + return this.#addFields(fields, flag); + } + /** + * Add one or more multiple flag fields. + */ + flagList(fields) { + return this.#addFields(fields, flagList); + } + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields) { + const next = this; + for (const [name, field] of Object.entries(fields)) { + this.#validateName(name, field); + next.#fields.push({ + type: 'config', + name, + value: field, + }); + } + Object.assign(next.#configSet, fields); + return next; + } + #addFields(fields, fn) { + const next = this; + Object.assign(next.#configSet, Object.fromEntries(Object.entries(fields).map(([name, field]) => { + this.#validateName(name, field); + const option = fn(field); + next.#fields.push({ + type: 'config', + name, + value: option, + }); + return [name, option]; + }))); + return next; + } + #validateName(name, field) { + if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) { + throw new TypeError(`Invalid option name: ${name}, ` + + `must be '-' delimited ASCII alphanumeric`); + } + if (this.#configSet[name]) { + throw new TypeError(`Cannot redefine option ${field}`); + } + if (this.#shorts[name]) { + throw new TypeError(`Cannot redefine option ${name}, already ` + + `in use for ${this.#shorts[name]}`); + } + if (field.short) { + if (!/^[a-zA-Z0-9]$/.test(field.short)) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + 'must be 1 ASCII alphanumeric character'); + } + if (this.#shorts[field.short]) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + `already in use for ${this.#shorts[field.short]}`); + } + this.#shorts[field.short] = name; + this.#shorts[name] = name; + } + } + /** + * Return the usage banner for the given configuration + */ + usage() { + if (this.#usage) + return this.#usage; + let headingLevel = 1; + const ui = cliui({ width }); + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + ui.div({ + padding: [0, 0, 0, 0], + text: normalize(first.text), + }); + } + ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' }); + if (this.#options.usage) { + ui.div({ + text: this.#options.usage, + padding: [0, 0, 0, 2], + }); + } + else { + const cmd = basename(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + ui.div({ + text: usage, + padding: [0, 0, 0, 2], + }); + } + ui.div({ padding: [0, 0, 0, 0], text: '' }); + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + const print = normalize(maybeDesc.text, maybeDesc.pre); + start++; + ui.div({ padding: [0, 0, 0, 0], text: print }); + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + const { rows, maxWidth } = this.#usageRows(start); + // every heading/description after the first gets indented by 2 + // extra spaces. + for (const row of rows) { + if (row.left) { + // If the row is too long, don't wrap it + // Bump the right-hand side down a line to make room + const configIndent = indent(Math.max(headingLevel, 2)); + if (row.left.length > maxWidth - 3) { + ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); + ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); + } + else { + ui.div({ + text: row.left, + padding: [0, 1, 0, configIndent], + width: maxWidth, + }, { padding: [0, 0, 0, 0], text: row.text }); + } + if (row.skipLine) { + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + } + else { + if (isHeading(row)) { + const { level } = row; + headingLevel = level; + // only h1 and h2 have bottom padding + // h3-h6 do not + const b = level <= 2 ? 1 : 0; + ui.div({ ...row, padding: [0, 0, b, indent(level)] }); + } + else { + ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); + } + } + } + return (this.#usage = ui.toString()); + } + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown() { + if (this.#usageMarkdown) + return this.#usageMarkdown; + const out = []; + let headingLevel = 1; + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + out.push(`# ${normalizeOneLine(first.text)}`); + } + out.push('Usage:'); + if (this.#options.usage) { + out.push(normalizeMarkdown(this.#options.usage, true)); + } + else { + const cmd = basename(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + out.push(normalizeMarkdown(usage, true)); + } + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre)); + start++; + } + const { rows } = this.#usageRows(start); + // heading level in markdown is number of # ahead of text + for (const row of rows) { + if (row.left) { + out.push('#'.repeat(headingLevel + 1) + + ' ' + + normalizeOneLine(row.left, true)); + if (row.text) + out.push(normalizeMarkdown(row.text)); + } + else if (isHeading(row)) { + const { level } = row; + headingLevel = level; + out.push(`${'#'.repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`); + } + else { + out.push(normalizeMarkdown(row.text, !!row.pre)); + } + } + return (this.#usageMarkdown = out.join('\n\n') + '\n'); + } + #usageRows(start) { + // turn each config type into a row, and figure out the width of the + // left hand indentation for the option descriptions. + let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3))); + let maxWidth = 8; + let prev = undefined; + const rows = []; + for (const field of this.#fields.slice(start)) { + if (field.type !== 'config') { + if (prev?.type === 'config') + prev.skipLine = true; + prev = undefined; + field.text = normalize(field.text, !!field.pre); + rows.push(field); + continue; + } + const { value } = field; + const desc = value.description || ''; + const mult = value.multiple ? 'Can be set multiple times' : ''; + const opts = value.validOptions?.length ? + `Valid options:${value.validOptions.map(v => ` ${JSON.stringify(v)}`)}` + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); + const hint = value.hint || + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name + : undefined); + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` + : `-${value.short}<${hint}> `; + const left = value.type === 'boolean' ? + `${short}--${field.name}` + : `${short}--${field.name}=<${hint}>`; + const row = { text, left, type: 'config' }; + if (text.length > width - maxMax) { + row.skipLine = true; + } + if (prev && left.length > maxMax) + prev.skipLine = true; + prev = row; + const len = left.length + 4; + if (len > maxWidth && len < maxMax) { + maxWidth = len; + } + rows.push(row); + } + return { rows, maxWidth }; + } + /** + * Return the configuration options as a plain object + */ + toJSON() { + return Object.fromEntries(Object.entries(this.#configSet).map(([field, def]) => [ + field, + { + type: def.type, + ...(def.multiple ? { multiple: true } : {}), + ...(def.delim ? { delim: def.delim } : {}), + ...(def.short ? { short: def.short } : {}), + ...(def.description ? + { description: normalize(def.description) } + : {}), + ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), + ...(def.default !== undefined ? { default: def.default } : {}), + ...(def.hint ? { hint: def.hint } : {}), + }, + ])); + } + /** + * Custom printer for `util.inspect` + */ + [inspect.custom](_, options) { + return `Jack ${inspect(this.toJSON(), options)}`; + } +} +// Unwrap and un-indent, so we can wrap description +// strings however makes them look nice in the code. +const normalize = (s, pre = false) => { + if (pre) + // prepend a ZWSP to each line so cliui doesn't strip it. + return s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n'); + return s + .split(/^\s*```\s*$/gm) + .map((s, i) => { + if (i % 2 === 1) { + if (!s.trim()) { + return `\`\`\`\n\`\`\`\n`; + } + // outdent the ``` blocks, but preserve whitespace otherwise. + const split = s.split('\n'); + // throw out the \n at the start and end + split.pop(); + split.shift(); + const si = split.reduce((shortest, l) => { + /* c8 ignore next */ + const ind = l.match(/^\s*/)?.[0] ?? ''; + if (ind.length) + return Math.min(ind.length, shortest); + else + return shortest; + }, Infinity); + /* c8 ignore next */ + const i = isFinite(si) ? si : 0; + return ('\n```\n' + + split.map(s => `\u200b${s.substring(i)}`).join('\n') + + '\n```\n'); + } + return (s + // remove single line breaks, except for lists + .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) + // normalize mid-line whitespace + .replace(/([^\n])[ \t]+([^\n])/g, '$1 $2') + // two line breaks are enough + .replace(/\n{3,}/g, '\n\n') + // remove any spaces at the start of a line + .replace(/\n[ \t]+/g, '\n') + .trim()); + }) + .join('\n'); +}; +// normalize for markdown printing, remove leading spaces on lines +const normalizeMarkdown = (s, pre = false) => { + const n = normalize(s, pre).replace(/\\/g, '\\\\'); + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + : n.replace(/\n +/g, '\n').trim(); +}; +const normalizeOneLine = (s, pre = false) => { + const n = normalize(s, pre) + .replace(/[\s\u200b]+/g, ' ') + .trim(); + return pre ? `\`${n}\`` : n; +}; +/** + * Main entry point. Create and return a {@link Jack} object. + */ +export const jack = (options = {}) => new Jack(options); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/index.js.map b/node_modules/jackspeak/dist/esm/index.js.map new file mode 100644 index 0000000..82c23b0 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAmC,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,SAAS,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C,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,UAAuB,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA","sourcesContent":["export type ConfigType = 'number' | 'string' | 'boolean'\n\n/**\n * Given a Jack object, get the typeof its ConfigSet\n */\nexport type Unwrap = J extends Jack ? C : never\n\nimport { inspect, InspectOptions, ParseArgsConfig } from 'node:util'\nimport { parseArgs } from './parse-args.js'\n\n// it's a tiny API, just cast it inline, it's fine\n//@ts-ignore\nimport cliui from '@isaacs/cliui'\nimport { basename } from 'node:path'\n\nconst width = Math.min(\n (process && process.stdout && process.stdout.columns) || 80,\n 80,\n)\n\n// indentation spaces from heading level\nconst indent = (n: number) => (n - 1) * 2\n\nconst toEnvKey = (pref: string, key: string): string => {\n return [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')]\n .join(' ')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_')\n}\n\nconst toEnvVal = (\n value: string | boolean | number | string[] | boolean[] | number[],\n delim: string = '\\n',\n): string => {\n const str =\n typeof value === 'string' ? value\n : typeof value === 'boolean' ?\n value ? '1'\n : '0'\n : typeof value === 'number' ? String(value)\n : Array.isArray(value) ?\n value.map((v: string | number | boolean) => toEnvVal(v)).join(delim)\n : /* c8 ignore start */ undefined\n if (typeof str !== 'string') {\n throw new Error(\n `could not serialize value to environment: ${JSON.stringify(value)}`,\n )\n }\n /* c8 ignore stop */\n return str\n}\n\nconst fromEnvVal = (\n env: string,\n type: T,\n multiple: M,\n delim: string = '\\n',\n): ValidValue =>\n (multiple ?\n env ? env.split(delim).map(v => fromEnvVal(v, type, false))\n : []\n : type === 'string' ? env\n : type === 'boolean' ? env === '1'\n : +env.trim()) as ValidValue\n\n/**\n * Defines the type of value that is valid, given a config definition's\n * {@link ConfigType} and boolean multiple setting\n */\nexport type ValidValue<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n> =\n [T, M] extends ['number', true] ? number[]\n : [T, M] extends ['string', true] ? string[]\n : [T, M] extends ['boolean', true] ? boolean[]\n : [T, M] extends ['number', false] ? number\n : [T, M] extends ['string', false] ? string\n : [T, M] extends ['boolean', false] ? boolean\n : [T, M] extends ['string', boolean] ? string | string[]\n : [T, M] extends ['boolean', boolean] ? boolean | boolean[]\n : [T, M] extends ['number', boolean] ? number | number[]\n : [T, M] extends [ConfigType, false] ? string | number | boolean\n : [T, M] extends [ConfigType, true] ? string[] | number[] | boolean[]\n : string | number | boolean | string[] | number[] | boolean[]\n\n/**\n * The meta information for a config option definition, when the\n * type and multiple values can be inferred by the method being used\n */\nexport type ConfigOptionMeta<\n T extends ConfigType,\n M extends boolean = boolean,\n O extends\n | undefined\n | (T extends 'boolean' ? never\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : readonly number[] | readonly string[]) =\n | undefined\n | (T extends 'boolean' ? never\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : readonly number[] | readonly string[]),\n> = {\n default?:\n | undefined\n | (ValidValue &\n (O extends number[] | string[] ?\n M extends false ?\n O[number]\n : O[number][]\n : unknown))\n validOptions?: O\n description?: string\n validate?:\n | ((v: unknown) => v is ValidValue)\n | ((v: unknown) => boolean)\n short?: string | undefined\n type?: T\n hint?: T extends 'boolean' ? never : string\n delim?: M extends true ? string : never\n} & (M extends false ? { multiple?: false | undefined }\n: M extends true ? { multiple: true }\n: { multiple?: boolean })\n\n/**\n * A set of {@link ConfigOptionMeta} fields, referenced by their longOption\n * string values.\n */\nexport type ConfigMetaSet<\n T extends ConfigType,\n M extends boolean = boolean,\n> = {\n [longOption: string]: ConfigOptionMeta\n}\n\n/**\n * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet}\n */\nexport type ConfigSetFromMetaSet<\n T extends ConfigType,\n M extends boolean,\n S extends ConfigMetaSet,\n> = {\n [longOption in keyof S]: ConfigOptionBase\n}\n\n/**\n * Fields that can be set on a {@link ConfigOptionBase} or\n * {@link ConfigOptionMeta} based on whether or not the field is known to be\n * multiple.\n */\nexport type MultiType =\n M extends true ?\n {\n multiple: true\n delim?: string | undefined\n }\n : M extends false ?\n {\n multiple?: false | undefined\n delim?: undefined\n }\n : {\n multiple?: boolean | undefined\n delim?: string | undefined\n }\n\n/**\n * A config field definition, in its full representation.\n */\nexport type ConfigOptionBase<\n T extends ConfigType,\n M extends boolean = boolean,\n> = {\n type: T\n short?: string | undefined\n default?: ValidValue | undefined\n description?: string\n hint?: T extends 'boolean' ? undefined : string | undefined\n validate?: (v: unknown) => v is ValidValue\n validOptions?: T extends 'boolean' ? undefined\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : readonly number[] | readonly string[]\n} & MultiType\n\nexport const isConfigType = (t: string): t is ConfigType =>\n typeof t === 'string' &&\n (t === 'string' || t === 'number' || t === 'boolean')\n\nconst undefOrType = (v: unknown, t: string): boolean =>\n v === undefined || typeof v === t\nconst undefOrTypeArray = (v: unknown, t: string): boolean =>\n v === undefined || (Array.isArray(v) && v.every(x => typeof x === t))\n\nconst isValidOption = (v: unknown, vo: readonly unknown[]): boolean =>\n Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v)\n\n// print the value type, for error message reporting\nconst valueType = (\n v:\n | string\n | number\n | boolean\n | string[]\n | number[]\n | boolean[]\n | { type: ConfigType; multiple?: boolean },\n): string =>\n typeof v === 'string' ? 'string'\n : typeof v === 'boolean' ? 'boolean'\n : typeof v === 'number' ? 'number'\n : Array.isArray(v) ?\n joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]'\n : `${v.type}${v.multiple ? '[]' : ''}`\n\nconst joinTypes = (types: string[]): string =>\n types.length === 1 && typeof types[0] === 'string' ?\n types[0]\n : `(${types.join('|')})`\n\nconst isValidValue = (\n v: unknown,\n type: T,\n multi: M,\n): v is ValidValue => {\n if (multi) {\n if (!Array.isArray(v)) return false\n return !v.some((v: unknown) => !isValidValue(v, type, false))\n }\n if (Array.isArray(v)) return false\n return typeof v === type\n}\n\nexport const isConfigOption = (\n o: any,\n type: T,\n multi: M,\n): o is ConfigOptionBase =>\n !!o &&\n typeof o === 'object' &&\n isConfigType(o.type) &&\n o.type === type &&\n undefOrType(o.short, 'string') &&\n undefOrType(o.description, 'string') &&\n undefOrType(o.hint, 'string') &&\n undefOrType(o.validate, 'function') &&\n (o.type === 'boolean' ?\n o.validOptions === undefined\n : undefOrTypeArray(o.validOptions, o.type)) &&\n (o.default === undefined || isValidValue(o.default, type, multi)) &&\n !!o.multiple === multi\n\n/**\n * A set of {@link ConfigOptionBase} objects, referenced by their longOption\n * string values.\n */\nexport type ConfigSet = {\n [longOption: string]: ConfigOptionBase\n}\n\n/**\n * The 'values' field returned by {@link Jack#parse}\n */\nexport type OptionsResults = {\n [k in keyof T]?: T[k]['validOptions'] extends (\n readonly string[] | readonly number[]\n ) ?\n T[k] extends ConfigOptionBase<'string' | 'number', false> ?\n T[k]['validOptions'][number]\n : T[k] extends ConfigOptionBase<'string' | 'number', true> ?\n T[k]['validOptions'][number][]\n : never\n : T[k] extends ConfigOptionBase<'string', false> ? string\n : T[k] extends ConfigOptionBase<'string', true> ? string[]\n : T[k] extends ConfigOptionBase<'number', false> ? number\n : T[k] extends ConfigOptionBase<'number', true> ? number[]\n : T[k] extends ConfigOptionBase<'boolean', false> ? boolean\n : T[k] extends ConfigOptionBase<'boolean', true> ? boolean[]\n : never\n}\n\n/**\n * The object retured by {@link Jack#parse}\n */\nexport type Parsed = {\n values: OptionsResults\n positionals: string[]\n}\n\nfunction num(\n o: ConfigOptionMeta<'number', false> = {},\n): ConfigOptionBase<'number', false> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'number', false)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'number',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'number')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'number[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'number', false>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'number',\n multiple: false,\n }\n}\n\nfunction numList(\n o: ConfigOptionMeta<'number'> = {},\n): ConfigOptionBase<'number', true> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'number', true)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'number[]',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'number')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'number[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'number', true>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'number',\n multiple: true,\n }\n}\n\nfunction opt(\n o: ConfigOptionMeta<'string', false> = {},\n): ConfigOptionBase<'string', false> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'string', false)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'string',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'string')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'string[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'string', false>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'string',\n multiple: false,\n }\n}\n\nfunction optList(\n o: ConfigOptionMeta<'string'> = {},\n): ConfigOptionBase<'string', true> {\n const { default: def, validate: val, validOptions, ...rest } = o\n if (def !== undefined && !isValidValue(def, 'string', true)) {\n throw new TypeError('invalid default value', {\n cause: {\n found: def,\n wanted: 'string[]',\n },\n })\n }\n if (!undefOrTypeArray(validOptions, 'string')) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: 'string[]',\n },\n })\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'string', true>)\n : undefined\n return {\n ...rest,\n default: def,\n validate,\n validOptions,\n type: 'string',\n multiple: true,\n }\n}\n\nfunction flag(\n o: ConfigOptionMeta<'boolean', false> = {},\n): ConfigOptionBase<'boolean', false> {\n const {\n hint,\n default: def,\n validate: val,\n ...rest\n } = o as ConfigOptionMeta<'boolean', false>\n delete (rest as ConfigOptionMeta<'string', false>).validOptions\n if (def !== undefined && !isValidValue(def, 'boolean', false)) {\n throw new TypeError('invalid default value')\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'boolean', false>)\n : undefined\n if (hint !== undefined) {\n throw new TypeError('cannot provide hint for flag')\n }\n return {\n ...rest,\n default: def,\n validate,\n type: 'boolean',\n multiple: false,\n }\n}\n\nfunction flagList(\n o: ConfigOptionMeta<'boolean'> = {},\n): ConfigOptionBase<'boolean', true> {\n const {\n hint,\n default: def,\n validate: val,\n ...rest\n } = o as ConfigOptionMeta<'boolean', false>\n delete (rest as ConfigOptionMeta<'string', false>).validOptions\n if (def !== undefined && !isValidValue(def, 'boolean', true)) {\n throw new TypeError('invalid default value')\n }\n const validate =\n val ?\n (val as (v: unknown) => v is ValidValue<'boolean', true>)\n : undefined\n if (hint !== undefined) {\n throw new TypeError('cannot provide hint for flag list')\n }\n return {\n ...rest,\n default: def,\n validate,\n type: 'boolean',\n multiple: true,\n }\n}\nconst toParseArgsOptionsConfig = (\n options: ConfigSet,\n): Exclude => {\n const c: Exclude = {}\n for (const longOption in options) {\n const config = options[longOption]\n /* c8 ignore start */\n if (!config) {\n throw new Error('config must be an object: ' + longOption)\n }\n /* c8 ignore start */\n if (isConfigOption(config, 'number', true)) {\n c[longOption] = {\n type: 'string',\n multiple: true,\n default: config.default?.map(c => String(c)),\n }\n } else if (isConfigOption(config, 'number', false)) {\n c[longOption] = {\n type: 'string',\n multiple: false,\n default:\n config.default === undefined ?\n undefined\n : String(config.default),\n }\n } else {\n const conf = config as\n | ConfigOptionBase<'string'>\n | ConfigOptionBase<'boolean'>\n c[longOption] = {\n type: conf.type,\n multiple: !!conf.multiple,\n default: conf.default,\n }\n }\n const clo = c[longOption] as ConfigOptionBase\n if (typeof config.short === 'string') {\n clo.short = config.short\n }\n\n if (\n config.type === 'boolean' &&\n !longOption.startsWith('no-') &&\n !options[`no-${longOption}`]\n ) {\n c[`no-${longOption}`] = {\n type: 'boolean',\n multiple: config.multiple,\n }\n }\n }\n return c\n}\n\n/**\n * A row used when generating the {@link Jack#usage} string\n */\nexport interface Row {\n left?: string\n text: string\n skipLine?: boolean\n type?: string\n}\n\n/**\n * A heading for a section in the usage, created by the jack.heading()\n * method.\n *\n * First heading is always level 1, subsequent headings default to 2.\n *\n * The level of the nearest heading level sets the indentation of the\n * description that follows.\n */\nexport interface Heading extends Row {\n type: 'heading'\n text: string\n left?: ''\n skipLine?: boolean\n level: number\n pre?: boolean\n}\nconst isHeading = (r: { type?: string }): r is Heading =>\n r.type === 'heading'\n\n/**\n * An arbitrary blob of text describing some stuff, set by the\n * jack.description() method.\n *\n * Indentation determined by level of the nearest header.\n */\nexport interface Description extends Row {\n type: 'description'\n text: string\n left?: ''\n skipLine?: boolean\n pre?: boolean\n}\n\nconst isDescription = (r: { type?: string }): r is Description =>\n r.type === 'description'\n\n/**\n * A heading or description row used when generating the {@link Jack#usage}\n * string\n */\nexport type TextRow = Heading | Description\n\n/**\n * Either a {@link TextRow} or a reference to a {@link ConfigOptionBase}\n */\nexport type UsageField =\n | TextRow\n | {\n type: 'config'\n name: string\n value: ConfigOptionBase\n }\n\n/**\n * Options provided to the {@link Jack} constructor\n */\nexport interface JackOptions {\n /**\n * Whether to allow positional arguments\n *\n * @default true\n */\n allowPositionals?: boolean\n\n /**\n * Prefix to use when reading/writing the environment variables\n *\n * If not specified, environment behavior will not be available.\n */\n envPrefix?: string\n\n /**\n * Environment object to read/write. Defaults `process.env`.\n * No effect if `envPrefix` is not set.\n */\n env?: { [k: string]: string | undefined }\n\n /**\n * A short usage string. If not provided, will be generated from the\n * options provided, but that can of course be rather verbose if\n * there are a lot of options.\n */\n usage?: string\n\n /**\n * Stop parsing flags and opts at the first positional argument.\n * This is to support cases like `cmd [flags] [options]`, where\n * each subcommand may have different options. This effectively treats\n * any positional as a `--` argument. Only relevant if `allowPositionals`\n * is true.\n *\n * To do subcommands, set this option, look at the first positional, and\n * parse the remaining positionals as appropriate.\n *\n * @default false\n */\n stopAtPositional?: boolean\n\n /**\n * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function,\n * will be called with each positional argument encountered. If the function\n * returns true, then parsing will stop at that point.\n */\n stopAtPositionalTest?: (arg: string) => boolean\n}\n\n/**\n * Class returned by the {@link jack} function and all configuration\n * definition methods. This is what gets chained together.\n */\nexport class Jack {\n #configSet: C\n #shorts: { [k: string]: string }\n #options: JackOptions\n #fields: UsageField[] = []\n #env: { [k: string]: string | undefined }\n #envPrefix?: string\n #allowPositionals: boolean\n #usage?: string\n #usageMarkdown?: string\n\n constructor(options: JackOptions = {}) {\n this.#options = options\n this.#allowPositionals = options.allowPositionals !== false\n this.#env =\n this.#options.env === undefined ? process.env : this.#options.env\n this.#envPrefix = options.envPrefix\n // We need to fib a little, because it's always the same object, but it\n // starts out as having an empty config set. Then each method that adds\n // fields returns `this as Jack`\n this.#configSet = Object.create(null) as C\n this.#shorts = Object.create(null)\n }\n\n /**\n * Set the default value (which will still be overridden by env or cli)\n * as if from a parsed config file. The optional `source` param, if\n * provided, will be included in error messages if a value is invalid or\n * unknown.\n */\n setConfigValues(values: OptionsResults, source = '') {\n try {\n this.validate(values)\n } catch (er) {\n const e = er as Error\n if (source && e && typeof e === 'object') {\n if (e.cause && typeof e.cause === 'object') {\n Object.assign(e.cause, { path: source })\n } else {\n e.cause = { path: source }\n }\n }\n throw e\n }\n for (const [field, value] of Object.entries(values)) {\n const my = this.#configSet[field]\n // already validated, just for TS's benefit\n /* c8 ignore start */\n if (!my) {\n throw new Error('unexpected field in config set: ' + field, {\n cause: { found: field },\n })\n }\n /* c8 ignore stop */\n my.default = value\n }\n return this\n }\n\n /**\n * Parse a string of arguments, and return the resulting\n * `{ values, positionals }` object.\n *\n * If an {@link JackOptions#envPrefix} is set, then it will read default\n * values from the environment, and write the resulting values back\n * to the environment as well.\n *\n * Environment values always take precedence over any other value, except\n * an explicit CLI setting.\n */\n parse(args: string[] = process.argv): Parsed {\n this.loadEnvDefaults()\n const p = this.parseRaw(args)\n this.applyDefaults(p)\n this.writeEnv(p)\n return p\n }\n\n loadEnvDefaults() {\n if (this.#envPrefix) {\n for (const [field, my] of Object.entries(this.#configSet)) {\n const ek = toEnvKey(this.#envPrefix, field)\n const env = this.#env[ek]\n if (env !== undefined) {\n my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim)\n }\n }\n }\n }\n\n applyDefaults(p: Parsed) {\n for (const [field, c] of Object.entries(this.#configSet)) {\n if (c.default !== undefined && !(field in p.values)) {\n //@ts-ignore\n p.values[field] = c.default\n }\n }\n }\n\n /**\n * Only parse the command line arguments passed in.\n * Does not strip off the `node script.js` bits, so it must be just the\n * arguments you wish to have parsed.\n * Does not read from or write to the environment, or set defaults.\n */\n parseRaw(args: string[]): Parsed {\n if (args === process.argv) {\n args = args.slice(\n (process as { _eval?: string })._eval !== undefined ? 1 : 2,\n )\n }\n\n const options = toParseArgsOptionsConfig(this.#configSet)\n const result = parseArgs({\n args,\n options,\n // always strict, but using our own logic\n strict: false,\n allowPositionals: this.#allowPositionals,\n tokens: true,\n })\n\n const p: Parsed = {\n values: {},\n positionals: [],\n }\n for (const token of result.tokens) {\n if (token.kind === 'positional') {\n p.positionals.push(token.value)\n if (\n this.#options.stopAtPositional ||\n this.#options.stopAtPositionalTest?.(token.value)\n ) {\n p.positionals.push(...args.slice(token.index + 1))\n break\n }\n } else if (token.kind === 'option') {\n let value: string | number | boolean | undefined = undefined\n if (token.name.startsWith('no-')) {\n const my = this.#configSet[token.name]\n const pname = token.name.substring('no-'.length)\n const pos = this.#configSet[pname]\n if (\n pos &&\n pos.type === 'boolean' &&\n (!my ||\n (my.type === 'boolean' && !!my.multiple === !!pos.multiple))\n ) {\n value = false\n token.name = pname\n }\n }\n const my = this.#configSet[token.name]\n if (!my) {\n throw new Error(\n `Unknown option '${token.rawName}'. ` +\n `To specify a positional argument starting with a '-', ` +\n `place it at the end of the command after '--', as in ` +\n `'-- ${token.rawName}'`,\n {\n cause: {\n found:\n token.rawName + (token.value ? `=${token.value}` : ''),\n },\n },\n )\n }\n if (value === undefined) {\n if (token.value === undefined) {\n if (my.type !== 'boolean') {\n throw new Error(\n `No value provided for ${token.rawName}, expected ${my.type}`,\n {\n cause: {\n name: token.rawName,\n wanted: valueType(my),\n },\n },\n )\n }\n value = true\n } else {\n if (my.type === 'boolean') {\n throw new Error(\n `Flag ${token.rawName} does not take a value, received '${token.value}'`,\n { cause: { found: token } },\n )\n }\n if (my.type === 'string') {\n value = token.value\n } else {\n value = +token.value\n if (value !== value) {\n throw new Error(\n `Invalid value '${token.value}' provided for ` +\n `'${token.rawName}' option, expected number`,\n {\n cause: {\n name: token.rawName,\n found: token.value,\n wanted: 'number',\n },\n },\n )\n }\n }\n }\n }\n if (my.multiple) {\n const pv = p.values as {\n [k: string]: (string | number | boolean)[]\n }\n const tn = pv[token.name] ?? []\n pv[token.name] = tn\n tn.push(value)\n } else {\n const pv = p.values as { [k: string]: string | number | boolean }\n pv[token.name] = value\n }\n }\n }\n\n for (const [field, value] of Object.entries(p.values)) {\n const valid = this.#configSet[field]?.validate\n const validOptions = this.#configSet[field]?.validOptions\n let cause:\n | undefined\n | {\n name: string\n found: unknown\n validOptions?: readonly string[] | readonly number[]\n }\n if (validOptions && !isValidOption(value, validOptions)) {\n cause = { name: field, found: value, validOptions: validOptions }\n }\n if (valid && !valid(value)) {\n cause ??= { name: field, found: value }\n }\n if (cause) {\n throw new Error(\n `Invalid value provided for --${field}: ${JSON.stringify(\n value,\n )}`,\n { cause },\n )\n }\n }\n\n return p\n }\n\n /**\n * do not set fields as 'no-foo' if 'foo' exists and both are bools\n * just set foo.\n */\n #noNoFields(f: string, val: unknown, s: string = f) {\n if (!f.startsWith('no-') || typeof val !== 'boolean') return\n const yes = f.substring('no-'.length)\n // recurse so we get the core config key we care about.\n this.#noNoFields(yes, val, s)\n if (this.#configSet[yes]?.type === 'boolean') {\n throw new Error(\n `do not set '${s}', instead set '${yes}' as desired.`,\n { cause: { found: s, wanted: yes } },\n )\n }\n }\n\n /**\n * Validate that any arbitrary object is a valid configuration `values`\n * object. Useful when loading config files or other sources.\n */\n validate(o: unknown): asserts o is Parsed['values'] {\n if (!o || typeof o !== 'object') {\n throw new Error('Invalid config: not an object', {\n cause: { found: o },\n })\n }\n const opts = o as Record\n for (const field in o) {\n const value = opts[field]\n /* c8 ignore next - for TS */\n if (value === undefined) continue\n this.#noNoFields(field, value)\n const config = this.#configSet[field]\n if (!config) {\n throw new Error(`Unknown config option: ${field}`, {\n cause: { found: field },\n })\n }\n if (!isValidValue(value, config.type, !!config.multiple)) {\n throw new Error(\n `Invalid value ${valueType(\n value,\n )} for ${field}, expected ${valueType(config)}`,\n {\n cause: {\n name: field,\n found: value,\n wanted: valueType(config),\n },\n },\n )\n }\n let cause:\n | undefined\n | {\n name: string\n found: any\n validOptions?: readonly string[] | readonly number[]\n }\n if (\n config.validOptions &&\n !isValidOption(value, config.validOptions)\n ) {\n cause = {\n name: field,\n found: value,\n validOptions: config.validOptions,\n }\n }\n if (config.validate && !config.validate(value)) {\n cause ??= { name: field, found: value }\n }\n if (cause) {\n throw new Error(`Invalid config value for ${field}: ${value}`, {\n cause,\n })\n }\n }\n }\n\n writeEnv(p: Parsed) {\n if (!this.#env || !this.#envPrefix) return\n for (const [field, value] of Object.entries(p.values)) {\n const my = this.#configSet[field]\n this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(\n value,\n my?.delim,\n )\n }\n }\n\n /**\n * Add a heading to the usage output banner\n */\n heading(\n text: string,\n level?: 1 | 2 | 3 | 4 | 5 | 6,\n { pre = false }: { pre?: boolean } = {},\n ): Jack {\n if (level === undefined) {\n level = this.#fields.some(r => isHeading(r)) ? 2 : 1\n }\n this.#fields.push({ type: 'heading', text, level, pre })\n return this\n }\n\n /**\n * Add a long-form description to the usage output at this position.\n */\n description(text: string, { pre }: { pre?: boolean } = {}): Jack {\n this.#fields.push({ type: 'description', text, pre })\n return this\n }\n\n /**\n * Add one or more number fields.\n */\n num>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, num)\n }\n\n /**\n * Add one or more multiple number fields.\n */\n numList>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, numList)\n }\n\n /**\n * Add one or more string option fields.\n */\n opt>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, opt)\n }\n\n /**\n * Add one or more multiple string option fields.\n */\n optList>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, optList)\n }\n\n /**\n * Add one or more flag fields.\n */\n flag>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, flag)\n }\n\n /**\n * Add one or more multiple flag fields.\n */\n flagList>(\n fields: F,\n ): Jack> {\n return this.#addFields(fields, flagList)\n }\n\n /**\n * Generic field definition method. Similar to flag/flagList/number/etc,\n * but you must specify the `type` (and optionally `multiple` and `delim`)\n * fields on each one, or Jack won't know how to define them.\n */\n addFields(fields: F): Jack {\n const next = this as unknown as Jack\n for (const [name, field] of Object.entries(fields)) {\n this.#validateName(name, field)\n next.#fields.push({\n type: 'config',\n name,\n value: field as ConfigOptionBase,\n })\n }\n Object.assign(next.#configSet, fields)\n return next\n }\n\n #addFields<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n >(\n fields: F,\n fn: (m: ConfigOptionMeta) => ConfigOptionBase,\n ): Jack> {\n type NextC = C & ConfigSetFromMetaSet\n const next = this as unknown as Jack\n Object.assign(\n next.#configSet,\n Object.fromEntries(\n Object.entries(fields).map(([name, field]) => {\n this.#validateName(name, field)\n const option = fn(field)\n next.#fields.push({\n type: 'config',\n name,\n value: option as ConfigOptionBase,\n })\n return [name, option]\n }),\n ),\n )\n return next\n }\n\n #validateName(name: string, field: { short?: string }) {\n if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {\n throw new TypeError(\n `Invalid option name: ${name}, ` +\n `must be '-' delimited ASCII alphanumeric`,\n )\n }\n if (this.#configSet[name]) {\n throw new TypeError(`Cannot redefine option ${field}`)\n }\n if (this.#shorts[name]) {\n throw new TypeError(\n `Cannot redefine option ${name}, already ` +\n `in use for ${this.#shorts[name]}`,\n )\n }\n if (field.short) {\n if (!/^[a-zA-Z0-9]$/.test(field.short)) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n 'must be 1 ASCII alphanumeric character',\n )\n }\n if (this.#shorts[field.short]) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n `already in use for ${this.#shorts[field.short]}`,\n )\n }\n this.#shorts[field.short] = name\n this.#shorts[name] = name\n }\n }\n\n /**\n * Return the usage banner for the given configuration\n */\n usage(): string {\n if (this.#usage) return this.#usage\n\n let headingLevel = 1\n const ui = cliui({ width })\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n ui.div({\n padding: [0, 0, 0, 0],\n text: normalize(first.text),\n })\n }\n ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' })\n if (this.#options.usage) {\n ui.div({\n text: this.#options.usage,\n padding: [0, 0, 0, 2],\n })\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n ui.div({\n text: usage,\n padding: [0, 0, 0, 2],\n })\n }\n\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n const print = normalize(maybeDesc.text, maybeDesc.pre)\n start++\n ui.div({ padding: [0, 0, 0, 0], text: print })\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n\n const { rows, maxWidth } = this.#usageRows(start)\n\n // every heading/description after the first gets indented by 2\n // extra spaces.\n for (const row of rows) {\n if (row.left) {\n // If the row is too long, don't wrap it\n // Bump the right-hand side down a line to make room\n const configIndent = indent(Math.max(headingLevel, 2))\n if (row.left.length > maxWidth - 3) {\n ui.div({ text: row.left, padding: [0, 0, 0, configIndent] })\n ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] })\n } else {\n ui.div(\n {\n text: row.left,\n padding: [0, 1, 0, configIndent],\n width: maxWidth,\n },\n { padding: [0, 0, 0, 0], text: row.text },\n )\n }\n if (row.skipLine) {\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n } else {\n if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n // only h1 and h2 have bottom padding\n // h3-h6 do not\n const b = level <= 2 ? 1 : 0\n ui.div({ ...row, padding: [0, 0, b, indent(level)] })\n } else {\n ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] })\n }\n }\n }\n\n return (this.#usage = ui.toString())\n }\n\n /**\n * Return the usage banner markdown for the given configuration\n */\n usageMarkdown(): string {\n if (this.#usageMarkdown) return this.#usageMarkdown\n\n const out: string[] = []\n\n let headingLevel = 1\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n out.push(`# ${normalizeOneLine(first.text)}`)\n }\n out.push('Usage:')\n if (this.#options.usage) {\n out.push(normalizeMarkdown(this.#options.usage, true))\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n out.push(normalizeMarkdown(usage, true))\n }\n\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre))\n start++\n }\n\n const { rows } = this.#usageRows(start)\n\n // heading level in markdown is number of # ahead of text\n for (const row of rows) {\n if (row.left) {\n out.push(\n '#'.repeat(headingLevel + 1) +\n ' ' +\n normalizeOneLine(row.left, true),\n )\n if (row.text) out.push(normalizeMarkdown(row.text))\n } else if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n out.push(\n `${'#'.repeat(headingLevel)} ${normalizeOneLine(\n row.text,\n row.pre,\n )}`,\n )\n } else {\n out.push(normalizeMarkdown(row.text, !!(row as Description).pre))\n }\n }\n\n return (this.#usageMarkdown = out.join('\\n\\n') + '\\n')\n }\n\n #usageRows(start: number) {\n // turn each config type into a row, and figure out the width of the\n // left hand indentation for the option descriptions.\n let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)))\n let maxWidth = 8\n let prev: Row | TextRow | undefined = undefined\n const rows: (Row | TextRow)[] = []\n for (const field of this.#fields.slice(start)) {\n if (field.type !== 'config') {\n if (prev?.type === 'config') prev.skipLine = true\n prev = undefined\n field.text = normalize(field.text, !!field.pre)\n rows.push(field)\n continue\n }\n const { value } = field\n const desc = value.description || ''\n const mult = value.multiple ? 'Can be set multiple times' : ''\n const opts =\n value.validOptions?.length ?\n `Valid options:${value.validOptions.map(\n v => ` ${JSON.stringify(v)}`,\n )}`\n : ''\n const dmDelim = desc.includes('\\n') ? '\\n\\n' : '\\n'\n const extra = [opts, mult].join(dmDelim).trim()\n const text = (normalize(desc) + dmDelim + extra).trim()\n const hint =\n value.hint ||\n (value.type === 'number' ? 'n'\n : value.type === 'string' ? field.name\n : undefined)\n const short =\n !value.short ? ''\n : value.type === 'boolean' ? `-${value.short} `\n : `-${value.short}<${hint}> `\n const left =\n value.type === 'boolean' ?\n `${short}--${field.name}`\n : `${short}--${field.name}=<${hint}>`\n const row: Row = { text, left, type: 'config' }\n if (text.length > width - maxMax) {\n row.skipLine = true\n }\n if (prev && left.length > maxMax) prev.skipLine = true\n prev = row\n const len = left.length + 4\n if (len > maxWidth && len < maxMax) {\n maxWidth = len\n }\n\n rows.push(row)\n }\n\n return { rows, maxWidth }\n }\n\n /**\n * Return the configuration options as a plain object\n */\n toJSON() {\n return Object.fromEntries(\n Object.entries(this.#configSet).map(([field, def]) => [\n field,\n {\n type: def.type,\n ...(def.multiple ? { multiple: true } : {}),\n ...(def.delim ? { delim: def.delim } : {}),\n ...(def.short ? { short: def.short } : {}),\n ...(def.description ?\n { description: normalize(def.description) }\n : {}),\n ...(def.validate ? { validate: def.validate } : {}),\n ...(def.validOptions ? { validOptions: def.validOptions } : {}),\n ...(def.default !== undefined ? { default: def.default } : {}),\n ...(def.hint ? { hint: def.hint } : {}),\n },\n ]),\n )\n }\n\n /**\n * Custom printer for `util.inspect`\n */\n [inspect.custom](_: number, options: InspectOptions) {\n return `Jack ${inspect(this.toJSON(), options)}`\n }\n}\n\n// Unwrap and un-indent, so we can wrap description\n// strings however makes them look nice in the code.\nconst normalize = (s: string, pre = false) => {\n if (pre)\n // prepend a ZWSP to each line so cliui doesn't strip it.\n return s\n .split('\\n')\n .map(l => `\\u200b${l}`)\n .join('\\n')\n return s\n .split(/^\\s*```\\s*$/gm)\n .map((s, i) => {\n if (i % 2 === 1) {\n if (!s.trim()) {\n return `\\`\\`\\`\\n\\`\\`\\`\\n`\n }\n // outdent the ``` blocks, but preserve whitespace otherwise.\n const split = s.split('\\n')\n // throw out the \\n at the start and end\n split.pop()\n split.shift()\n const si = split.reduce((shortest, l) => {\n /* c8 ignore next */\n const ind = l.match(/^\\s*/)?.[0] ?? ''\n if (ind.length) return Math.min(ind.length, shortest)\n else return shortest\n }, Infinity)\n /* c8 ignore next */\n const i = isFinite(si) ? si : 0\n return (\n '\\n```\\n' +\n split.map(s => `\\u200b${s.substring(i)}`).join('\\n') +\n '\\n```\\n'\n )\n }\n return (\n s\n // remove single line breaks, except for lists\n .replace(/([^\\n])\\n[ \\t]*([^\\n])/g, (_, $1, $2) =>\n !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\\n${$2}`,\n )\n // normalize mid-line whitespace\n .replace(/([^\\n])[ \\t]+([^\\n])/g, '$1 $2')\n // two line breaks are enough\n .replace(/\\n{3,}/g, '\\n\\n')\n // remove any spaces at the start of a line\n .replace(/\\n[ \\t]+/g, '\\n')\n .trim()\n )\n })\n .join('\\n')\n}\n\n// normalize for markdown printing, remove leading spaces on lines\nconst normalizeMarkdown = (s: string, pre: boolean = false): string => {\n const n = normalize(s, pre).replace(/\\\\/g, '\\\\\\\\')\n return pre ?\n `\\`\\`\\`\\n${n.replace(/\\u200b/g, '')}\\n\\`\\`\\``\n : n.replace(/\\n +/g, '\\n').trim()\n}\n\nconst normalizeOneLine = (s: string, pre: boolean = false) => {\n const n = normalize(s, pre)\n .replace(/[\\s\\u200b]+/g, ' ')\n .trim()\n return pre ? `\\`${n}\\`` : n\n}\n\n/**\n * Main entry point. Create and return a {@link Jack} object.\n */\nexport const jack = (options: JackOptions = {}) => new Jack(options)\n"]} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/package.json b/node_modules/jackspeak/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/jackspeak/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/jackspeak/dist/esm/parse-args.d.ts b/node_modules/jackspeak/dist/esm/parse-args.d.ts new file mode 100644 index 0000000..498d114 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/parse-args.d.ts @@ -0,0 +1,4 @@ +/// +import * as util from 'util'; +export declare const parseArgs: typeof util.parseArgs; +//# sourceMappingURL=parse-args.d.ts.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/parse-args.d.ts.map b/node_modules/jackspeak/dist/esm/parse-args.d.ts.map new file mode 100644 index 0000000..d56cb69 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/parse-args.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-args.d.ts","sourceRoot":"","sources":["../../src/parse-args.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAoC5B,eAAO,MAAM,SAAS,uBAA6C,CAAA"} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/parse-args.js b/node_modules/jackspeak/dist/esm/parse-args.js new file mode 100644 index 0000000..a4be715 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/parse-args.js @@ -0,0 +1,26 @@ +import * as util from 'util'; +const pv = (typeof process === 'object' && + !!process && + typeof process.version === 'string') ? + process.version + : 'v0.0.0'; +const pvs = pv + .replace(/^v/, '') + .split('.') + .map(s => parseInt(s, 10)); +/* c8 ignore start */ +const [major = 0, minor = 0] = pvs; +/* c8 ignore stop */ +let { parseArgs: pa, } = util; +/* c8 ignore start - version specific */ +if (!pa || + major < 16 || + (major === 18 && minor < 11) || + (major === 16 && minor < 19)) { + // Ignore because we will clobber it for commonjs + //@ts-ignore + pa = (await import('@pkgjs/parseargs')).parseArgs; +} +/* c8 ignore stop */ +export const parseArgs = pa; +//# sourceMappingURL=parse-args.js.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/parse-args.js.map b/node_modules/jackspeak/dist/esm/parse-args.js.map new file mode 100644 index 0000000..48017f0 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/parse-args.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-args.js","sourceRoot":"","sources":["../../src/parse-args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,MAAM,EAAE,GACN,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,CACpC,CAAC,CAAC;IACD,OAAO,CAAC,OAAO;IACjB,CAAC,CAAC,QAAQ,CAAA;AACZ,MAAM,GAAG,GAAG,EAAE;KACX,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;KACjB,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAE5B,qBAAqB;AACrB,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAA;AAClC,oBAAoB;AAEpB,IAAI,EACF,SAAS,EAAE,EAAE,GACd,GAA8D,IAAI,CAAA;AAEnE,wCAAwC;AACxC,IACE,CAAC,EAAE;IACH,KAAK,GAAG,EAAE;IACV,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC;IAC5B,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC,EAC5B,CAAC;IACD,iDAAiD;IACjD,YAAY;IACZ,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC;AACD,oBAAoB;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG,EAA0C,CAAA","sourcesContent":["import * as util from 'util'\n\nconst pv =\n (\n typeof process === 'object' &&\n !!process &&\n typeof process.version === 'string'\n ) ?\n process.version\n : 'v0.0.0'\nconst pvs = pv\n .replace(/^v/, '')\n .split('.')\n .map(s => parseInt(s, 10))\n\n/* c8 ignore start */\nconst [major = 0, minor = 0] = pvs\n/* c8 ignore stop */\n\nlet {\n parseArgs: pa,\n}: typeof import('util') | typeof import('@pkgjs/parseargs') = util\n\n/* c8 ignore start - version specific */\nif (\n !pa ||\n major < 16 ||\n (major === 18 && minor < 11) ||\n (major === 16 && minor < 19)\n) {\n // Ignore because we will clobber it for commonjs\n //@ts-ignore\n pa = (await import('@pkgjs/parseargs')).parseArgs\n}\n/* c8 ignore stop */\n\nexport const parseArgs = pa as (typeof import('util'))['parseArgs']\n"]} \ No newline at end of file diff --git a/node_modules/jackspeak/package.json b/node_modules/jackspeak/package.json new file mode 100644 index 0000000..89022d1 --- /dev/null +++ b/node_modules/jackspeak/package.json @@ -0,0 +1,95 @@ +{ + "name": "jackspeak", + "version": "3.4.1", + "description": "A very strict and proper argument parser.", + "tshy": { + "main": true, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.js" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "build-examples": "for i in examples/*.js ; do node $i -h > ${i/.js/.txt}; done", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "license": "BlueOak-1.0.0", + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "devDependencies": { + "@types/node": "^20.7.0", + "@types/pkgjs__parseargs": "^0.10.1", + "prettier": "^3.2.5", + "tap": "^18.8.0", + "tshy": "^1.14.0", + "typedoc": "^0.25.1", + "typescript": "^5.2.2" + }, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/jackspeak.git" + }, + "keywords": [ + "argument", + "parser", + "args", + "option", + "flag", + "cli", + "command", + "line", + "parse", + "parsing" + ], + "author": "Isaac Z. Schlueter ", + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } +} diff --git a/node_modules/jake/Makefile b/node_modules/jake/Makefile new file mode 100644 index 0000000..3d0574e --- /dev/null +++ b/node_modules/jake/Makefile @@ -0,0 +1,44 @@ +# +# Jake JavaScript build tool +# Copyright 2112 Matthew Eernisse (mde@fleegix.org) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +.PHONY: all build install clean uninstall + +PREFIX=/usr/local +DESTDIR= + +all: build + +build: + @echo 'Jake built.' + +install: + @mkdir -p $(DESTDIR)$(PREFIX)/bin && \ + mkdir -p $(DESTDIR)$(PREFIX)/lib/node_modules/jake && \ + mkdir -p ./node_modules && \ + npm install utilities minimatch && \ + cp -R ./* $(DESTDIR)$(PREFIX)/lib/node_modules/jake/ && \ + ln -snf ../lib/node_modules/jake/bin/cli.js $(DESTDIR)$(PREFIX)/bin/jake && \ + chmod 755 $(DESTDIR)$(PREFIX)/lib/node_modules/jake/bin/cli.js && \ + echo 'Jake installed.' + +clean: + @true + +uninstall: + @rm -f $(DESTDIR)$(PREFIX)/bin/jake && \ + rm -fr $(DESTDIR)$(PREFIX)/lib/node_modules/jake/ && \ + echo 'Jake uninstalled.' diff --git a/node_modules/jake/README.md b/node_modules/jake/README.md new file mode 100644 index 0000000..e938850 --- /dev/null +++ b/node_modules/jake/README.md @@ -0,0 +1,17 @@ +### Jake -- the JavaScript build tool for Node.js + +[![Build Status](https://travis-ci.org/jakejs/jake.svg?branch=master)](https://travis-ci.org/jakejs/jake) + +Documentation site at [http://jakejs.com](http://jakejs.com/) + +### Contributing +1. [Install node](http://nodejs.org/#download). +2. Clone this repository `$ git clone git@github.com:jakejs/jake.git`. +3. Install dependencies `$ npm install`. +4. Run tests with `$ npm test`. +5. Start Hacking! + +### License + +Licensed under the Apache License, Version 2.0 +() diff --git a/node_modules/jake/bin/bash_completion.sh b/node_modules/jake/bin/bash_completion.sh new file mode 100755 index 0000000..bb25995 --- /dev/null +++ b/node_modules/jake/bin/bash_completion.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# http://stackoverflow.com/a/246128 +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +JAKE_BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +# http://stackoverflow.com/a/12495480 +# http://stackoverflow.com/a/28647824 +_auto_jake() +{ + local cur + local -a COMPGEN=() + _get_comp_words_by_ref -n : -c cur + + # run auto-completions in jake via our auto_complete.js wrapper + local -a auto_complete_info=( $(export COMP_LINE="${COMP_LINE}" && ${JAKE_BIN_DIR}/auto_complete.js "$cur" "${3}") ) + # check reply flag + local reply_flag="${auto_complete_info[0]}" + if [[ "${reply_flag}" == "no-complete" ]]; then + return 1 + fi + local auto_completions=("${auto_complete_info[@]:1}") + COMPGEN=( $(compgen -W "${auto_completions[*]}" -- "$cur") ) + COMPREPLY=( "${COMPGEN[@]}" ) + + __ltrim_colon_completions "$cur" + + # do we need another space?? + if [[ "${reply_flag}" == "yes-space" ]]; then + COMPREPLY=( "${COMPGEN[@]}" " " ) + fi + + return 0 +} + +complete -o default -F _auto_jake jake diff --git a/node_modules/jake/bin/cli.js b/node_modules/jake/bin/cli.js new file mode 100755 index 0000000..9f68abb --- /dev/null +++ b/node_modules/jake/bin/cli.js @@ -0,0 +1,31 @@ +#!/usr/bin/env node +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +// Try to load a local jake +try { + require(`${ process.cwd() }/node_modules/jake`); +} +// If that fails, likely running globally +catch(e) { + require('../lib/jake'); +} + +var args = process.argv.slice(2); + +jake.run.apply(jake, args); diff --git a/node_modules/jake/jakefile.js b/node_modules/jake/jakefile.js new file mode 100644 index 0000000..5a5a55e --- /dev/null +++ b/node_modules/jake/jakefile.js @@ -0,0 +1,112 @@ +let proc = require('child_process'); + +const PROJECT_DIR = process.cwd(); +process.env.PROJECT_DIR = PROJECT_DIR; + +namespace('doc', function () { + task('generate', ['doc:clobber'], function () { + var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' + + '-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib'; + jake.logger.log('Generating docs ...'); + jake.exec([cmd], function () { + jake.logger.log('Done.'); + complete(); + }); + }, {async: true}); + + task('clobber', function () { + var cmd = 'rm -fr ./doc/*'; + jake.exec([cmd], function () { + jake.logger.log('Clobbered old docs.'); + complete(); + }); + }, {async: true}); + +}); + +desc('Generate docs for Jake'); +task('doc', ['doc:generate']); + +npmPublishTask('jake', function () { + this.packageFiles.include([ + 'Makefile', + 'jakefile.js', + 'README.md', + 'package.json', + 'usage.txt', + 'lib/**', + 'bin/**', + 'test/**' + ]); + this.packageFiles.exclude([ + 'test/tmp' + ]); +}); + +jake.Task['publish:package'].directory = PROJECT_DIR; + +namespace('test', function () { + + let integrationTest = task('integration', async function () { + let testArgs = []; + if (process.env.filter) { + testArgs.push(process.env.filter); + } + else { + testArgs.push('*.js'); + } + let spawned = proc.spawn(`${PROJECT_DIR}/node_modules/.bin/mocha`, testArgs, { + stdio: 'inherit' + }); + return new Promise((resolve, reject) => { + spawned.on('exit', () => { + resolve(); + }); + }); + + }); + integrationTest.directory = `${PROJECT_DIR}/test/integration`; + + let integrationClobber = task('integrationClobber', function () { + proc.execSync('rm -rf package.json pkg tmp_publish'); + }); + integrationClobber.directory = `${PROJECT_DIR}/test/integration`; + + let unitTest = task('unit', async function () { + let testArgs = []; + if (process.env.filter) { + testArgs.push(process.env.filter); + } + else { + testArgs.push('*.js'); + } + let spawned = proc.spawn(`${PROJECT_DIR}/node_modules/.bin/mocha`, testArgs, { + stdio: 'inherit' + }); + }); + unitTest.directory = `${PROJECT_DIR}/test/unit`; + +}); + +desc('Runs all tests'); +task('test', ['test:unit', 'test:integration', 'test:integrationClobber']); + +desc('Runs eslint for both lib and test directories'); +task('lint', function (doFix) { + + let cmd = 'eslint --format codeframe "lib/**/*.js" "test/**/*.js"'; + if (doFix) { + cmd += ' --fix'; + } + try { + proc.execSync(cmd); + } + catch (err) { + console.log(err.message); + console.log(err.stderr.toString()); + console.log(err.stdout.toString()); + fail('eslint failed'); + } +}); + + diff --git a/node_modules/jake/lib/api.js b/node_modules/jake/lib/api.js new file mode 100644 index 0000000..9f09140 --- /dev/null +++ b/node_modules/jake/lib/api.js @@ -0,0 +1,409 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +let { uuid } = require('./utils'); + +let api = new (function () { + /** + @name task + @static + @function + @description Creates a Jake Task + ` + @param {String} name The name of the Task + @param {Array} [prereqs] Prerequisites to be run before this task + @param {Function} [action] The action to perform for this task + @param {Object} [opts] + @param {Boolean} [opts.asyc=false] Perform this task asynchronously. + If you flag a task with this option, you must call the global + `complete` method inside the task's action, for execution to proceed + to the next task. + + @example + desc('This is the default task.'); + task('default', function (params) { + console.log('This is the default task.'); + }); + + desc('This task has prerequisites.'); + task('hasPrereqs', ['foo', 'bar', 'baz'], function (params) { + console.log('Ran some prereqs first.'); + }); + + desc('This is an asynchronous task.'); + task('asyncTask', function () { + setTimeout(complete, 1000); + }, {async: true}); + */ + this.task = function (name, prereqs, action, opts) { + let args = Array.prototype.slice.call(arguments); + let createdTask; + args.unshift('task'); + createdTask = jake.createTask.apply(global, args); + jake.currentTaskDescription = null; + return createdTask; + }; + + /** + @name rule + @static + @function + @description Creates a Jake Suffix Rule + ` + @param {String} pattern The suffix name of the objective + @param {String} source The suffix name of the objective + @param {Array} [prereqs] Prerequisites to be run before this task + @param {Function} [action] The action to perform for this task + @param {Object} [opts] + @param {Boolean} [opts.asyc=false] Perform this task asynchronously. + If you flag a task with this option, you must call the global + `complete` method inside the task's action, for execution to proceed + to the next task. + @example + desc('This is a rule, which does not support namespace or pattern.'); + rule('.o', '.c', {async: true}, function () { + let cmd = util.format('gcc -o %s %s', this.name, this.source); + jake.exec([cmd], function () { + complete(); + }, {printStdout: true}); + }); + + desc('This rule has prerequisites.'); + rule('.o', '.c', ['util.h'], {async: true}, function () { + let cmd = util.format('gcc -o %s %s', this.name, this.source); + jake.exec([cmd], function () { + complete(); + }, {printStdout: true}); + }); + + desc('This is a rule with patterns.'); + rule('%.o', '%.c', {async: true}, function () { + let cmd = util.format('gcc -o %s %s', this.name, this.source); + jake.exec([cmd], function () { + complete(); + }, {printStdout: true}); + }); + + desc('This is another rule with patterns.'); + rule('obj/%.o', 'src/%.c', {async: true}, function () { + let cmd = util.format('gcc -o %s %s', this.name, this.source); + jake.exec([cmd], function () { + complete(); + }, {printStdout: true}); + }); + + desc('This is an example with chain rules.'); + rule('%.pdf', '%.dvi', {async: true}, function () { + let cmd = util.format('dvipdfm %s',this.source); + jake.exec([cmd], function () { + complete(); + }, {printStdout: true}); + }); + + rule('%.dvi', '%.tex', {async: true}, function () { + let cmd = util.format('latex %s',this.source); + jake.exec([cmd], function () { + complete(); + }, {printStdout: true}); + }); + + desc('This rule has a namespace.'); + task('default', ['debug:obj/main.o]); + + namespace('debug', {async: true}, function() { + rule('obj/%.o', 'src/%.c', function () { + // ... + }); + } + */ + this.rule = function () { + let args = Array.prototype.slice.call(arguments); + let arg; + let pattern = args.shift(); + let source = args.shift(); + let prereqs = []; + let action = function () {}; + let opts = {}; + let key = pattern.toString(); // May be a RegExp + + while ((arg = args.shift())) { + if (typeof arg == 'function') { + action = arg; + } + else if (Array.isArray(arg)) { + prereqs = arg; + } + else { + opts = arg; + } + } + + jake.currentNamespace.rules[key] = new jake.Rule({ + pattern: pattern, + source: source, + prereqs: prereqs, + action: action, + opts: opts, + desc: jake.currentTaskDescription, + ns: jake.currentNamespace + }); + jake.currentTaskDescription = null; + }; + + /** + @name directory + @static + @function + @description Creates a Jake DirectoryTask. Can be used as a prerequisite + for FileTasks, or for simply ensuring a directory exists for use with a + Task's action. + ` + @param {String} name The name of the DiretoryTask + + @example + + // Creates the package directory for distribution + directory('pkg'); + */ + this.directory = function (name) { + let args = Array.prototype.slice.call(arguments); + let createdTask; + args.unshift('directory'); + createdTask = jake.createTask.apply(global, args); + jake.currentTaskDescription = null; + return createdTask; + }; + + /** + @name file + @static + @function + @description Creates a Jake FileTask. + ` + @param {String} name The name of the FileTask + @param {Array} [prereqs] Prerequisites to be run before this task + @param {Function} [action] The action to create this file, if it doesn't + exist already. + @param {Object} [opts] + @param {Array} [opts.asyc=false] Perform this task asynchronously. + If you flag a task with this option, you must call the global + `complete` method inside the task's action, for execution to proceed + to the next task. + + */ + this.file = function (name, prereqs, action, opts) { + let args = Array.prototype.slice.call(arguments); + let createdTask; + args.unshift('file'); + createdTask = jake.createTask.apply(global, args); + jake.currentTaskDescription = null; + return createdTask; + }; + + /** + @name desc + @static + @function + @description Creates a description for a Jake Task (or FileTask, + DirectoryTask). When invoked, the description that iscreated will + be associated with whatever Task is created next. + ` + @param {String} description The description for the Task + */ + this.desc = function (description) { + jake.currentTaskDescription = description; + }; + + /** + @name namespace + @static + @function + @description Creates a namespace which allows logical grouping + of tasks, and prevents name-collisions with task-names. Namespaces + can be nested inside of other namespaces. + ` + @param {String} name The name of the namespace + @param {Function} scope The enclosing scope for the namespaced tasks + + @example + namespace('doc', function () { + task('generate', ['doc:clobber'], function () { + // Generate some docs + }); + + task('clobber', function () { + // Clobber the doc directory first + }); + }); + */ + this.namespace = function (name, closure) { + let curr = jake.currentNamespace; + let ns = curr.childNamespaces[name] || new jake.Namespace(name, curr); + let fn = closure || function () {}; + curr.childNamespaces[name] = ns; + jake.currentNamespace = ns; + fn(); + jake.currentNamespace = curr; + jake.currentTaskDescription = null; + return ns; + }; + + /** + @name complete + @static + @function + @description Completes an asynchronous task, allowing Jake's + execution to proceed to the next task. Calling complete globally or without + arguments completes the last task on the invocationChain. If you use parallel + execution of prereqs this will probably complete a wrong task. You should call this + function with this task as the first argument, before the optional return value. + Alternatively you can call task.complete() + ` + @example + task('generate', ['doc:clobber'], function () { + exec('./generate_docs.sh', function (err, stdout, stderr) { + if (err || stderr) { + fail(err || stderr); + } + else { + console.log(stdout); + complete(); + } + }); + }, {async: true}); + */ + this.complete = function (task, val) { + //this should detect if the first arg is a task, but I guess it should be more thorough + if(task && task. _currentPrereqIndex >=0 ) { + task.complete(val); + } + else { + val = task; + if(jake._invocationChain.length > 0) { + jake._invocationChain[jake._invocationChain.length-1].complete(val); + } + } + }; + + /** + @name fail + @static + @function + @description Causes Jake execution to abort with an error. + Allows passing an optional error code, which will be used to + set the exit-code of exiting process. + ` + @param {Error|String} err The error to thow when aborting execution. + If this argument is an Error object, it will simply be thrown. If + a String, it will be used as the error-message. (If it is a multi-line + String, the first line will be used as the Error message, and the + remaining lines will be used as the error-stack.) + + @example + task('createTests, function () { + if (!fs.existsSync('./tests')) { + fail('Test directory does not exist.'); + } + else { + // Do some testing stuff ... + } + }); + */ + this.fail = function (err, code) { + let msg; + let errObj; + if (code) { + jake.errorCode = code; + } + if (err) { + if (typeof err == 'string') { + // Use the initial or only line of the error as the error-message + // If there was a multi-line error, use the rest as the stack + msg = err.split('\n'); + errObj = new Error(msg.shift()); + if (msg.length) { + errObj.stack = msg.join('\n'); + } + throw errObj; + } + else if (err instanceof Error) { + throw err; + } + else { + throw new Error(err.toString()); + } + } + else { + throw new Error(); + } + }; + + this.packageTask = function (name, version, prereqs, definition) { + return new jake.PackageTask(name, version, prereqs, definition); + }; + + this.publishTask = function (name, prereqs, opts, definition) { + return new jake.PublishTask(name, prereqs, opts, definition); + }; + + // Backward-compat + this.npmPublishTask = function (name, prereqs, opts, definition) { + return new jake.PublishTask(name, prereqs, opts, definition); + }; + + this.testTask = function () { + let ctor = function () {}; + let t; + ctor.prototype = jake.TestTask.prototype; + t = new ctor(); + jake.TestTask.apply(t, arguments); + return t; + }; + + this.setTaskTimeout = function (t) { + this._taskTimeout = t; + }; + + this.setSeriesAutoPrefix = function (prefix) { + this._seriesAutoPrefix = prefix; + }; + + this.series = function (...args) { + let prereqs = args.map((arg) => { + let name = (this._seriesAutoPrefix || '') + arg.name; + jake.task(name, arg); + return name; + }); + let seriesName = uuid(); + let seriesTask = jake.task(seriesName, prereqs); + seriesTask._internal = true; + let res = function () { + return new Promise((resolve) => { + seriesTask.invoke(); + seriesTask.on('complete', (val) => { + resolve(val); + }); + }); + }; + Object.defineProperty(res, 'name', {value: uuid(), + writable: false}); + return res; + }; + +})(); + +module.exports = api; diff --git a/node_modules/jake/lib/jake.js b/node_modules/jake/lib/jake.js new file mode 100644 index 0000000..ec246ad --- /dev/null +++ b/node_modules/jake/lib/jake.js @@ -0,0 +1,330 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +if (!global.jake) { + + let EventEmitter = require('events').EventEmitter; + // And so it begins + global.jake = new EventEmitter(); + + let fs = require('fs'); + let chalk = require('chalk'); + let taskNs = require('./task'); + let Task = taskNs.Task; + let FileTask = taskNs.FileTask; + let DirectoryTask = taskNs.DirectoryTask; + let Rule = require('./rule').Rule; + let Namespace = require('./namespace').Namespace; + let RootNamespace = require('./namespace').RootNamespace; + let api = require('./api'); + let utils = require('./utils'); + let Program = require('./program').Program; + let loader = require('./loader')(); + let pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString()); + + const MAX_RULE_RECURSION_LEVEL = 16; + + // Globalize jake and top-level API methods (e.g., `task`, `desc`) + Object.assign(global, api); + + // Copy utils onto base jake + jake.logger = utils.logger; + jake.exec = utils.exec; + + // File utils should be aliased directly on base jake as well + Object.assign(jake, utils.file); + + // Also add top-level API methods to exported object for those who don't want to + // use the globals (`file` here will overwrite the 'file' utils namespace) + Object.assign(jake, api); + + Object.assign(jake, new (function () { + + this._invocationChain = []; + this._taskTimeout = 30000; + + // Public properties + // ================= + this.version = pkg.version; + // Used when Jake exits with a specific error-code + this.errorCode = null; + // Loads Jakefiles/jakelibdirs + this.loader = loader; + // The root of all ... namespaces + this.rootNamespace = new RootNamespace(); + // Non-namespaced tasks are placed into the default + this.defaultNamespace = this.rootNamespace; + // Start in the default + this.currentNamespace = this.defaultNamespace; + // Saves the description created by a 'desc' call that prefaces a + // 'task' call that defines a task. + this.currentTaskDescription = null; + this.program = new Program(); + this.FileList = require('filelist').FileList; + this.PackageTask = require('./package_task').PackageTask; + this.PublishTask = require('./publish_task').PublishTask; + this.TestTask = require('./test_task').TestTask; + this.Task = Task; + this.FileTask = FileTask; + this.DirectoryTask = DirectoryTask; + this.Namespace = Namespace; + this.Rule = Rule; + + this.parseAllTasks = function () { + let _parseNs = function (ns) { + let nsTasks = ns.tasks; + let nsNamespaces = ns.childNamespaces; + for (let q in nsTasks) { + let nsTask = nsTasks[q]; + jake.Task[nsTask.fullName] = nsTask; + } + for (let p in nsNamespaces) { + let nsNamespace = nsNamespaces[p]; + _parseNs(nsNamespace); + } + }; + _parseNs(jake.defaultNamespace); + }; + + /** + * Displays the list of descriptions available for tasks defined in + * a Jakefile + */ + this.showAllTaskDescriptions = function (f) { + let p; + let maxTaskNameLength = 0; + let task; + let padding; + let name; + let descr; + let filter = typeof f == 'string' ? f : null; + let taskParams; + let len; + + for (p in jake.Task) { + if (!Object.prototype.hasOwnProperty.call(jake.Task, p)) { + continue; + } + if (filter && p.indexOf(filter) == -1) { + continue; + } + task = jake.Task[p]; + taskParams = task.params; + + // Record the length of the longest task name -- used for + // pretty alignment of the task descriptions + if (task.description) { + len = p.length + taskParams.length; + maxTaskNameLength = len > maxTaskNameLength ? + len : maxTaskNameLength; + } + } + + // Print out each entry with descriptions neatly aligned + for (p in jake.Task) { + if (!Object.prototype.hasOwnProperty.call(jake.Task, p)) { + continue; + } + if (filter && p.indexOf(filter) == -1) { + continue; + } + task = jake.Task[p]; + + taskParams = ""; + if (task.params != "") { + taskParams = "[" + task.params + "]"; + } + + //name = '\033[32m' + p + '\033[39m '; + name = chalk.green(p); + + descr = task.description; + if (descr) { + descr = chalk.gray('# ' + descr); + + // Create padding-string with calculated length + padding = (new Array(maxTaskNameLength - p.length - taskParams.length + 4)).join(' '); + + console.log('jake ' + name + taskParams + padding + descr); + } + } + }; + + this.createTask = function () { + let args = Array.prototype.slice.call(arguments); + let arg; + let obj; + let task; + let type; + let name; + let action; + let opts = {}; + let prereqs = []; + + type = args.shift(); + + // name, [deps], [action] + // Name (string) + deps (array) format + if (typeof args[0] == 'string') { + name = args.shift(); + if (Array.isArray(args[0])) { + prereqs = args.shift(); + } + } + // name:deps, [action] + // Legacy object-literal syntax, e.g.: {'name': ['depA', 'depB']} + else { + obj = args.shift(); + for (let p in obj) { + prereqs = prereqs.concat(obj[p]); + name = p; + } + } + + // Optional opts/callback or callback/opts + while ((arg = args.shift())) { + if (typeof arg == 'function') { + action = arg; + } + else { + opts = Object.assign(Object.create(null), arg); + } + } + + task = jake.currentNamespace.resolveTask(name); + if (task && !action) { + // Task already exists and no action, just update prereqs, and return it. + task.prereqs = task.prereqs.concat(prereqs); + return task; + } + + switch (type) { + case 'directory': + action = function action() { + jake.mkdirP(name); + }; + task = new DirectoryTask(name, prereqs, action, opts); + break; + case 'file': + task = new FileTask(name, prereqs, action, opts); + break; + default: + task = new Task(name, prereqs, action, opts); + } + + jake.currentNamespace.addTask(task); + + if (jake.currentTaskDescription) { + task.description = jake.currentTaskDescription; + jake.currentTaskDescription = null; + } + + // FIXME: Should only need to add a new entry for the current + // task-definition, not reparse the entire structure + jake.parseAllTasks(); + + return task; + }; + + this.attemptRule = function (name, ns, level) { + let prereqRule; + let prereq; + if (level > MAX_RULE_RECURSION_LEVEL) { + return null; + } + // Check Rule + prereqRule = ns.matchRule(name); + if (prereqRule) { + prereq = prereqRule.createTask(name, level); + } + return prereq || null; + }; + + this.createPlaceholderFileTask = function (name, namespace) { + let parsed = name.split(':'); + let filePath = parsed.pop(); // Strip any namespace + let task; + + task = namespace.resolveTask(name); + + // If there's not already an existing dummy FileTask for it, + // create one + if (!task) { + // Create a dummy FileTask only if file actually exists + if (fs.existsSync(filePath)) { + task = new jake.FileTask(filePath); + task.dummy = true; + let ns; + if (parsed.length) { + ns = namespace.resolveNamespace(parsed.join(':')); + } + else { + ns = namespace; + } + if (!namespace) { + throw new Error('Invalid namespace, cannot add FileTask'); + } + ns.addTask(task); + // Put this dummy Task in the global Tasks list so + // modTime will be eval'd correctly + jake.Task[`${ns.path}:${filePath}`] = task; + } + } + + return task || null; + }; + + + this.run = function () { + let args = Array.prototype.slice.call(arguments); + let program = this.program; + let loader = this.loader; + let preempt; + let opts; + + program.parseArgs(args); + program.init(); + + preempt = program.firstPreemptiveOption(); + if (preempt) { + preempt(); + } + else { + opts = program.opts; + // jakefile flag set but no jakefile yet + if (opts.autocomplete && opts.jakefile === true) { + process.stdout.write('no-complete'); + return; + } + // Load Jakefile and jakelibdir files + let jakefileLoaded = loader.loadFile(opts.jakefile); + let jakelibdirLoaded = loader.loadDirectory(opts.jakelibdir); + + if(!jakefileLoaded && !jakelibdirLoaded && !opts.autocomplete) { + fail('No Jakefile. Specify a valid path with -f/--jakefile, ' + + 'or place one in the current directory.'); + } + + program.run(); + } + }; + + })()); +} + +module.exports = jake; diff --git a/node_modules/jake/lib/loader.js b/node_modules/jake/lib/loader.js new file mode 100644 index 0000000..a71b82c --- /dev/null +++ b/node_modules/jake/lib/loader.js @@ -0,0 +1,173 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +let path = require('path'); +let fs = require('fs'); +let existsSync = fs.existsSync; +let utils = require('./utils'); + +// Files like jakelib/foobar.jake.js +const JAKELIB_FILE_PAT = /\.jake$|\.js$/; +const SUPPORTED_EXTENSIONS = { + 'js': null, + 'coffee': function () { + try { + let cs = require('coffeescript'); + if (typeof cs.register == 'function') { + cs.register(); + } + } + catch(e) { + throw new Error('You have a CoffeeScript Jakefile, but have not installed CoffeeScript'); + } + }, + 'ls': function () { + try { + require('livescript'); + } + catch (e) { + throw new Error('You have a LiveScript Jakefile, but have not installed LiveScript'); + } + }, + 'ts': function () { + try { + require('ts-node/register/transpile-only'); + } + catch (e) { + throw new Error('You have a TypeScript Jakefile, but have not installed TypeScript and ts-node'); + } + } +}; +const IMPLICIT_JAKEFILE_NAMES = [ + 'Jakefile', + 'Gulpfile' +]; + +let Loader = function () { + // Load a Jakefile, running the code inside -- this may result in + // tasks getting defined using the original Jake API, e.g., + // `task('foo' ['bar', 'baz']);`, or can also auto-create tasks + // from any functions exported from the file + function loadFile(filePath) { + let exported = require(filePath); + for (let [key, value] of Object.entries(exported)) { + let t; + if (typeof value == 'function') { + t = jake.task(key, value); + t.description = '(Exported function)'; + } + } + } + + function fileExists(name) { + let nameWithExt = null; + // Support no file extension as well + let exts = Object.keys(SUPPORTED_EXTENSIONS).concat(['']); + exts.some((ext) => { + let fname = ext ? `${name}.${ext}` : name; + if (existsSync(fname)) { + nameWithExt = fname; + return true; + } + }); + return nameWithExt; + } + + // Recursive + function findImplicitJakefile() { + let cwd = process.cwd(); + let names = IMPLICIT_JAKEFILE_NAMES; + let found = null; + names.some((name) => { + let n; + // Prefer all-lowercase + n = name.toLowerCase(); + if ((found = fileExists(n))) { + return found; + } + // Check mixed-case as well + n = name; + if ((found = fileExists(n))) { + return found; + } + }); + if (found) { + return found; + } + else { + process.chdir(".."); + // If we've walked all the way up the directory tree, + // bail out with no result + if (cwd === process.cwd()) { + return null; + } + return findImplicitJakefile(); + } + } + + this.loadFile = function (fileSpecified) { + let jakefile; + let origCwd = process.cwd(); + + if (fileSpecified) { + if (existsSync(fileSpecified)) { + jakefile = fileSpecified; + } + } + else { + jakefile = findImplicitJakefile(); + } + + if (jakefile) { + let ext = jakefile.split('.')[1]; + let loaderFunc = SUPPORTED_EXTENSIONS[ext]; + loaderFunc && loaderFunc(); + + loadFile(utils.file.absolutize(jakefile)); + return true; + } + else { + if (!fileSpecified) { + // Restore the working directory on failure + process.chdir(origCwd); + } + return false; + } + }; + + this.loadDirectory = function (d) { + let dirname = d || 'jakelib'; + let dirlist; + dirname = utils.file.absolutize(dirname); + if (existsSync(dirname)) { + dirlist = fs.readdirSync(dirname); + dirlist.forEach(function (filePath) { + if (JAKELIB_FILE_PAT.test(filePath)) { + loadFile(path.join(dirname, filePath)); + } + }); + return true; + } + return false; + }; + +}; + +module.exports = function () { + return new Loader(); +}; diff --git a/node_modules/jake/lib/namespace.js b/node_modules/jake/lib/namespace.js new file mode 100644 index 0000000..a3c2787 --- /dev/null +++ b/node_modules/jake/lib/namespace.js @@ -0,0 +1,115 @@ +const ROOT_NAMESPACE_NAME = '__rootNamespace__'; + +class Namespace { + constructor(name, parentNamespace) { + this.name = name; + this.parentNamespace = parentNamespace; + this.childNamespaces = {}; + this.tasks = {}; + this.rules = {}; + this.path = this.getPath(); + } + + get fullName() { + return this._getFullName(); + } + + addTask(task) { + this.tasks[task.name] = task; + task.namespace = this; + } + + resolveTask(name) { + if (!name) { + return; + } + + let taskPath = name.split(':'); + let taskName = taskPath.pop(); + let task; + let ns; + + // Namespaced, return either relative to current, or from root + if (taskPath.length) { + taskPath = taskPath.join(':'); + ns = this.resolveNamespace(taskPath) || + Namespace.ROOT_NAMESPACE.resolveNamespace(taskPath); + task = (ns && ns.resolveTask(taskName)); + } + // Bare task, return either local, or top-level + else { + task = this.tasks[name] || Namespace.ROOT_NAMESPACE.tasks[name]; + } + + return task || null; + } + + + resolveNamespace(relativeName) { + if (!relativeName) { + return this; + } + + let parts = relativeName.split(':'); + let ns = this; + + for (let i = 0, ii = parts.length; (ns && i < ii); i++) { + ns = ns.childNamespaces[parts[i]]; + } + + return ns || null; + } + + matchRule(relativeName) { + let parts = relativeName.split(':'); + parts.pop(); + let ns = this.resolveNamespace(parts.join(':')); + let rules = ns ? ns.rules : []; + let r; + let match; + + for (let p in rules) { + r = rules[p]; + if (r.match(relativeName)) { + match = r; + } + } + + return (ns && match) || + (this.parentNamespace && + this.parentNamespace.matchRule(relativeName)); + } + + getPath() { + let parts = []; + let next = this.parentNamespace; + while (next) { + parts.push(next.name); + next = next.parentNamespace; + } + parts.pop(); // Remove '__rootNamespace__' + return parts.reverse().join(':'); + } + + _getFullName() { + let path = this.path; + path = (path && path.split(':')) || []; + path.push(this.name); + return path.join(':'); + } + + isRootNamespace() { + return !this.parentNamespace; + } +} + +class RootNamespace extends Namespace { + constructor() { + super(ROOT_NAMESPACE_NAME, null); + Namespace.ROOT_NAMESPACE = this; + } +} + +module.exports.Namespace = Namespace; +module.exports.RootNamespace = RootNamespace; + diff --git a/node_modules/jake/lib/package_task.js b/node_modules/jake/lib/package_task.js new file mode 100644 index 0000000..527aca7 --- /dev/null +++ b/node_modules/jake/lib/package_task.js @@ -0,0 +1,406 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +let path = require('path'); +let fs = require('fs'); +let exec = require('child_process').exec; +let FileList = require('filelist').FileList; + +/** + @name jake + @namespace jake +*/ +/** + @name jake.PackageTask + @constructor + @description Instantiating a PackageTask creates a number of Jake + Tasks that make packaging and distributing your software easy. + + @param {String} name The name of the project + @param {String} version The current project version (will be + appended to the project-name in the package-archive + @param {Function} definition Defines the contents of the package, + and format of the package-archive. Will be executed on the instantiated + PackageTask (i.e., 'this', will be the PackageTask instance), + to set the various instance-propertiess. + + @example + let t = new jake.PackageTask('rous', 'v' + version, function () { + let files = [ + 'Capfile' + , 'Jakefile' + , 'README.md' + , 'package.json' + , 'app/*' + , 'bin/*' + , 'config/*' + , 'lib/*' + , 'node_modules/*' + ]; + this.packageFiles.include(files); + this.packageFiles.exclude('node_modules/foobar'); + this.needTarGz = true; + }); + + */ +let PackageTask = function () { + let args = Array.prototype.slice.call(arguments); + let name = args.shift(); + let version = args.shift(); + let definition = args.pop(); + let prereqs = args.pop() || []; // Optional + + prereqs = [].concat(prereqs); // Accept string or list + + /** + @name jake.PackageTask#name + @public + @type {String} + @description The name of the project + */ + this.name = name; + /** + @name jake.PackageTask#version + @public + @type {String} + @description The project version-string + */ + this.version = version; + /** + @name jake.PackageTask#prereqs + @public + @type {Array} + @description Tasks to run before packaging + */ + this.prereqs = prereqs; + /** + @name jake.PackageTask#packageDir + @public + @type {String='pkg'} + @description The directory-name to use for packaging the software + */ + this.packageDir = 'pkg'; + /** + @name jake.PackageTask#packageFiles + @public + @type {jake.FileList} + @description The list of files and directories to include in the + package-archive + */ + this.packageFiles = new FileList(); + /** + @name jake.PackageTask#needTar + @public + @type {Boolean=false} + @description If set to true, uses the `tar` utility to create + a gzip .tgz archive of the package + */ + this.needTar = false; + /** + @name jake.PackageTask#needTarGz + @public + @type {Boolean=false} + @description If set to true, uses the `tar` utility to create + a gzip .tar.gz archive of the package + */ + this.needTarGz = false; + /** + @name jake.PackageTask#needTarBz2 + @public + @type {Boolean=false} + @description If set to true, uses the `tar` utility to create + a bzip2 .bz2 archive of the package + */ + this.needTarBz2 = false; + /** + @name jake.PackageTask#needJar + @public + @type {Boolean=false} + @description If set to true, uses the `jar` utility to create + a .jar archive of the package + */ + this.needJar = false; + /** + @name jake.PackageTask#needZip + @public + @type {Boolean=false} + @description If set to true, uses the `zip` utility to create + a .zip archive of the package + */ + this.needZip = false; + /** + @name jake.PackageTask#manifestFile + @public + @type {String=null} + @description Can be set to point the `jar` utility at a manifest + file to use in a .jar archive. If unset, one will be automatically + created by the `jar` utility. This path should be relative to the + root of the package directory (this.packageDir above, likely 'pkg') + */ + this.manifestFile = null; + /** + @name jake.PackageTask#tarCommand + @public + @type {String='tar'} + @description The shell-command to use for creating tar archives. + */ + this.tarCommand = 'tar'; + /** + @name jake.PackageTask#jarCommand + @public + @type {String='jar'} + @description The shell-command to use for creating jar archives. + */ + this.jarCommand = 'jar'; + /** + @name jake.PackageTask#zipCommand + @public + @type {String='zip'} + @description The shell-command to use for creating zip archives. + */ + this.zipCommand = 'zip'; + /** + @name jake.PackageTask#archiveNoBaseDir + @public + @type {Boolean=false} + @description Simple option for performing the archive on the + contents of the directory instead of the directory itself + */ + this.archiveNoBaseDir = false; + /** + @name jake.PackageTask#archiveChangeDir + @public + @type {String=null} + @description Equivalent to the '-C' command for the `tar` and `jar` + commands. ("Change to this directory before adding files.") + */ + this.archiveChangeDir = null; + /** + @name jake.PackageTask#archiveContentDir + @public + @type {String=null} + @description Specifies the files and directories to include in the + package-archive. If unset, this will default to the main package + directory -- i.e., name + version. + */ + this.archiveContentDir = null; + + if (typeof definition == 'function') { + definition.call(this); + } + this.define(); +}; + +PackageTask.prototype = new (function () { + + let _compressOpts = { + Tar: { + ext: '.tgz', + flags: 'czf', + cmd: 'tar' + }, + TarGz: { + ext: '.tar.gz', + flags: 'czf', + cmd: 'tar' + }, + TarBz2: { + ext: '.tar.bz2', + flags: 'cjf', + cmd: 'tar' + }, + Jar: { + ext: '.jar', + flags: 'cf', + cmd: 'jar' + }, + Zip: { + ext: '.zip', + flags: 'qr', + cmd: 'zip' + } + }; + + this.define = function () { + let self = this; + let packageDirPath = this.packageDirPath(); + let compressTaskArr = []; + + desc('Build the package for distribution'); + task('package', self.prereqs.concat(['clobberPackage', 'buildPackage'])); + // Backward-compat alias + task('repackage', ['package']); + + task('clobberPackage', function () { + jake.rmRf(self.packageDir, {silent: true}); + }); + + desc('Remove the package'); + task('clobber', ['clobberPackage']); + + let doCommand = function (p) { + let filename = path.resolve(self.packageDir + '/' + self.packageName() + + _compressOpts[p].ext); + if (process.platform == 'win32') { + // Windows full path may have drive letter, which is going to cause + // namespace problems, so strip it. + if (filename.length > 2 && filename[1] == ':') { + filename = filename.substr(2); + } + } + compressTaskArr.push(filename); + + file(filename, [packageDirPath], function () { + let cmd; + let opts = _compressOpts[p]; + // Directory to move to when doing the compression-task + // Changes in the case of zip for emulating -C option + let chdir = self.packageDir; + // Save the current dir so it's possible to pop back up + // after compressing + let currDir = process.cwd(); + let archiveChangeDir; + let archiveContentDir; + + if (self.archiveNoBaseDir) { + archiveChangeDir = self.packageName(); + archiveContentDir = '.'; + } + else { + archiveChangeDir = self.archiveChangeDir; + archiveContentDir = self.archiveContentDir; + } + + cmd = self[opts.cmd + 'Command']; + cmd += ' -' + opts.flags; + if (opts.cmd == 'jar' && self.manifestFile) { + cmd += 'm'; + } + + // The name of the archive to create -- use full path + // so compression can be performed from a different dir + // if needed + cmd += ' ' + filename; + + if (opts.cmd == 'jar' && self.manifestFile) { + cmd += ' ' + self.manifestFile; + } + + // Where to perform the compression -- -C option isn't + // supported in zip, so actually do process.chdir for this + if (archiveChangeDir) { + if (opts.cmd == 'zip') { + chdir = path.join(chdir, archiveChangeDir); + } + else { + cmd += ' -C ' + archiveChangeDir; + } + } + + // Where to get the archive content + if (archiveContentDir) { + cmd += ' ' + archiveContentDir; + } + else { + cmd += ' ' + self.packageName(); + } + + // Move into the desired dir (usually packageDir) to compress + // Return back up to the current dir after the exec + process.chdir(chdir); + + exec(cmd, function (err, stdout, stderr) { + if (err) { throw err; } + + // Return back up to the starting directory (see above, + // before exec) + process.chdir(currDir); + + complete(); + }); + }, {async: true}); + }; + + for (let p in _compressOpts) { + if (this['need' + p]) { + doCommand(p); + } + } + + task('buildPackage', compressTaskArr, function () {}); + + directory(this.packageDir); + + file(packageDirPath, this.packageFiles, function () { + jake.mkdirP(packageDirPath); + let fileList = []; + self.packageFiles.forEach(function (name) { + let f = path.join(self.packageDirPath(), name); + let fDir = path.dirname(f); + jake.mkdirP(fDir, {silent: true}); + + // Add both files and directories + fileList.push({ + from: name, + to: f + }); + }); + let _copyFile = function () { + let file = fileList.pop(); + let stat; + if (file) { + stat = fs.statSync(file.from); + // Target is a directory, just create it + if (stat.isDirectory()) { + jake.mkdirP(file.to, {silent: true}); + _copyFile(); + } + // Otherwise copy the file + else { + jake.cpR(file.from, file.to, {silent: true}); + _copyFile(); + } + } + else { + complete(); + } + }; + _copyFile(); + }, {async: true}); + + + }; + + this.packageName = function () { + if (this.version) { + return this.name + '-' + this.version; + } + else { + return this.name; + } + }; + + this.packageDirPath = function () { + return this.packageDir + '/' + this.packageName(); + }; + +})(); + +jake.PackageTask = PackageTask; +exports.PackageTask = PackageTask; + diff --git a/node_modules/jake/lib/parseargs.js b/node_modules/jake/lib/parseargs.js new file mode 100644 index 0000000..1a00733 --- /dev/null +++ b/node_modules/jake/lib/parseargs.js @@ -0,0 +1,134 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +let parseargs = {}; +let isOpt = function (arg) { return arg.indexOf('-') === 0; }; +let removeOptPrefix = function (opt) { return opt.replace(/^--/, '').replace(/^-/, ''); }; + +/** + * @constructor + * Parses a list of command-line args into a key/value object of + * options and an array of positional commands. + * @ param {Array} opts A list of options in the following format: + * [{full: 'foo', abbr: 'f'}, {full: 'bar', abbr: 'b'}]] + */ +parseargs.Parser = function (opts) { + // A key/value object of matching options parsed out of the args + this.opts = {}; + this.taskNames = null; + this.envVars = null; + + // Data structures used for parsing + this.reg = opts; + this.shortOpts = {}; + this.longOpts = {}; + + let self = this; + [].forEach.call(opts, function (item) { + self.shortOpts[item.abbr] = item; + self.longOpts[item.full] = item; + }); +}; + +parseargs.Parser.prototype = new function () { + + let _trueOrNextVal = function (argParts, args) { + if (argParts[1]) { + return argParts[1]; + } + else { + return (!args[0] || isOpt(args[0])) ? + true : args.shift(); + } + }; + + /** + * Parses an array of arguments into options and positional commands + * @param {Array} args The command-line args to parse + */ + this.parse = function (args) { + let cmds = []; + let cmd; + let envVars = {}; + let opts = {}; + let arg; + let argItem; + let argParts; + let cmdItems; + let taskNames = []; + let preempt; + + while (args.length) { + arg = args.shift(); + + if (isOpt(arg)) { + arg = removeOptPrefix(arg); + argParts = arg.split('='); + argItem = this.longOpts[argParts[0]] || this.shortOpts[argParts[0]]; + if (argItem) { + // First-encountered preemptive opt takes precedence -- no further opts + // or possibility of ambiguity, so just look for a value, or set to + // true and then bail + if (argItem.preempts) { + opts[argItem.full] = _trueOrNextVal(argParts, args); + preempt = true; + break; + } + // If the opt requires a value, see if we can get a value from the + // next arg, or infer true from no-arg -- if it's followed by another + // opt, throw an error + if (argItem.expectValue || argItem.allowValue) { + opts[argItem.full] = _trueOrNextVal(argParts, args); + if (argItem.expectValue && !opts[argItem.full]) { + throw new Error(argItem.full + ' option expects a value.'); + } + } + else { + opts[argItem.full] = true; + } + } + } + else { + cmds.unshift(arg); + } + } + + if (!preempt) { + // Parse out any env-vars and task-name + while ((cmd = cmds.pop())) { + cmdItems = cmd.split('='); + if (cmdItems.length > 1) { + envVars[cmdItems[0]] = cmdItems[1]; + } + else { + taskNames.push(cmd); + } + } + + } + + return { + opts: opts, + envVars: envVars, + taskNames: taskNames + }; + }; + +}; + +module.exports = parseargs; diff --git a/node_modules/jake/lib/program.js b/node_modules/jake/lib/program.js new file mode 100644 index 0000000..121632f --- /dev/null +++ b/node_modules/jake/lib/program.js @@ -0,0 +1,282 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +let fs = require('fs'); +let parseargs = require('./parseargs'); +let utils = require('./utils'); +let Program; +let usage = require('fs').readFileSync(`${__dirname}/../usage.txt`).toString(); +let { Task } = require('./task/task'); + +function die(msg) { + console.log(msg); + process.stdout.write('', function () { + process.stderr.write('', function () { + process.exit(); + }); + }); +} + +let preempts = { + version: function () { + die(jake.version); + }, + help: function () { + die(usage); + } +}; + +let AVAILABLE_OPTS = [ + { full: 'jakefile', + abbr: 'f', + expectValue: true + }, + { full: 'quiet', + abbr: 'q', + expectValue: false + }, + { full: 'directory', + abbr: 'C', + expectValue: true + }, + { full: 'always-make', + abbr: 'B', + expectValue: false + }, + { full: 'tasks', + abbr: 'T', + expectValue: false, + allowValue: true + }, + // Alias t + { full: 'tasks', + abbr: 't', + expectValue: false, + allowValue: true + }, + // Alias ls + { full: 'tasks', + abbr: 'ls', + expectValue: false, + allowValue: true + }, + { full: 'help', + abbr: 'h', + }, + { full: 'version', + abbr: 'V', + }, + // Alias lowercase v + { full: 'version', + abbr: 'v', + }, + { full: 'jakelibdir', + abbr: 'J', + expectValue: true + }, + { full: 'allow-rejection', + abbr: 'ar', + expectValue: false + } +]; + +Program = function () { + this.availableOpts = AVAILABLE_OPTS; + this.opts = {}; + this.taskNames = null; + this.taskArgs = null; + this.envVars = null; + this.die = die; +}; + +Program.prototype = new (function () { + + this.handleErr = function (err) { + if (jake.listeners('error').length !== 0) { + jake.emit('error', err); + return; + } + + if (jake.listeners('error').length) { + jake.emit('error', err); + return; + } + + utils.logger.error('jake aborted.'); + if (err.stack) { + utils.logger.error(err.stack); + } + else { + utils.logger.error(err.message); + } + + process.stdout.write('', function () { + process.stderr.write('', function () { + jake.errorCode = jake.errorCode || 1; + process.exit(jake.errorCode); + }); + }); + }; + + this.parseArgs = function (args) { + let result = (new parseargs.Parser(this.availableOpts)).parse(args); + this.setOpts(result.opts); + this.setTaskNames(result.taskNames); + this.setEnvVars(result.envVars); + }; + + this.setOpts = function (options) { + let opts = options || {}; + Object.assign(this.opts, opts); + }; + + this.internalOpts = function (options) { + this.availableOpts = this.availableOpts.concat(options); + }; + + this.autocompletions = function (cur) { + let p; let i; let task; + let commonPrefix = ''; + let matches = []; + + for (p in jake.Task) { + task = jake.Task[p]; + if ( + 'fullName' in task + && ( + // if empty string, program converts to true + cur === true || + task.fullName.indexOf(cur) === 0 + ) + ) { + if (matches.length === 0) { + commonPrefix = task.fullName; + } + else { + for (i = commonPrefix.length; i > -1; --i) { + commonPrefix = commonPrefix.substr(0, i); + if (task.fullName.indexOf(commonPrefix) === 0) { + break; + } + } + } + matches.push(task.fullName); + } + } + + if (matches.length > 1 && commonPrefix === cur) { + matches.unshift('yes-space'); + } + else { + matches.unshift('no-space'); + } + + process.stdout.write(matches.join(' ')); + }; + + this.setTaskNames = function (names) { + if (names && !Array.isArray(names)) { + throw new Error('Task names must be an array'); + } + this.taskNames = (names && names.length) ? names : ['default']; + }; + + this.setEnvVars = function (vars) { + this.envVars = vars || null; + }; + + this.firstPreemptiveOption = function () { + let opts = this.opts; + for (let p in opts) { + if (preempts[p]) { + return preempts[p]; + } + } + return false; + }; + + this.init = function (configuration) { + let self = this; + let config = configuration || {}; + if (config.options) { + this.setOpts(config.options); + } + if (config.taskNames) { + this.setTaskNames(config.taskNames); + } + if (config.envVars) { + this.setEnvVars(config.envVars); + } + process.addListener('uncaughtException', function (err) { + self.handleErr(err); + }); + if (!this.opts['allow-rejection']) { + process.addListener('unhandledRejection', (reason, promise) => { + utils.logger.error('Unhandled rejection at:', promise, 'reason:', reason); + self.handleErr(reason); + }); + } + if (this.envVars) { + Object.assign(process.env, this.envVars); + } + }; + + this.run = function () { + let rootTask; + let taskNames; + let dirname; + let opts = this.opts; + + if (opts.autocomplete) { + return this.autocompletions(opts['autocomplete-cur'], opts['autocomplete-prev']); + } + // Run with `jake -T`, just show descriptions + if (opts.tasks) { + return jake.showAllTaskDescriptions(opts.tasks); + } + + taskNames = this.taskNames; + if (!(Array.isArray(taskNames) && taskNames.length)) { + throw new Error('Please pass jake.runTasks an array of task-names'); + } + + // Set working dir + dirname = opts.directory; + if (dirname) { + if (fs.existsSync(dirname) && + fs.statSync(dirname).isDirectory()) { + process.chdir(dirname); + } + else { + throw new Error(dirname + ' is not a valid directory path'); + } + } + + rootTask = task(Task.ROOT_TASK_NAME, taskNames, function () {}); + rootTask._internal = true; + + rootTask.once('complete', function () { + jake.emit('complete'); + }); + jake.emit('start'); + rootTask.invoke(); + }; + +})(); + +module.exports.Program = Program; diff --git a/node_modules/jake/lib/publish_task.js b/node_modules/jake/lib/publish_task.js new file mode 100644 index 0000000..9aa8985 --- /dev/null +++ b/node_modules/jake/lib/publish_task.js @@ -0,0 +1,290 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +let fs = require('fs'); +let path = require('path'); +let exec = require('child_process').execSync; +let FileList = require('filelist').FileList; + +let PublishTask = function () { + let args = Array.prototype.slice.call(arguments).filter(function (item) { + return typeof item != 'undefined'; + }); + let arg; + let opts = {}; + let definition; + let prereqs = []; + let createDef = function (arg) { + return function () { + this.packageFiles.include(arg); + }; + }; + + this.name = args.shift(); + + // Old API, just name + list of files + if (args.length == 1 && (Array.isArray(args[0]) || typeof args[0] == 'string')) { + definition = createDef(args.pop()); + } + // Current API, name + [prereqs] + [opts] + definition + else { + while ((arg = args.pop())) { + // Definition func + if (typeof arg == 'function') { + definition = arg; + } + // Prereqs + else if (Array.isArray(arg) || typeof arg == 'string') { + prereqs = arg; + } + // Opts + else { + opts = arg; + } + } + } + + this.prereqs = prereqs; + this.packageFiles = new FileList(); + this.publishCmd = opts.publishCmd || 'npm publish %filename'; + this.publishMessage = opts.publishMessage || 'BOOM! Published.'; + this.gitCmd = opts.gitCmd || 'git'; + this.versionFiles = opts.versionFiles || ['package.json']; + this.scheduleDelay = 5000; + + // Override utility funcs for testing + this._ensureRepoClean = function (stdout) { + if (stdout.length) { + fail(new Error('Git repository is not clean.')); + } + }; + this._getCurrentBranch = function (stdout) { + return String(stdout).trim(); + }; + + if (typeof definition == 'function') { + definition.call(this); + } + this.define(); +}; + + +PublishTask.prototype = new (function () { + + let _currentBranch = null; + + let getPackage = function () { + let pkg = JSON.parse(fs.readFileSync(path.join(process.cwd(), + '/package.json')).toString()); + return pkg; + }; + let getPackageVersionNumber = function () { + return getPackage().version; + }; + + this.define = function () { + let self = this; + + namespace('publish', function () { + task('fetchTags', function () { + // Make sure local tags are up to date + exec(self.gitCmd + ' fetch --tags'); + console.log('Fetched remote tags.'); + }); + + task('getCurrentBranch', function () { + // Figure out what branch to push to + let stdout = exec(self.gitCmd + ' symbolic-ref --short HEAD').toString(); + if (!stdout) { + throw new Error('No current Git branch found'); + } + _currentBranch = self._getCurrentBranch(stdout); + console.log('On branch ' + _currentBranch); + }); + + task('ensureClean', function () { + // Only bump, push, and tag if the Git repo is clean + let stdout = exec(self.gitCmd + ' status --porcelain --untracked-files=no').toString(); + // Throw if there's output + self._ensureRepoClean(stdout); + }); + + task('updateVersionFiles', function () { + let pkg; + let version; + let arr; + let patch; + + // Grab the current version-string + pkg = getPackage(); + version = pkg.version; + // Increment the patch-number for the version + arr = version.split('.'); + patch = parseInt(arr.pop(), 10) + 1; + arr.push(patch); + version = arr.join('.'); + + // Update package.json or other files with the new version-info + self.versionFiles.forEach(function (file) { + let p = path.join(process.cwd(), file); + let data = JSON.parse(fs.readFileSync(p).toString()); + data.version = version; + fs.writeFileSync(p, JSON.stringify(data, true, 2) + '\n'); + }); + // Return the version string so that listeners for the 'complete' event + // for this task can use it (e.g., to update other files before pushing + // to Git) + return version; + }); + + task('pushVersion', ['ensureClean', 'updateVersionFiles'], function () { + let version = getPackageVersionNumber(); + let message = 'Version ' + version; + let cmds = [ + self.gitCmd + ' commit -a -m "' + message + '"', + self.gitCmd + ' push origin ' + _currentBranch, + self.gitCmd + ' tag -a v' + version + ' -m "' + message + '"', + self.gitCmd + ' push --tags' + ]; + cmds.forEach((cmd) => { + exec(cmd); + }); + version = getPackageVersionNumber(); + console.log('Bumped version number to v' + version + '.'); + }); + + let defineTask = task('definePackage', function () { + let version = getPackageVersionNumber(); + new jake.PackageTask(self.name, 'v' + version, self.prereqs, function () { + // Replace the PackageTask's FileList with the PublishTask's FileList + this.packageFiles = self.packageFiles; + this.needTarGz = true; // Default to tar.gz + // If any of the need or archive opts are set + // proxy them to the PackageTask + for (let p in this) { + if (p.indexOf('need') === 0 || p.indexOf('archive') === 0) { + if (typeof self[p] != 'undefined') { + this[p] = self[p]; + } + } + } + }); + }); + defineTask._internal = true; + + task('package', function () { + let definePack = jake.Task['publish:definePackage']; + let pack = jake.Task['package']; + let version = getPackageVersionNumber(); + + // May have already been run + if (definePack.taskStatus == jake.Task.runStatuses.DONE) { + definePack.reenable(true); + } + definePack.execute(); + definePack.on('complete', function () { + pack.invoke(); + console.log('Created package for ' + self.name + ' v' + version); + }); + }); + + task('publish', function () { + return new Promise((resolve) => { + let version = getPackageVersionNumber(); + let filename; + let cmd; + + console.log('Publishing ' + self.name + ' v' + version); + + if (typeof self.createPublishCommand == 'function') { + cmd = self.createPublishCommand(version); + } + else { + filename = './pkg/' + self.name + '-v' + version + '.tar.gz'; + cmd = self.publishCmd.replace(/%filename/gi, filename); + } + + if (typeof cmd == 'function') { + cmd(function (err) { + if (err) { + throw err; + } + console.log(self.publishMessage); + resolve(); + }); + } + else { + // Hackity hack -- NPM publish sometimes returns errror like: + // Error sending version data\nnpm ERR! + // Error: forbidden 0.2.4 is modified, should match modified time + setTimeout(function () { + let stdout = exec(cmd).toString() || ''; + stdout = stdout.trim(); + if (stdout) { + console.log(stdout); + } + console.log(self.publishMessage); + resolve(); + }, self.scheduleDelay); + } + }); + }); + + task('cleanup', function () { + return new Promise((resolve) => { + let clobber = jake.Task.clobber; + clobber.reenable(true); + clobber.on('complete', function () { + console.log('Cleaned up package'); + resolve(); + }); + clobber.invoke(); + }); + }); + + }); + + let prefixNs = function (item) { + return 'publish:' + item; + }; + + // Create aliases in the default namespace + desc('Create a new version and release.'); + task('publish', self.prereqs.concat(['version', 'release'] + .map(prefixNs))); + + desc('Release the existing version.'); + task('publishExisting', self.prereqs.concat(['release'] + .map(prefixNs))); + + task('version', ['fetchTags', 'getCurrentBranch', 'pushVersion'] + .map(prefixNs)); + + task('release', ['package', 'publish', 'cleanup'] + .map(prefixNs)); + + // Invoke proactively so there will be a callable 'package' task + // which can be used apart from 'publish' + jake.Task['publish:definePackage'].invoke(); + }; + +})(); + +jake.PublishTask = PublishTask; +exports.PublishTask = PublishTask; + diff --git a/node_modules/jake/lib/rule.js b/node_modules/jake/lib/rule.js new file mode 100644 index 0000000..25f51ae --- /dev/null +++ b/node_modules/jake/lib/rule.js @@ -0,0 +1,311 @@ +let path = require('path'); +let fs = require('fs'); +let Task = require('./task/task').Task; + +// Split a task to two parts, name space and task name. +// For example, given 'foo:bin/a%.c', return an object with +// - 'ns' : foo +// - 'name' : bin/a%.c +function splitNs(task) { + let parts = task.split(':'); + let name = parts.pop(); + let ns = resolveNs(parts); + return { + 'name' : name, + 'ns' : ns + }; +} + +// Return the namespace based on an array of names. +// For example, given ['foo', 'baz' ], return the namespace +// +// default -> foo -> baz +// +// where default is the global root namespace +// and -> means child namespace. +function resolveNs(parts) { + let ns = jake.defaultNamespace; + for(let i = 0, l = parts.length; ns && i < l; i++) { + ns = ns.childNamespaces[parts[i]]; + } + return ns; +} + +// Given a pattern p, say 'foo:bin/a%.c' +// Return an object with +// - 'ns' : foo +// - 'dir' : bin +// - 'prefix' : a +// - 'suffix' : .c +function resolve(p) { + let task = splitNs(p); + let name = task.name; + let ns = task.ns; + let split = path.basename(name).split('%'); + return { + ns: ns, + dir: path.dirname(name), + prefix: split[0], + suffix: split[1] + }; +} + +// Test whether string a is a suffix of string b +function stringEndWith(a, b) { + let l; + return (l = b.lastIndexOf(a)) == -1 ? false : l + a.length == b.length; +} + +// Replace the suffix a of the string s with b. +// Note that, it is assumed a is a suffix of s. +function stringReplaceSuffix(s, a, b) { + return s.slice(0, s.lastIndexOf(a)) + b; +} + +class Rule { + constructor(opts) { + this.pattern = opts.pattern; + this.source = opts.source; + this.prereqs = opts.prereqs; + this.action = opts.action; + this.opts = opts.opts; + this.desc = opts.desc; + this.ns = opts.ns; + } + + // Create a file task based on this rule for the specified + // task-name + // ====== + // FIXME: Right now this just throws away any passed-in args + // for the synthsized task (taskArgs param) + // ====== + createTask(fullName, level) { + let self = this; + let pattern; + let source; + let action; + let opts; + let prereqs; + let valid; + let src; + let tNs; + let createdTask; + let name = Task.getBaseTaskName(fullName); + let nsPath = Task.getBaseNamespacePath(fullName); + let ns = this.ns.resolveNamespace(nsPath); + + pattern = this.pattern; + source = this.source; + + if (typeof source == 'string') { + src = Rule.getSource(name, pattern, source); + } + else { + src = source(name); + } + + // TODO: Write a utility function that appends a + // taskname to a namespace path + src = nsPath.split(':').filter(function (item) { + return !!item; + }).concat(src).join(':'); + + // Generate the prerequisite for the matching task. + // It is the original prerequisites plus the prerequisite + // representing source file, i.e., + // + // rule( '%.o', '%.c', ['some.h'] ... + // + // If the objective is main.o, then new task should be + // + // file( 'main.o', ['main.c', 'some.h' ] ... + prereqs = this.prereqs.slice(); // Get a copy to work with + prereqs.unshift(src); + + // Prereq should be: + // 1. an existing task + // 2. an existing file on disk + // 3. a valid rule (i.e., not at too deep a level) + valid = prereqs.some(function (p) { + let ns = self.ns; + return ns.resolveTask(p) || + fs.existsSync(Task.getBaseTaskName(p)) || + jake.attemptRule(p, ns, level + 1); + }); + + // If any of the prereqs aren't valid, the rule isn't valid + if (!valid) { + return null; + } + // Otherwise, hunky-dory, finish creating the task for the rule + else { + // Create the action for the task + action = function () { + let task = this; + self.action.apply(task); + }; + + opts = this.opts; + + // Insert the file task into Jake + // + // Since createTask function stores the task as a child task + // of currentNamespace. Here we temporariliy switch the namespace. + // FIXME: Should allow optional ns passed in instead of this hack + tNs = jake.currentNamespace; + jake.currentNamespace = ns; + createdTask = jake.createTask('file', name, prereqs, action, opts); + createdTask.source = src.split(':').pop(); + jake.currentNamespace = tNs; + + return createdTask; + } + } + + match(name) { + return Rule.match(this.pattern, name); + } + + // Test wether the a prerequisite matchs the pattern. + // The arg 'pattern' does not have namespace as prefix. + // For example, the following tests are true + // + // pattern | name + // bin/%.o | bin/main.o + // bin/%.o | foo:bin/main.o + // + // The following tests are false (trivally) + // + // pattern | name + // bin/%.o | foobin/main.o + // bin/%.o | bin/main.oo + static match(pattern, name) { + let p; + let task; + let obj; + let filename; + + if (pattern instanceof RegExp) { + return pattern.test(name); + } + else if (pattern.indexOf('%') == -1) { + // No Pattern. No Folder. No Namespace. + // A Simple Suffix Rule. Just test suffix + return stringEndWith(pattern, name); + } + else { + // Resolve the dir, prefix and suffix of pattern + p = resolve(pattern); + + // Resolve the namespace and task-name + task = splitNs(name); + name = task.name; + + // Set the objective as the task-name + obj = name; + + // Namespace is already matched. + + // Check dir + if (path.dirname(obj) != p.dir) { + return false; + } + + filename = path.basename(obj); + + // Check file name length + if ((p.prefix.length + p.suffix.length + 1) > filename.length) { + // Length does not match. + return false; + } + + // Check prefix + if (filename.indexOf(p.prefix) !== 0) { + return false; + } + + // Check suffix + if (!stringEndWith(p.suffix, filename)) { + return false; + } + + // OK. Find a match. + return true; + } + } + + // Generate the source based on + // - name name for the synthesized task + // - pattern pattern for the objective + // - source pattern for the source + // + // Return the source with properties + // - dep the prerequisite of source + // (with the namespace) + // + // - file the file name of source + // (without the namespace) + // + // For example, given + // + // - name foo:bin/main.o + // - pattern bin/%.o + // - source src/%.c + // + // return 'foo:src/main.c', + // + static getSource(name, pattern, source) { + let dep; + let pat; + let match; + let file; + let src; + + // Regex pattern -- use to look up the extension + if (pattern instanceof RegExp) { + match = pattern.exec(name); + if (match) { + if (typeof source == 'function') { + src = source(name); + } + else { + src = stringReplaceSuffix(name, match[0], source); + } + } + } + // Assume string + else { + // Simple string suffix replacement + if (pattern.indexOf('%') == -1) { + if (typeof source == 'function') { + src = source(name); + } + else { + src = stringReplaceSuffix(name, pattern, source); + } + } + // Percent-based substitution + else { + pat = pattern.replace('%', '(.*?)'); + pat = new RegExp(pat); + match = pat.exec(name); + if (match) { + if (typeof source == 'function') { + src = source(name); + } + else { + file = match[1]; + file = source.replace('%', file); + dep = match[0]; + src = name.replace(dep, file); + } + } + } + } + + return src; + } +} + + +exports.Rule = Rule; diff --git a/node_modules/jake/lib/task/directory_task.js b/node_modules/jake/lib/task/directory_task.js new file mode 100644 index 0000000..b17b624 --- /dev/null +++ b/node_modules/jake/lib/task/directory_task.js @@ -0,0 +1,30 @@ +let fs = require('fs'); +let FileTask = require('./file_task').FileTask; + +/** + @name jake + @namespace jake +*/ +/** + @name jake.DirectoryTask + @constructor + @augments EventEmitter + @augments jake.Task + @augments jake.FileTask + @description A Jake DirectoryTask + + @param {String} name The name of the directory to create. + */ +class DirectoryTask extends FileTask { + constructor(...args) { + super(...args); + if (fs.existsSync(this.name)) { + this.updateModTime(); + } + else { + this.modTime = null; + } + } +} + +exports.DirectoryTask = DirectoryTask; diff --git a/node_modules/jake/lib/task/file_task.js b/node_modules/jake/lib/task/file_task.js new file mode 100644 index 0000000..d23aba8 --- /dev/null +++ b/node_modules/jake/lib/task/file_task.js @@ -0,0 +1,126 @@ +let fs = require('fs'); +let Task = require('./task').Task; + +function isFileOrDirectory(t) { + return (t instanceof FileTask || + t instanceof DirectoryTask); +} + +function isFile(t) { + return (t instanceof FileTask && !(t instanceof DirectoryTask)); +} + +/** + @name jake + @namespace jake +*/ +/** + @name jake.FileTask + @class` + @extentds Task + @description A Jake FileTask + + @param {String} name The name of the Task + @param {Array} [prereqs] Prerequisites to be run before this task + @param {Function} [action] The action to perform to create this file + @param {Object} [opts] + @param {Array} [opts.asyc=false] Perform this task asynchronously. + If you flag a task with this option, you must call the global + `complete` method inside the task's action, for execution to proceed + to the next task. + */ +class FileTask extends Task { + constructor(...args) { + super(...args); + this.dummy = false; + if (fs.existsSync(this.name)) { + this.updateModTime(); + } + else { + this.modTime = null; + } + } + + isNeeded() { + let prereqs = this.prereqs; + let prereqName; + let prereqTask; + + // No repeatsies + if (this.taskStatus == Task.runStatuses.DONE) { + return false; + } + // The always-make override + else if (jake.program.opts['always-make']) { + return true; + } + // Default case + else { + + // We need either an existing file, or an action to create one. + // First try grabbing the actual mod-time of the file + try { + this.updateModTime(); + } + // Then fall back to looking for an action + catch(e) { + if (typeof this.action == 'function') { + return true; + } + else { + throw new Error('File-task ' + this.fullName + ' has no ' + + 'existing file, and no action to create one.'); + } + } + + // Compare mod-time of all the prereqs with its mod-time + // If any prereqs are newer, need to run the action to update + if (prereqs && prereqs.length) { + for (let i = 0, ii = prereqs.length; i < ii; i++) { + prereqName = prereqs[i]; + prereqTask = this.namespace.resolveTask(prereqName) || + jake.createPlaceholderFileTask(prereqName, this.namespace); + // Run the action if: + // 1. The prereq is a normal task (not file/dir) + // 2. The prereq is a file-task with a mod-date more recent than + // the one for this file/dir + if (prereqTask) { + if (!isFileOrDirectory(prereqTask) || + (isFile(prereqTask) && prereqTask.modTime > this.modTime)) { + return true; + } + } + } + this.taskStatus = Task.runStatuses.DONE; + return false; + } + // File/dir has no prereqs, and exists -- no need to run + else { + // Effectively done + this.taskStatus = Task.runStatuses.DONE; + return false; + } + } + } + + updateModTime() { + let stats = fs.statSync(this.name); + this.modTime = stats.mtime; + } + + complete() { + if (!this.dummy) { + this.updateModTime(); + } + // Hackity hack + Task.prototype.complete.apply(this, arguments); + } + +} + +exports.FileTask = FileTask; + +// DirectoryTask is a subclass of FileTask, depends on it +// being defined +let DirectoryTask = require('./directory_task').DirectoryTask; + diff --git a/node_modules/jake/lib/task/index.js b/node_modules/jake/lib/task/index.js new file mode 100644 index 0000000..bc93f41 --- /dev/null +++ b/node_modules/jake/lib/task/index.js @@ -0,0 +1,9 @@ + +let Task = require('./task').Task; +let FileTask = require('./file_task').FileTask; +let DirectoryTask = require('./directory_task').DirectoryTask; + +exports.Task = Task; +exports.FileTask = FileTask; +exports.DirectoryTask = DirectoryTask; + diff --git a/node_modules/jake/lib/task/task.js b/node_modules/jake/lib/task/task.js new file mode 100644 index 0000000..1f9f349 --- /dev/null +++ b/node_modules/jake/lib/task/task.js @@ -0,0 +1,458 @@ +let EventEmitter = require('events').EventEmitter; +let async = require('async'); +let chalk = require('chalk'); +// 'rule' module is required at the bottom because circular deps + +// Used for task value, so better not to use +// null, since value should be unset/uninitialized +let UNDEFINED_VALUE; + +const ROOT_TASK_NAME = '__rootTask__'; +const POLLING_INTERVAL = 100; + +// Parse any positional args attached to the task-name +function parsePrereqName(name) { + let taskArr = name.split('['); + let taskName = taskArr[0]; + let taskArgs = []; + if (taskArr[1]) { + taskArgs = taskArr[1].replace(/\]$/, ''); + taskArgs = taskArgs.split(','); + } + return { + name: taskName, + args: taskArgs + }; +} + +/** + @name jake.Task + @class + @extends EventEmitter + @description A Jake Task + + @param {String} name The name of the Task + @param {Array} [prereqs] Prerequisites to be run before this task + @param {Function} [action] The action to perform for this task + @param {Object} [opts] + @param {Array} [opts.asyc=false] Perform this task asynchronously. + If you flag a task with this option, you must call the global + `complete` method inside the task's action, for execution to proceed + to the next task. + */ +class Task extends EventEmitter { + + constructor(name, prereqs, action, options) { + // EventEmitter ctor takes no args + super(); + + if (name.indexOf(':') > -1) { + throw new Error('Task name cannot include a colon. It is used internally as namespace delimiter.'); + } + let opts = options || {}; + + this._currentPrereqIndex = 0; + this._internal = false; + this._skipped = false; + + this.name = name; + this.prereqs = prereqs; + this.action = action; + this.async = false; + this.taskStatus = Task.runStatuses.UNSTARTED; + this.description = null; + this.args = []; + this.value = UNDEFINED_VALUE; + this.concurrency = 1; + this.startTime = null; + this.endTime = null; + this.directory = null; + this.namespace = null; + + // Support legacy async-flag -- if not explicitly passed or falsy, will + // be set to empty-object + if (typeof opts == 'boolean' && opts === true) { + this.async = true; + } + else { + if (opts.async) { + this.async = true; + } + if (opts.concurrency) { + this.concurrency = opts.concurrency; + } + } + + //Do a test on self dependencies for this task + if(Array.isArray(this.prereqs) && this.prereqs.indexOf(this.name) !== -1) { + throw new Error("Cannot use prereq " + this.name + " as a dependency of itself"); + } + } + + get fullName() { + return this._getFullName(); + } + + get params() { + return this._getParams(); + } + + _initInvocationChain() { + // Legacy global invocation chain + jake._invocationChain.push(this); + + // New root chain + if (!this._invocationChain) { + this._invocationChainRoot = true; + this._invocationChain = []; + if (jake.currentRunningTask) { + jake.currentRunningTask._waitForChains = jake.currentRunningTask._waitForChains || []; + jake.currentRunningTask._waitForChains.push(this._invocationChain); + } + } + } + + /** + @name jake.Task#invoke + @function + @description Runs prerequisites, then this task. If the task has already + been run, will not run the task again. + */ + invoke() { + this._initInvocationChain(); + + this.args = Array.prototype.slice.call(arguments); + this.reenabled = false; + this.runPrereqs(); + } + + /** + @name jake.Task#execute + @function + @description Run only this task, without prereqs. If the task has already + been run, *will* run the task again. + */ + execute() { + this._initInvocationChain(); + + this.args = Array.prototype.slice.call(arguments); + this.reenable(); + this.reenabled = true; + this.run(); + } + + runPrereqs() { + if (this.prereqs && this.prereqs.length) { + + if (this.concurrency > 1) { + async.eachLimit(this.prereqs, this.concurrency, + + (name, cb) => { + let parsed = parsePrereqName(name); + + let prereq = this.namespace.resolveTask(parsed.name) || + jake.attemptRule(name, this.namespace, 0) || + jake.createPlaceholderFileTask(name, this.namespace); + + if (!prereq) { + throw new Error('Unknown task "' + name + '"'); + } + + //Test for circular invocation + if(prereq === this) { + setImmediate(function () { + cb(new Error("Cannot use prereq " + prereq.name + " as a dependency of itself")); + }); + } + + if (prereq.taskStatus == Task.runStatuses.DONE) { + //prereq already done, return + setImmediate(cb); + } + else { + //wait for complete before calling cb + prereq.once('_done', () => { + prereq.removeAllListeners('_done'); + setImmediate(cb); + }); + // Start the prereq if we are the first to encounter it + if (prereq.taskStatus === Task.runStatuses.UNSTARTED) { + prereq.taskStatus = Task.runStatuses.STARTED; + prereq.invoke.apply(prereq, parsed.args); + } + } + }, + + (err) => { + //async callback is called after all prereqs have run. + if (err) { + throw err; + } + else { + setImmediate(this.run.bind(this)); + } + } + ); + } + else { + setImmediate(this.nextPrereq.bind(this)); + } + } + else { + setImmediate(this.run.bind(this)); + } + } + + nextPrereq() { + let self = this; + let index = this._currentPrereqIndex; + let name = this.prereqs[index]; + let prereq; + let parsed; + + if (name) { + + parsed = parsePrereqName(name); + + prereq = this.namespace.resolveTask(parsed.name) || + jake.attemptRule(name, this.namespace, 0) || + jake.createPlaceholderFileTask(name, this.namespace); + + if (!prereq) { + throw new Error('Unknown task "' + name + '"'); + } + + // Do when done + if (prereq.taskStatus == Task.runStatuses.DONE) { + self.handlePrereqDone(prereq); + } + else { + prereq.once('_done', () => { + this.handlePrereqDone(prereq); + prereq.removeAllListeners('_done'); + }); + if (prereq.taskStatus == Task.runStatuses.UNSTARTED) { + prereq.taskStatus = Task.runStatuses.STARTED; + prereq._invocationChain = this._invocationChain; + prereq.invoke.apply(prereq, parsed.args); + } + } + } + } + + /** + @name jake.Task#reenable + @function + @description Reenables a task so that it can be run again. + */ + reenable(deep) { + let prereqs; + let prereq; + this._skipped = false; + this.taskStatus = Task.runStatuses.UNSTARTED; + this.value = UNDEFINED_VALUE; + if (deep && this.prereqs) { + prereqs = this.prereqs; + for (let i = 0, ii = prereqs.length; i < ii; i++) { + prereq = jake.Task[prereqs[i]]; + if (prereq) { + prereq.reenable(deep); + } + } + } + } + + handlePrereqDone(prereq) { + this._currentPrereqIndex++; + if (this._currentPrereqIndex < this.prereqs.length) { + setImmediate(this.nextPrereq.bind(this)); + } + else { + setImmediate(this.run.bind(this)); + } + } + + isNeeded() { + let needed = true; + if (this.taskStatus == Task.runStatuses.DONE) { + needed = false; + } + return needed; + } + + run() { + let val, previous; + let hasAction = typeof this.action == 'function'; + + if (!this.isNeeded()) { + this.emit('skip'); + this.emit('_done'); + } + else { + if (this._invocationChain.length) { + previous = this._invocationChain[this._invocationChain.length - 1]; + // If this task is repeating and its previous is equal to this, don't check its status because it was set to UNSTARTED by the reenable() method + if (!(this.reenabled && previous == this)) { + if (previous.taskStatus != Task.runStatuses.DONE) { + let now = (new Date()).getTime(); + if (now - this.startTime > jake._taskTimeout) { + return jake.fail(`Timed out waiting for task: ${previous.name} with status of ${previous.taskStatus}`); + } + setTimeout(this.run.bind(this), POLLING_INTERVAL); + return; + } + } + } + if (!(this.reenabled && previous == this)) { + this._invocationChain.push(this); + } + + if (!(this._internal || jake.program.opts.quiet)) { + jake.emit('started', { + name: this.fullName, + task: this, + }); + console.log("Starting '" + chalk.green(this.fullName) + "'..."); + } + + this.startTime = (new Date()).getTime(); + this.emit('start'); + + jake.currentRunningTask = this; + + if (hasAction) { + try { + if (this.directory) { + process.chdir(this.directory); + } + + val = this.action.apply(this, this.args); + + if (typeof val == 'object' && typeof val.then == 'function') { + this.async = true; + + val.then( + (result) => { + setImmediate(() => { + this.complete(result); + }); + }, + (err) => { + setImmediate(() => { + this.errorOut(err); + }); + }); + } + } + catch (err) { + this.errorOut(err); + return; // Bail out, not complete + } + } + + if (!(hasAction && this.async)) { + setImmediate(() => { + this.complete(val); + }); + } + } + } + + errorOut(err) { + this.taskStatus = Task.runStatuses.ERROR; + this._invocationChain.chainStatus = Task.runStatuses.ERROR; + this.emit('error', err); + } + + complete(val) { + + if (Array.isArray(this._waitForChains)) { + let stillWaiting = this._waitForChains.some((chain) => { + return !(chain.chainStatus == Task.runStatuses.DONE || + chain.chainStatus == Task.runStatuses.ERROR); + }); + if (stillWaiting) { + let now = (new Date()).getTime(); + let elapsed = now - this.startTime; + if (elapsed > jake._taskTimeout) { + return jake.fail(`Timed out waiting for task: ${this.name} with status of ${this.taskStatus}. Elapsed: ${elapsed}`); + } + setTimeout(() => { + this.complete(val); + }, POLLING_INTERVAL); + return; + } + } + + jake._invocationChain.splice(jake._invocationChain.indexOf(this), 1); + + if (this._invocationChainRoot) { + this._invocationChain.chainStatus = Task.runStatuses.DONE; + } + + this._currentPrereqIndex = 0; + + // If 'complete' getting called because task has been + // run already, value will not be passed -- leave in place + if (!this._skipped) { + this.taskStatus = Task.runStatuses.DONE; + this.value = val; + + this.emit('complete', this.value); + this.emit('_done'); + + this.endTime = (new Date()).getTime(); + let taskTime = this.endTime - this.startTime; + + if (!(this._internal || jake.program.opts.quiet)) { + jake.emit('finished', { + name: this.fullName, + task: this, + time: taskTime, + }); + console.log("Finished '" + chalk.green(this.fullName) + "' after " + chalk.magenta(taskTime + ' ms')); + } + + } + } + + _getFullName() { + let ns = this.namespace; + let path = (ns && ns.path) || ''; + path = (path && path.split(':')) || []; + if (this.namespace !== jake.defaultNamespace) { + path.push(this.namespace.name); + } + path.push(this.name); + return path.join(':'); + } + + _getParams() { + if (!this.action) return ""; + let params = (new RegExp('(?:'+this.action.name+'\\s*|^)\\s*\\((.*?)\\)').exec(this.action.toString().replace(/\n/g, '')) || [''])[1].replace(/\/\*.*?\*\//g, '').replace(/ /g, ''); + return params; + } + + static getBaseNamespacePath(fullName) { + return fullName.split(':').slice(0, -1).join(':'); + } + + static getBaseTaskName(fullName) { + return fullName.split(':').pop(); + } +} + +Task.runStatuses = { + UNSTARTED: 'unstarted', + DONE: 'done', + STARTED: 'started', + ERROR: 'error' +}; + +Task.ROOT_TASK_NAME = ROOT_TASK_NAME; + +exports.Task = Task; + +// Required here because circular deps +require('../rule'); + diff --git a/node_modules/jake/lib/test_task.js b/node_modules/jake/lib/test_task.js new file mode 100644 index 0000000..6482bf1 --- /dev/null +++ b/node_modules/jake/lib/test_task.js @@ -0,0 +1,270 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +let path = require('path'); +let currDir = process.cwd(); + +/** + @name jake + @namespace jake +*/ +/** + @name jake.TestTask + @constructor + @description Instantiating a TestTask creates a number of Jake + Tasks that make running tests for your software easy. + + @param {String} name The name of the project + @param {Function} definition Defines the list of files containing the tests, + and the name of the namespace/task for running them. Will be executed on the + instantiated TestTask (i.e., 'this', will be the TestTask instance), to set + the various instance-propertiess. + + @example + let t = new jake.TestTask('bij-js', function () { + this.testName = 'testSpecial'; + this.testFiles.include('test/**'); + }); + + */ +let TestTask = function () { + let self = this; + let args = Array.prototype.slice.call(arguments); + let name = args.shift(); + let definition = args.pop(); + let prereqs = args.pop() || []; + + /** + @name jake.TestTask#testNam + @public + @type {String} + @description The name of the namespace to place the tests in, and + the top-level task for running tests. Defaults to "test" + */ + this.testName = 'test'; + + /** + @name jake.TestTask#testFiles + @public + @type {jake.FileList} + @description The list of files containing tests to load + */ + this.testFiles = new jake.FileList(); + + /** + @name jake.TestTask#showDescription + @public + @type {Boolean} + @description Show the created task when doing Jake -T + */ + this.showDescription = true; + + /* + @name jake.TestTask#totalTests + @public + @type {Number} + @description The total number of tests to run + */ + this.totalTests = 0; + + /* + @name jake.TestTask#executedTests + @public + @type {Number} + @description The number of tests successfully run + */ + this.executedTests = 0; + + if (typeof definition == 'function') { + definition.call(this); + } + + if (this.showDescription) { + desc('Run the tests for ' + name); + } + + task(this.testName, prereqs, {async: true}, function () { + let t = jake.Task[this.fullName + ':run']; + t.on('complete', function () { + complete(); + }); + // Pass args to the namespaced test + t.invoke.apply(t, arguments); + }); + + namespace(self.testName, function () { + + let runTask = task('run', {async: true}, function (pat) { + let re; + let testFiles; + + // Don't nest; make a top-level namespace. Don't want + // re-calling from inside to nest infinitely + jake.currentNamespace = jake.defaultNamespace; + + re = new RegExp(pat); + // Get test files that match the passed-in pattern + testFiles = self.testFiles.toArray() + .filter(function (f) { + return (re).test(f); + }) // Don't load the same file multiple times -- should this be in FileList? + .reduce(function (p, c) { + if (p.indexOf(c) < 0) { + p.push(c); + } + return p; + }, []); + + // Create a namespace for all the testing tasks to live in + namespace(self.testName + 'Exec', function () { + // Each test will be a prereq for the dummy top-level task + let prereqs = []; + // Continuation to pass to the async tests, wrapping `continune` + let next = function () { + complete(); + }; + // Create the task for this test-function + let createTask = function (name, action) { + // If the test-function is defined with a continuation + // param, flag the task as async + let t; + let isAsync = !!action.length; + + // Define the actual namespaced task with the name, the + // wrapped action, and the correc async-flag + t = task(name, createAction(name, action), { + async: isAsync + }); + t.once('complete', function () { + self.executedTests++; + }); + t._internal = true; + return t; + }; + // Used as the action for the defined task for each test. + let createAction = function (n, a) { + // A wrapped function that passes in the `next` function + // for any tasks that run asynchronously + return function () { + let cb; + if (a.length) { + cb = next; + } + if (!(n == 'before' || n == 'after' || + /_beforeEach$/.test(n) || /_afterEach$/.test(n))) { + jake.logger.log(n); + } + // 'this' will be the task when action is run + return a.call(this, cb); + }; + }; + // Dummy top-level task for everything to be prereqs for + let topLevel; + + // Pull in each test-file, and iterate over any exported + // test-functions. Register each test-function as a prereq task + testFiles.forEach(function (file) { + let exp = require(path.join(currDir, file)); + + // Create a namespace for each filename, so test-name collisions + // won't be a problem + namespace(file, function () { + let testPrefix = self.testName + 'Exec:' + file + ':'; + let testName; + // Dummy task for displaying file banner + testName = '*** Running ' + file + ' ***'; + prereqs.push(testPrefix + testName); + createTask(testName, function () {}); + + // 'before' setup + if (typeof exp.before == 'function') { + prereqs.push(testPrefix + 'before'); + // Create the task + createTask('before', exp.before); + } + + // Walk each exported function, and create a task for each + for (let p in exp) { + if (p == 'before' || p == 'after' || + p == 'beforeEach' || p == 'afterEach') { + continue; + } + + if (typeof exp.beforeEach == 'function') { + prereqs.push(testPrefix + p + '_beforeEach'); + // Create the task + createTask(p + '_beforeEach', exp.beforeEach); + } + + // Add the namespace:name of this test to the list of prereqs + // for the dummy top-level task + prereqs.push(testPrefix + p); + // Create the task + createTask(p, exp[p]); + + if (typeof exp.afterEach == 'function') { + prereqs.push(testPrefix + p + '_afterEach'); + // Create the task + createTask(p + '_afterEach', exp.afterEach); + } + } + + // 'after' teardown + if (typeof exp.after == 'function') { + prereqs.push(testPrefix + 'after'); + // Create the task + let afterTask = createTask('after', exp.after); + afterTask._internal = true; + } + + }); + }); + + self.totalTests = prereqs.length; + process.on('exit', function () { + // Throw in the case where the process exits without + // finishing tests, but no error was thrown + if (!jake.errorCode && (self.totalTests > self.executedTests)) { + throw new Error('Process exited without all tests completing.'); + } + }); + + // Create the dummy top-level task. When calling a task internally + // with `invoke` that is async (or has async prereqs), have to listen + // for the 'complete' event to know when it's done + topLevel = task('__top__', prereqs); + topLevel._internal = true; + topLevel.addListener('complete', function () { + jake.logger.log('All tests ran successfully'); + complete(); + }); + + topLevel.invoke(); // Do the thing! + }); + + }); + runTask._internal = true; + + }); + + +}; + +jake.TestTask = TestTask; +exports.TestTask = TestTask; + diff --git a/node_modules/jake/lib/utils/file.js b/node_modules/jake/lib/utils/file.js new file mode 100644 index 0000000..d7163f3 --- /dev/null +++ b/node_modules/jake/lib/utils/file.js @@ -0,0 +1,286 @@ +/* + * Utilities: A classic collection of JavaScript utilities + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +let fs = require('fs'); +let path = require('path'); + +/** + @name file + @namespace file +*/ + +let fileUtils = new (function () { + + // Recursively copy files and directories + let _copyFile = function (fromPath, toPath, opts) { + let from = path.normalize(fromPath); + let to = path.normalize(toPath); + let options = opts || {}; + let fromStat; + let toStat; + let destExists; + let destDoesNotExistErr; + let content; + let filename; + let dirContents; + let targetDir; + + fromStat = fs.statSync(from); + + try { + //console.dir(to + ' destExists'); + toStat = fs.statSync(to); + destExists = true; + } + catch(e) { + //console.dir(to + ' does not exist'); + destDoesNotExistErr = e; + destExists = false; + } + // Destination dir or file exists, copy into (directory) + // or overwrite (file) + if (destExists) { + + // If there's a rename-via-copy file/dir name passed, use it. + // Otherwise use the actual file/dir name + filename = options.rename || path.basename(from); + + // Copying a directory + if (fromStat.isDirectory()) { + dirContents = fs.readdirSync(from); + targetDir = path.join(to, filename); + // We don't care if the target dir already exists + try { + fs.mkdirSync(targetDir, {mode: fromStat.mode & 0o777}); + } + catch(e) { + if (e.code !== 'EEXIST') { + throw e; + } + } + for (let i = 0, ii = dirContents.length; i < ii; i++) { + _copyFile(path.join(from, dirContents[i]), targetDir, {preserveMode: options.preserveMode}); + } + } + // Copying a file + else { + content = fs.readFileSync(from); + let mode = fromStat.mode & 0o777; + let targetFile = to; + + if (toStat.isDirectory()) { + targetFile = path.join(to, filename); + } + + let fileExists = fs.existsSync(targetFile); + fs.writeFileSync(targetFile, content); + + // If the file didn't already exist, use the original file mode. + // Otherwise, only update the mode if preserverMode is true. + if(!fileExists || options.preserveMode) { + fs.chmodSync(targetFile, mode); + } + } + } + // Dest doesn't exist, can't create it + else { + throw destDoesNotExistErr; + } + }; + + // Remove the given directory + let _rmDir = function (dirPath) { + let dir = path.normalize(dirPath); + let paths = []; + paths = fs.readdirSync(dir); + paths.forEach(function (p) { + let curr = path.join(dir, p); + let stat = fs.lstatSync(curr); + if (stat.isDirectory()) { + _rmDir(curr); + } + else { + try { + fs.unlinkSync(curr); + } catch(e) { + if (e.code === 'EPERM') { + fs.chmodSync(curr, parseInt(666, 8)); + fs.unlinkSync(curr); + } else { + throw e; + } + } + } + }); + fs.rmdirSync(dir); + }; + + /** + @name file#cpR + @public + @function + @description Copies a directory/file to a destination + @param {String} fromPath The source path to copy from + @param {String} toPath The destination path to copy to + @param {Object} opts Options to use + @param {Boolean} [opts.preserveMode] If target file already exists, this + determines whether the original file's mode is copied over. The default of + false mimics the behavior of the `cp` command line tool. (Default: false) + */ + this.cpR = function (fromPath, toPath, options) { + let from = path.normalize(fromPath); + let to = path.normalize(toPath); + let toStat; + let doesNotExistErr; + let filename; + let opts = options || {}; + + if (from == to) { + throw new Error('Cannot copy ' + from + ' to itself.'); + } + + // Handle rename-via-copy + try { + toStat = fs.statSync(to); + } + catch(e) { + doesNotExistErr = e; + + // Get abs path so it's possible to check parent dir + if (!this.isAbsolute(to)) { + to = path.join(process.cwd(), to); + } + + // Save the file/dir name + filename = path.basename(to); + // See if a parent dir exists, so there's a place to put the + /// renamed file/dir (resets the destination for the copy) + to = path.dirname(to); + try { + toStat = fs.statSync(to); + } + catch(e) {} + if (toStat && toStat.isDirectory()) { + // Set the rename opt to pass to the copy func, will be used + // as the new file/dir name + opts.rename = filename; + //console.log('filename ' + filename); + } + else { + throw doesNotExistErr; + } + } + + _copyFile(from, to, opts); + }; + + /** + @name file#mkdirP + @public + @function + @description Create the given directory(ies) using the given mode permissions + @param {String} dir The directory to create + @param {Number} mode The mode to give the created directory(ies)(Default: 0755) + */ + this.mkdirP = function (dir, mode) { + let dirPath = path.normalize(dir); + let paths = dirPath.split(/\/|\\/); + let currPath = ''; + let next; + + if (paths[0] == '' || /^[A-Za-z]+:/.test(paths[0])) { + currPath = paths.shift() || '/'; + currPath = path.join(currPath, paths.shift()); + //console.log('basedir'); + } + while ((next = paths.shift())) { + if (next == '..') { + currPath = path.join(currPath, next); + continue; + } + currPath = path.join(currPath, next); + try { + //console.log('making ' + currPath); + fs.mkdirSync(currPath, mode || parseInt(755, 8)); + } + catch(e) { + if (e.code != 'EEXIST') { + throw e; + } + } + } + }; + + /** + @name file#rmRf + @public + @function + @description Deletes the given directory/file + @param {String} p The path to delete, can be a directory or file + */ + this.rmRf = function (p, options) { + let stat; + try { + stat = fs.lstatSync(p); + if (stat.isDirectory()) { + _rmDir(p); + } + else { + fs.unlinkSync(p); + } + } + catch (e) {} + }; + + /** + @name file#isAbsolute + @public + @function + @return {Boolean/String} If it's absolute the first character is returned otherwise false + @description Checks if a given path is absolute or relative + @param {String} p Path to check + */ + this.isAbsolute = function (p) { + let match = /^[A-Za-z]+:\\|^\//.exec(p); + if (match && match.length) { + return match[0]; + } + return false; + }; + + /** + @name file#absolutize + @public + @function + @return {String} Returns the absolute path for the given path + @description Returns the absolute path for the given path + @param {String} p The path to get the absolute path for + */ + this.absolutize = function (p) { + if (this.isAbsolute(p)) { + return p; + } + else { + return path.join(process.cwd(), p); + } + }; + +})(); + +module.exports = fileUtils; + diff --git a/node_modules/jake/lib/utils/index.js b/node_modules/jake/lib/utils/index.js new file mode 100644 index 0000000..17d686b --- /dev/null +++ b/node_modules/jake/lib/utils/index.js @@ -0,0 +1,297 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + + +let util = require('util'); // Native Node util module +let spawn = require('child_process').spawn; +let EventEmitter = require('events').EventEmitter; +let logger = require('./logger'); +let file = require('./file'); +let Exec; + +const _UUID_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); + +let parseArgs = function (argumentsObj) { + let args; + let arg; + let cmds; + let callback; + let opts = { + interactive: false, + printStdout: false, + printStderr: false, + breakOnError: true + }; + + args = Array.prototype.slice.call(argumentsObj); + + cmds = args.shift(); + // Arrayize if passed a single string command + if (typeof cmds == 'string') { + cmds = [cmds]; + } + // Make a copy if it's an actual list + else { + cmds = cmds.slice(); + } + + // Get optional callback or opts + while((arg = args.shift())) { + if (typeof arg == 'function') { + callback = arg; + } + else if (typeof arg == 'object') { + opts = Object.assign(opts, arg); + } + } + + // Backward-compat shim + if (typeof opts.stdout != 'undefined') { + opts.printStdout = opts.stdout; + delete opts.stdout; + } + if (typeof opts.stderr != 'undefined') { + opts.printStderr = opts.stderr; + delete opts.stderr; + } + + return { + cmds: cmds, + opts: opts, + callback: callback + }; +}; + +/** + @name jake + @namespace jake +*/ +let utils = new (function () { + /** + @name jake.exec + @static + @function + @description Executes shell-commands asynchronously with an optional + final callback. + ` + @param {String[]} cmds The list of shell-commands to execute + @param {Object} [opts] + @param {Boolean} [opts.printStdout=false] Print stdout from each command + @param {Boolean} [opts.printStderr=false] Print stderr from each command + @param {Boolean} [opts.breakOnError=true] Stop further execution on + the first error. + @param {Boolean} [opts.windowsVerbatimArguments=false] Don't translate + arguments on Windows. + @param {Function} [callback] Callback to run after executing the + commands + + @example + let cmds = [ + 'echo "showing directories"' + , 'ls -al | grep ^d' + , 'echo "moving up a directory"' + , 'cd ../' + ] + , callback = function () { + console.log('Finished running commands.'); + } + jake.exec(cmds, {stdout: true}, callback); + */ + this.exec = function (a, b, c) { + let parsed = parseArgs(arguments); + let cmds = parsed.cmds; + let opts = parsed.opts; + let callback = parsed.callback; + + let ex = new Exec(cmds, opts, callback); + + ex.addListener('error', function (msg, code) { + if (opts.breakOnError) { + fail(msg, code); + } + }); + ex.run(); + + return ex; + }; + + this.createExec = function (a, b, c) { + return new Exec(a, b, c); + }; + + // From Math.uuid.js, https://github.com/broofa/node-uuid + // Robert Kieffer (robert@broofa.com), MIT license + this.uuid = function (length, radix) { + var chars = _UUID_CHARS + , uuid = [] + , r + , i; + + radix = radix || chars.length; + + if (length) { + // Compact form + i = -1; + while (++i < length) { + uuid[i] = chars[0 | Math.random()*radix]; + } + } else { + // rfc4122, version 4 form + + // rfc4122 requires these characters + uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; + uuid[14] = '4'; + + // Fill in random data. At i==19 set the high bits of clock sequence as + // per rfc4122, sec. 4.1.5 + i = -1; + while (++i < 36) { + if (!uuid[i]) { + r = 0 | Math.random()*16; + uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]; + } + } + } + + return uuid.join(''); + }; + +})(); + +Exec = function () { + let parsed = parseArgs(arguments); + let cmds = parsed.cmds; + let opts = parsed.opts; + let callback = parsed.callback; + + this._cmds = cmds; + this._callback = callback; + this._config = opts; +}; + +util.inherits(Exec, EventEmitter); + +Object.assign(Exec.prototype, new (function () { + + let _run = function () { + let self = this; + let sh; + let cmd; + let args; + let next = this._cmds.shift(); + let config = this._config; + let errData = ''; + let shStdio; + let handleStdoutData = function (data) { + self.emit('stdout', data); + }; + let handleStderrData = function (data) { + let d = data.toString(); + self.emit('stderr', data); + // Accumulate the error-data so we can use it as the + // stack if the process exits with an error + errData += d; + }; + + // Keep running as long as there are commands in the array + if (next) { + let spawnOpts = {}; + this.emit('cmdStart', next); + + // Ganking part of Node's child_process.exec to get cmdline args parsed + if (process.platform == 'win32') { + cmd = 'cmd'; + args = ['/c', next]; + if (config.windowsVerbatimArguments) { + spawnOpts.windowsVerbatimArguments = true; + } + } + else { + cmd = '/bin/sh'; + args = ['-c', next]; + } + + if (config.interactive) { + spawnOpts.stdio = 'inherit'; + sh = spawn(cmd, args, spawnOpts); + } + else { + shStdio = [ + process.stdin + ]; + if (config.printStdout) { + shStdio.push(process.stdout); + } + else { + shStdio.push('pipe'); + } + if (config.printStderr) { + shStdio.push(process.stderr); + } + else { + shStdio.push('pipe'); + } + spawnOpts.stdio = shStdio; + sh = spawn(cmd, args, spawnOpts); + if (!config.printStdout) { + sh.stdout.addListener('data', handleStdoutData); + } + if (!config.printStderr) { + sh.stderr.addListener('data', handleStderrData); + } + } + + // Exit, handle err or run next + sh.on('exit', function (code) { + let msg; + if (code !== 0) { + msg = errData || 'Process exited with error.'; + msg = msg.trim(); + self.emit('error', msg, code); + } + if (code === 0 || !config.breakOnError) { + self.emit('cmdEnd', next); + setTimeout(function () { _run.call(self); }, 0); + } + }); + + } + else { + self.emit('end'); + if (typeof self._callback == 'function') { + self._callback(); + } + } + }; + + this.append = function (cmd) { + this._cmds.push(cmd); + }; + + this.run = function () { + _run.call(this); + }; + +})()); + +utils.Exec = Exec; +utils.file = file; +utils.logger = logger; + +module.exports = utils; + diff --git a/node_modules/jake/lib/utils/logger.js b/node_modules/jake/lib/utils/logger.js new file mode 100644 index 0000000..8f72686 --- /dev/null +++ b/node_modules/jake/lib/utils/logger.js @@ -0,0 +1,24 @@ +let util = require('util'); + +let logger = new (function () { + let _output = function (type, out) { + let quiet = typeof jake != 'undefined' && jake.program && + jake.program.opts && jake.program.opts.quiet; + let msg; + if (!quiet) { + msg = typeof out == 'string' ? out : util.inspect(out); + console[type](msg); + } + }; + + this.log = function (out) { + _output('log', out); + }; + + this.error = function (out) { + _output('error', out); + }; + +})(); + +module.exports = logger; diff --git a/node_modules/jake/package.json b/node_modules/jake/package.json new file mode 100644 index 0000000..b1d98e6 --- /dev/null +++ b/node_modules/jake/package.json @@ -0,0 +1,42 @@ +{ + "name": "jake", + "description": "JavaScript build tool, similar to Make or Rake", + "keywords": [ + "build", + "cli", + "make", + "rake" + ], + "version": "10.9.1", + "author": "Matthew Eernisse (http://fleegix.org)", + "license": "Apache-2.0", + "bin": { + "jake": "./bin/cli.js" + }, + "main": "./lib/jake.js", + "scripts": { + "lint": "eslint --format codeframe \"lib/**/*.js\" \"test/**/*.js\"", + "lint:fix": "eslint --fix \"lib/**/*.js\" \"test/**/*.js\"", + "test": "./bin/cli.js test", + "test:ci": "npm run lint && npm run test" + }, + "repository": { + "type": "git", + "url": "git://github.com/jakejs/jake.git" + }, + "preferGlobal": true, + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "devDependencies": { + "eslint": "^6.8.0", + "mocha": "^10.2.0", + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } +} diff --git a/node_modules/jake/test/integration/concurrent.js b/node_modules/jake/test/integration/concurrent.js new file mode 100644 index 0000000..ab649b9 --- /dev/null +++ b/node_modules/jake/test/integration/concurrent.js @@ -0,0 +1,45 @@ +let assert = require('assert'); +let exec = require('child_process').execSync; + +const PROJECT_DIR = process.env.PROJECT_DIR; +const JAKE_CMD = `${PROJECT_DIR}/bin/cli.js`; + +suite('concurrent', function () { + + this.timeout(7000); + + test(' simple concurrent prerequisites 1', function () { + let out = exec(`${JAKE_CMD} -q concurrent:simple1`).toString().trim(); + assert.equal('Started A\nStarted B\nFinished B\nFinished A', out); + }); + + test(' simple concurrent prerequisites 2', function () { + let out = exec(`${JAKE_CMD} -q concurrent:simple2`).toString().trim(); + assert.equal('Started C\nStarted D\nFinished C\nFinished D', out); + }); + + test(' sequential concurrent prerequisites', function () { + let out = exec(`${JAKE_CMD} -q concurrent:seqconcurrent`).toString().trim(); + assert.equal('Started A\nStarted B\nFinished B\nFinished A\nStarted C\nStarted D\nFinished C\nFinished D', out); + }); + + test(' concurrent concurrent prerequisites', function () { + let out = exec(`${JAKE_CMD} -q concurrent:concurrentconcurrent`).toString().trim(); + assert.equal('Started A\nStarted B\nStarted C\nStarted D\nFinished B\nFinished C\nFinished A\nFinished D', out); + }); + + test(' concurrent prerequisites with subdependency', function () { + let out = exec(`${JAKE_CMD} -q concurrent:subdep`).toString().trim(); + assert.equal('Started A\nFinished A\nStarted Ba\nFinished Ba', out); + }); + + test(' failing in concurrent prerequisites', function () { + try { + exec(`${JAKE_CMD} -q concurrent:Cfail`); + } + catch(err) { + assert(err.message.indexOf('Command failed') > -1); + } + }); + +}); diff --git a/node_modules/jake/test/integration/file.js b/node_modules/jake/test/integration/file.js new file mode 100644 index 0000000..97ed0d6 --- /dev/null +++ b/node_modules/jake/test/integration/file.js @@ -0,0 +1,228 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +const PROJECT_DIR = process.env.PROJECT_DIR; + +let assert = require('assert'); +let fs = require('fs'); +let path = require('path'); +let file = require(`${PROJECT_DIR}/lib/utils/file`); +let existsSync = fs.existsSync || path.existsSync; +let exec = require('child_process').execSync; + +suite('fileUtils', function () { + + test('mkdirP', function () { + let expected = [ + ['foo'], + ['foo', 'bar'], + ['foo', 'bar', 'baz'], + ['foo', 'bar', 'baz', 'qux'] + ]; + file.mkdirP('foo/bar/baz/qux'); + let res = exec('find foo').toString().trim().split('\n'); + for (let i = 0, ii = res.length; i < ii; i++) { + assert.equal(path.join.apply(path, expected[i]), res[i]); + } + file.rmRf('foo'); + }); + + test('rmRf', function () { + file.mkdirP('foo/bar/baz/qux'); + file.rmRf('foo/bar'); + let res = exec('find foo').toString().trim().split('\n'); + assert.equal(1, res.length); + assert.equal('foo', res[0]); + fs.rmdirSync('foo'); + }); + + test('rmRf with symlink subdir', function () { + file.mkdirP('foo'); + file.mkdirP('bar'); + fs.writeFileSync('foo/hello.txt', 'hello, it\'s me'); + fs.symlinkSync('../foo', 'bar/foo'); file.rmRf('bar'); + + // Make sure the bar directory was successfully deleted + let barDeleted = false; + try { + fs.statSync('bar'); + } catch(err) { + if(err.code == 'ENOENT') { + barDeleted = true; + } + } + assert.equal(true, barDeleted); + + // Make sure that the file inside the linked folder wasn't deleted + let res = fs.readdirSync('foo'); + assert.equal(1, res.length); + assert.equal('hello.txt', res[0]); + + // Cleanup + fs.unlinkSync('foo/hello.txt'); + fs.rmdirSync('foo'); + }); + + test('rmRf with symlinked dir', function () { + file.mkdirP('foo'); + fs.writeFileSync('foo/hello.txt', 'hello!'); + fs.symlinkSync('foo', 'bar'); + file.rmRf('bar'); + + // Make sure the bar directory was successfully deleted + let barDeleted = false; + try { + fs.statSync('bar'); + } catch(err) { + if(err.code == 'ENOENT') { + barDeleted = true; + } + } + assert.equal(true, barDeleted); + + // Make sure that the file inside the linked folder wasn't deleted + let res = fs.readdirSync('foo'); + assert.equal(1, res.length); + assert.equal('hello.txt', res[0]); + + // Cleanup + fs.unlinkSync('foo/hello.txt'); + fs.rmdirSync('foo'); + }); + + test('cpR with same name and different directory', function () { + file.mkdirP('foo'); + fs.writeFileSync('foo/bar.txt', 'w00t'); + file.cpR('foo', 'bar'); + assert.ok(existsSync('bar/bar.txt')); + file.rmRf('foo'); + file.rmRf('bar'); + }); + + test('cpR with same to and from will throw', function () { + assert.throws(function () { + file.cpR('foo.txt', 'foo.txt'); + }); + }); + + test('cpR rename via copy in directory', function () { + file.mkdirP('foo'); + fs.writeFileSync('foo/bar.txt', 'w00t'); + file.cpR('foo/bar.txt', 'foo/baz.txt'); + assert.ok(existsSync('foo/baz.txt')); + file.rmRf('foo'); + }); + + test('cpR rename via copy in base', function () { + fs.writeFileSync('bar.txt', 'w00t'); + file.cpR('bar.txt', 'baz.txt'); + assert.ok(existsSync('baz.txt')); + file.rmRf('bar.txt'); + file.rmRf('baz.txt'); + }); + + test('cpR keeps file mode', function () { + fs.writeFileSync('bar.txt', 'w00t', {mode: 0o750}); + fs.writeFileSync('bar1.txt', 'w00t!', {mode: 0o744}); + file.cpR('bar.txt', 'baz.txt'); + file.cpR('bar1.txt', 'baz1.txt'); + + assert.ok(existsSync('baz.txt')); + assert.ok(existsSync('baz1.txt')); + let bazStat = fs.statSync('baz.txt'); + let bazStat1 = fs.statSync('baz1.txt'); + assert.equal(0o750, bazStat.mode & 0o7777); + assert.equal(0o744, bazStat1.mode & 0o7777); + + file.rmRf('bar.txt'); + file.rmRf('baz.txt'); + file.rmRf('bar1.txt'); + file.rmRf('baz1.txt'); + }); + + test('cpR keeps file mode when overwriting with preserveMode', function () { + fs.writeFileSync('bar.txt', 'w00t', {mode: 0o755}); + fs.writeFileSync('baz.txt', 'w00t!', {mode: 0o744}); + file.cpR('bar.txt', 'baz.txt', {silent: true, preserveMode: true}); + + assert.ok(existsSync('baz.txt')); + let bazStat = fs.statSync('baz.txt'); + assert.equal(0o755, bazStat.mode & 0o777); + + file.rmRf('bar.txt'); + file.rmRf('baz.txt'); + }); + + test('cpR does not keep file mode when overwriting', function () { + fs.writeFileSync('bar.txt', 'w00t', {mode: 0o766}); + fs.writeFileSync('baz.txt', 'w00t!', {mode: 0o744}); + file.cpR('bar.txt', 'baz.txt'); + + assert.ok(existsSync('baz.txt')); + let bazStat = fs.statSync('baz.txt'); + assert.equal(0o744, bazStat.mode & 0o777); + + file.rmRf('bar.txt'); + file.rmRf('baz.txt'); + }); + + test('cpR copies file mode recursively', function () { + fs.mkdirSync('foo'); + fs.writeFileSync('foo/bar.txt', 'w00t', {mode: 0o740}); + file.cpR('foo', 'baz'); + + assert.ok(existsSync('baz')); + let barStat = fs.statSync('baz/bar.txt'); + assert.equal(0o740, barStat.mode & 0o777); + + file.rmRf('foo'); + file.rmRf('baz'); + }); + + test('cpR keeps file mode recursively', function () { + fs.mkdirSync('foo'); + fs.writeFileSync('foo/bar.txt', 'w00t', {mode: 0o740}); + fs.mkdirSync('baz'); + fs.mkdirSync('baz/foo'); + fs.writeFileSync('baz/foo/bar.txt', 'w00t!', {mode: 0o755}); + file.cpR('foo', 'baz', {silent: true, preserveMode: true}); + + assert.ok(existsSync('baz')); + let barStat = fs.statSync('baz/foo/bar.txt'); + assert.equal(0o740, barStat.mode & 0o777); + + file.rmRf('foo'); + file.rmRf('baz'); + }); + + test('cpR copies directory mode recursively', function () { + fs.mkdirSync('foo', 0o755); + fs.mkdirSync('foo/bar', 0o700); + file.cpR('foo', 'bar'); + + assert.ok(existsSync('foo')); + let fooBarStat = fs.statSync('bar/bar'); + assert.equal(0o700, fooBarStat.mode & 0o777); + + file.rmRf('foo'); + file.rmRf('bar'); + }); + +}); + + diff --git a/node_modules/jake/test/integration/file_task.js b/node_modules/jake/test/integration/file_task.js new file mode 100644 index 0000000..4b5608e --- /dev/null +++ b/node_modules/jake/test/integration/file_task.js @@ -0,0 +1,141 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +const PROJECT_DIR = process.env.PROJECT_DIR; +const JAKE_CMD = `${PROJECT_DIR}/bin/cli.js`; + +let assert = require('assert'); +let fs = require('fs'); +let exec = require('child_process').execSync; +let { rmRf } = require(`${PROJECT_DIR}/lib/jake`); + +let cleanUpAndNext = function (callback) { + rmRf('./foo', { + silent: true + }); + callback && callback(); +}; + +suite('fileTask', function () { + this.timeout(7000); + + setup(function () { + cleanUpAndNext(); + }); + + test('where a file-task prereq does not change with --always-make', function () { + let out; + out = exec(`${JAKE_CMD} -q fileTest:foo/from-src1.txt`).toString().trim(); + assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task', + out); + out = exec(`${JAKE_CMD} -q -B fileTest:foo/from-src1.txt`).toString().trim(); + assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task', + out); + cleanUpAndNext(); + }); + + test('concating two files', function () { + let out; + out = exec(`${JAKE_CMD} -q fileTest:foo/concat.txt`).toString().trim(); + assert.equal('fileTest:foo/src1.txt task\ndefault task\nfileTest:foo/src2.txt task\n' + + 'fileTest:foo/concat.txt task', out); + // Check to see the two files got concat'd + let data = fs.readFileSync(process.cwd() + '/foo/concat.txt'); + assert.equal('src1src2', data.toString()); + cleanUpAndNext(); + }); + + test('where a file-task prereq does not change', function () { + let out; + out = exec(`${JAKE_CMD} -q fileTest:foo/from-src1.txt`).toString().trim(); + assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task', out); + out = exec(`${JAKE_CMD} -q fileTest:foo/from-src1.txt`).toString().trim(); + // Second time should be a no-op + assert.equal('', out); + cleanUpAndNext(); + }); + + test('where a file-task prereq does change, then does not', function (next) { + exec('mkdir -p ./foo'); + exec('touch ./foo/from-src1.txt'); + setTimeout(() => { + fs.writeFileSync('./foo/src1.txt', '-SRC'); + // Task should run the first time + let out; + out = exec(`${JAKE_CMD} -q fileTest:foo/from-src1.txt`).toString().trim(); + assert.equal('fileTest:foo/from-src1.txt task', out); + // Task should not run on subsequent invocation + out = exec(`${JAKE_CMD} -q fileTest:foo/from-src1.txt`).toString().trim(); + assert.equal('', out); + cleanUpAndNext(next); + }, 1000); + }); + + test('a preexisting file', function () { + let prereqData = 'howdy'; + exec('mkdir -p ./foo'); + fs.writeFileSync('foo/prereq.txt', prereqData); + let out; + out = exec(`${JAKE_CMD} -q fileTest:foo/from-prereq.txt`).toString().trim(); + assert.equal('fileTest:foo/from-prereq.txt task', out); + let data = fs.readFileSync(process.cwd() + '/foo/from-prereq.txt'); + assert.equal(prereqData, data.toString()); + out = exec(`${JAKE_CMD} -q fileTest:foo/from-prereq.txt`).toString().trim(); + // Second time should be a no-op + assert.equal('', out); + cleanUpAndNext(); + }); + + test('a preexisting file with --always-make flag', function () { + let prereqData = 'howdy'; + exec('mkdir -p ./foo'); + fs.writeFileSync('foo/prereq.txt', prereqData); + let out; + out = exec(`${JAKE_CMD} -q fileTest:foo/from-prereq.txt`).toString().trim(); + assert.equal('fileTest:foo/from-prereq.txt task', out); + let data = fs.readFileSync(process.cwd() + '/foo/from-prereq.txt'); + assert.equal(prereqData, data.toString()); + out = exec(`${JAKE_CMD} -q -B fileTest:foo/from-prereq.txt`).toString().trim(); + assert.equal('fileTest:foo/from-prereq.txt task', out); + cleanUpAndNext(); + }); + + test('nested directory-task', function () { + exec(`${JAKE_CMD} -q fileTest:foo/bar/baz/bamf.txt`); + let data = fs.readFileSync(process.cwd() + '/foo/bar/baz/bamf.txt'); + assert.equal('w00t', data); + cleanUpAndNext(); + }); + + test('partially existing prereqs', function () { + /* + dependency graph: + /-- foo/output2a.txt --\ + foo -- foo/output1.txt --+ +-- output3.txt + \-- foo/output2b.txt --/ + */ + // build part of the prereqs + exec(`${JAKE_CMD} -q fileTest:foo/output2a.txt`); + // verify the final target gets built + exec(`${JAKE_CMD} -q fileTest:foo/output3.txt`); + let data = fs.readFileSync(process.cwd() + '/foo/output3.txt'); + assert.equal('w00t', data); + cleanUpAndNext(); + }); +}); + diff --git a/node_modules/jake/test/integration/helpers.js b/node_modules/jake/test/integration/helpers.js new file mode 100644 index 0000000..9caaa4e --- /dev/null +++ b/node_modules/jake/test/integration/helpers.js @@ -0,0 +1,80 @@ +var exec = require('child_process').exec; + +var helpers = new (function () { + var _tests; + var _names = []; + var _name; + var _callback; + var _runner = function () { + if ((_name = _names.shift())) { + console.log('Running ' + _name); + _tests[_name](); + } + else { + _callback(); + } + }; + + this.exec = function () { + var args = Array.prototype.slice.call(arguments); + var arg; + var cmd = args.shift(); + var opts = {}; + var callback; + // Optional opts/callback or callback/opts + while ((arg = args.shift())) { + if (typeof arg == 'function') { + callback = arg; + } + else { + opts = arg; + } + } + + cmd += ' --trace'; + var execOpts = opts.execOpts ? opts.execOpts : {}; + exec(cmd, execOpts, function (err, stdout, stderr) { + var out = helpers.trim(stdout); + if (err) { + if (opts.breakOnError === false) { + return callback(err); + } + else { + throw err; + } + } + if (stderr) { + callback(stderr); + } + else { + callback(out); + } + }); + }; + + this.trim = function (s) { + var str = s || ''; + return str.replace(/^\s*|\s*$/g, ''); + }; + + this.parse = function (s) { + var str = s || ''; + str = helpers.trim(str); + str = str.replace(/'/g, '"'); + return JSON.parse(str); + }; + + this.run = function (tests, callback) { + _tests = tests; + _names = Object.keys(tests); + _callback = callback; + _runner(); + }; + + this.next = function () { + _runner(); + }; + +})(); + +module.exports = helpers; diff --git a/node_modules/jake/test/integration/jakefile.js b/node_modules/jake/test/integration/jakefile.js new file mode 100644 index 0000000..9d57d0a --- /dev/null +++ b/node_modules/jake/test/integration/jakefile.js @@ -0,0 +1,352 @@ +let fs = require('fs'); +let Q = require('q'); + +desc('The default t.'); +task('default', function () { + console.log('default task'); +}); + +desc('No action.'); +task({'noAction': ['default']}); + +desc('No action, no prereqs.'); +task('noActionNoPrereqs'); + +desc('Top-level zerbofrangazoomy task'); +task('zerbofrangazoomy', function () { + console.log('Whaaaaaaaa? Ran the zerbofrangazoomy task!'); +}); + +desc('Task that throws'); +task('throwy', function () { + let errorListener = function (err) { + console.log('Emitted'); + console.log(err.toString()); + + jake.removeListener('error', errorListener); + }; + + jake.on('error', errorListener); + + throw new Error('I am bad'); +}); + +desc('Task that rejects a Promise'); +task('promiseRejecter', function () { + const originalOption = jake.program.opts['allow-rejection']; + + const errorListener = function (err) { + console.log(err.toString()); + jake.removeListener('error', errorListener); + jake.program.opts['allow-rejection'] = originalOption; // Restore original 'allow-rejection' option + }; + jake.on('error', errorListener); + + jake.program.opts['allow-rejection'] = false; // Do not allow rejection so the rejection is passed to error handlers + + Promise.reject(''); +}); + +desc('Accepts args and env vars.'); +task('argsEnvVars', function () { + let res = { + args: arguments + , env: { + foo: process.env.foo + , baz: process.env.baz + } + }; + console.log(JSON.stringify(res)); +}); + +namespace('foo', function () { + desc('The foo:bar t.'); + task('bar', function () { + if (arguments.length) { + console.log('foo:bar[' + + Array.prototype.join.call(arguments, ',') + + '] task'); + } + else { + console.log('foo:bar task'); + } + }); + + desc('The foo:baz task, calls foo:bar as a prerequisite.'); + task('baz', ['foo:bar'], function () { + console.log('foo:baz task'); + }); + + desc('The foo:qux task, calls foo:bar with cmdline args as a prerequisite.'); + task('qux', ['foo:bar[asdf,qwer]'], function () { + console.log('foo:qux task'); + }); + + desc('The foo:frang task,`invokes` foo:bar with passed args as a prerequisite.'); + task('frang', function () { + let t = jake.Task['foo:bar']; + // Do args pass-through + t.invoke.apply(t, arguments); + t.on('complete', () => { + console.log('foo:frang task'); + }); + }); + + desc('The foo:zerb task, `executes` foo:bar with passed args as a prerequisite.'); + task('zerb', function () { + let t = jake.Task['foo:bar']; + // Do args pass-through + t.execute.apply(t, arguments); + t.on('complete', () => { + console.log('foo:zerb task'); + }); + }); + + desc('The foo:zoobie task, has no prerequisites.'); + task('zoobie', function () { + console.log('foo:zoobie task'); + }); + + desc('The foo:voom task, run the foo:zoobie task repeatedly.'); + task('voom', function () { + let t = jake.Task['foo:bar']; + t.on('complete', function () { + console.log('complete'); + }); + t.execute.apply(t); + t.execute.apply(t); + }); + + desc('The foo:asdf task, has the same prereq twice.'); + task('asdf', ['foo:bar', 'foo:baz'], function () { + console.log('foo:asdf task'); + }); + +}); + +namespace('bar', function () { + desc('The bar:foo task, has no prerequisites, is async, returns Promise which resolves.'); + task('foo', async function () { + return new Promise((resolve, reject) => { + console.log('bar:foo task'); + resolve(); + }); + }); + + desc('The bar:promise task has no prerequisites, is async, returns Q-based promise.'); + task('promise', function () { + return Q() + .then(function () { + console.log('bar:promise task'); + return 123654; + }); + }); + + desc('The bar:dependOnpromise task waits for a promise based async test'); + task('dependOnpromise', ['promise'], function () { + console.log('bar:dependOnpromise task saw value', jake.Task["bar:promise"].value); + }); + + desc('The bar:brokenPromise task is a failing Q-promise based async task.'); + task('brokenPromise', function () { + return Q() + .then(function () { + throw new Error("nom nom nom"); + }); + }); + + desc('The bar:bar task, has the async bar:foo task as a prerequisite.'); + task('bar', ['bar:foo'], function () { + console.log('bar:bar task'); + }); + +}); + +namespace('hoge', function () { + desc('The hoge:hoge task, has no prerequisites.'); + task('hoge', function () { + console.log('hoge:hoge task'); + }); + + desc('The hoge:piyo task, has no prerequisites.'); + task('piyo', function () { + console.log('hoge:piyo task'); + }); + + desc('The hoge:fuga task, has hoge:hoge and hoge:piyo as prerequisites.'); + task('fuga', ['hoge:hoge', 'hoge:piyo'], function () { + console.log('hoge:fuga task'); + }); + + desc('The hoge:charan task, has hoge:fuga as a prerequisite.'); + task('charan', ['hoge:fuga'], function () { + console.log('hoge:charan task'); + }); + + desc('The hoge:gero task, has hoge:fuga as a prerequisite.'); + task('gero', ['hoge:fuga'], function () { + console.log('hoge:gero task'); + }); + + desc('The hoge:kira task, has hoge:charan and hoge:gero as prerequisites.'); + task('kira', ['hoge:charan', 'hoge:gero'], function () { + console.log('hoge:kira task'); + }); + +}); + +namespace('fileTest', function () { + directory('foo'); + + desc('File task, concatenating two files together'); + file('foo/concat.txt', ['fileTest:foo', 'fileTest:foo/src1.txt', 'fileTest:foo/src2.txt'], function () { + console.log('fileTest:foo/concat.txt task'); + let data1 = fs.readFileSync('foo/src1.txt'); + let data2 = fs.readFileSync('foo/src2.txt'); + fs.writeFileSync('foo/concat.txt', data1 + data2); + }); + + desc('File task, async creation with writeFile'); + file('foo/src1.txt', function () { + return new Promise(function (resolve, reject) { + fs.writeFile('foo/src1.txt', 'src1', function (err) { + if (err) { + reject(err); + } + else { + console.log('fileTest:foo/src1.txt task'); + resolve(); + } + }); + }); + }); + + desc('File task, sync creation with writeFileSync'); + file('foo/src2.txt', ['default'], function () { + fs.writeFileSync('foo/src2.txt', 'src2'); + console.log('fileTest:foo/src2.txt task'); + }); + + desc('File task, do not run unless the prereq file changes'); + file('foo/from-src1.txt', ['fileTest:foo', 'fileTest:foo/src1.txt'], function () { + let data = fs.readFileSync('foo/src1.txt').toString(); + fs.writeFileSync('foo/from-src1.txt', data); + console.log('fileTest:foo/from-src1.txt task'); + }); + + desc('File task, run if the prereq file changes'); + task('touch-prereq', function () { + fs.writeFileSync('foo/prereq.txt', 'UPDATED'); + }); + + desc('File task, has a preexisting file (with no associated task) as a prereq'); + file('foo/from-prereq.txt', ['fileTest:foo', 'foo/prereq.txt'], function () { + let data = fs.readFileSync('foo/prereq.txt'); + fs.writeFileSync('foo/from-prereq.txt', data); + console.log('fileTest:foo/from-prereq.txt task'); + }); + + directory('foo/bar/baz'); + + desc('Write a file in a nested subdirectory'); + file('foo/bar/baz/bamf.txt', ['foo/bar/baz'], function () { + fs.writeFileSync('foo/bar/baz/bamf.txt', 'w00t'); + }); + + file('foo/output1.txt', ['foo'], () => { + fs.writeFileSync('foo/output1.txt', 'Contents of foo/output1.txt'); + }); + + file('foo/output2a.txt', ['foo/output1.txt'], () => { + fs.writeFileSync('foo/output2a.txt', 'Contents of foo/output2a.txt'); + }); + + file('foo/output2b.txt', ['foo/output1.txt'], () => { + fs.writeFileSync('foo/output2b.txt', 'Contents of foo/output2b.txt'); + }); + + file('foo/output3.txt', [ 'foo/output2a.txt', 'foo/output2b.txt'], () => { + fs.writeFileSync('foo/output3.txt', 'w00t'); + }); +}); + +task('blammo'); +// Define task +task('voom', ['blammo'], function () { + console.log(this.prereqs.length); +}); + +// Modify, add a prereq +task('voom', ['noActionNoPrereqs']); + +namespace('vronk', function () { + task('groo', function () { + let t = jake.Task['vronk:zong']; + t.addListener('error', function (e) { + console.log(e.message); + }); + t.invoke(); + }); + task('zong', function () { + throw new Error('OMFGZONG'); + }); +}); + +// define namespace +namespace('one', function () { + task('one', function () { + console.log('one:one'); + }); +}); + +// modify namespace (add task) +namespace('one', function () { + task('two', ['one:one'], function () { + console.log('one:two'); + }); +}); + +task('selfdepconst', [], function () { + task('selfdep', ['selfdep'], function () { + console.log("I made a task that depends on itself"); + }); +}); +task('selfdepdyn', function () { + task('selfdeppar', [], {concurrency: 2}, function () { + console.log("I will depend on myself and will fail at runtime"); + }); + task('selfdeppar', ['selfdeppar']); + jake.Task['selfdeppar'].invoke(); +}); + +namespace("large", function () { + task("leaf", function () { + console.log("large:leaf"); + }); + + const same = []; + for (let i = 0; i < 2000; i++) { + same.push("leaf"); + } + + desc("Task with a large number of same prereqs"); + task("same", same, { concurrency: 2 }, function () { + console.log("large:same"); + }); + + const different = []; + for (let i = 0; i < 2000; i++) { + const name = "leaf-" + i; + task(name, function () { + if (name === "leaf-12" || name === "leaf-123") { + console.log(name); + } + }); + different.push(name); + } + + desc("Task with a large number of different prereqs"); + task("different", different, { concurrency: 2 } , function () { + console.log("large:different"); + }); +}); diff --git a/node_modules/jake/test/integration/jakelib/concurrent.jake.js b/node_modules/jake/test/integration/jakelib/concurrent.jake.js new file mode 100644 index 0000000..684c86f --- /dev/null +++ b/node_modules/jake/test/integration/jakelib/concurrent.jake.js @@ -0,0 +1,113 @@ + +namespace('concurrent', function () { + task('A', function () { + console.log('Started A'); + return new Promise((resolve, reject) => { + setTimeout(() => { + console.log('Finished A'); + resolve(); + }, 200); + }); + }); + + task('B', function () { + console.log('Started B'); + return new Promise((resolve, reject) => { + setTimeout(() => { + console.log('Finished B'); + resolve(); + }, 50); + }); + }); + + task('C', function () { + console.log('Started C'); + return new Promise((resolve, reject) => { + setTimeout(() => { + console.log('Finished C'); + resolve(); + }, 100); + }); + }); + + task('D', function () { + console.log('Started D'); + return new Promise((resolve, reject) => { + setTimeout(() => { + console.log('Finished D'); + resolve(); + }, 300); + }); + }); + + task('Ba', ['A'], function () { + console.log('Started Ba'); + return new Promise((resolve, reject) => { + setTimeout(() => { + console.log('Finished Ba'); + resolve(); + }, 50); + }); + }); + + task('Afail', function () { + console.log('Started failing task'); + return new Promise((resolve, reject) => { + setTimeout(() => { + console.log('Failing B with error'); + throw new Error('I failed'); + }, 50); + }); + }); + + task('simple1', ['A','B'], {concurrency: 2}, function () { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(); + }, 50); + }); + }); + + task('simple2', ['C','D'], {concurrency: 2}, function () { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(); + }, 50); + }); + }); + + task('seqconcurrent', ['simple1','simple2'], function () { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(); + }, 50); + }); + }); + + task('concurrentconcurrent', ['simple1','simple2'], {concurrency: 2}, function () { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(); + }, 50); + }); + }); + + task('subdep', ['A','Ba'], {concurrency: 2}, function () { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(); + }, 50); + }); + }); + + task('fail', ['A', 'B', 'Afail'], {concurrency: 3}, function () { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(); + }, 50); + }); + }); + +}); + + diff --git a/node_modules/jake/test/integration/jakelib/publish.jake.js b/node_modules/jake/test/integration/jakelib/publish.jake.js new file mode 100644 index 0000000..f8485d1 --- /dev/null +++ b/node_modules/jake/test/integration/jakelib/publish.jake.js @@ -0,0 +1,49 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +const PROJECT_DIR = process.env.PROJECT_DIR; + +let fs = require('fs'); +let { publishTask, rmRf, mkdirP } = require(`${PROJECT_DIR}/lib/jake`); + +fs.writeFileSync('package.json', '{"version": "0.0.1"}'); +mkdirP('tmp_publish'); +fs.writeFileSync('tmp_publish/foo.txt', 'FOO'); + +publishTask('zerb', function () { + this.packageFiles.include([ + 'package.json' + , 'tmp_publish/**' + ]); + this.publishCmd = 'node -p -e "\'%filename\'"'; + this.gitCmd = 'echo'; + this.scheduleDelay = 0; + + this._ensureRepoClean = function () {}; + this._getCurrentBranch = function () { + return 'v0.0'; + }; +}); + +jake.setTaskTimeout(5000); + +jake.Task['publish'].on('complete', function () { + rmRf('tmp_publish', {silent: true}); + rmRf('package.json', {silent: true}); +}); + diff --git a/node_modules/jake/test/integration/jakelib/required_module.jake.js b/node_modules/jake/test/integration/jakelib/required_module.jake.js new file mode 100644 index 0000000..eae666b --- /dev/null +++ b/node_modules/jake/test/integration/jakelib/required_module.jake.js @@ -0,0 +1,10 @@ +let { task, namespace } = require(`${process.env.PROJECT_DIR}/lib/jake`); + +namespace('usingRequire', function () { + task('test', () => { + console.log('howdy test'); + }); +}); + + + diff --git a/node_modules/jake/test/integration/jakelib/rule.jake.js b/node_modules/jake/test/integration/jakelib/rule.jake.js new file mode 100644 index 0000000..8e977dd --- /dev/null +++ b/node_modules/jake/test/integration/jakelib/rule.jake.js @@ -0,0 +1,222 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +const PROJECT_DIR = process.env.PROJECT_DIR; + +let exec = require('child_process').execSync; +let fs = require('fs'); +let util = require('util'); +let { rule, rmRf } = require(`${PROJECT_DIR}/lib/jake`); + +directory('tmpsrc'); +directory('tmpbin'); + +//////////////////////////////////////////////////////////// +// Simple Suffix Rule +file('tmp', ['tmp_init', 'tmp_dep1.o', 'tmp_dep2.o'], function (params) { + console.log('tmp task'); + let data1 = fs.readFileSync('tmp_dep1.o'); + let data2 = fs.readFileSync('tmp_dep2.o'); + fs.writeFileSync('tmp', data1 + data2); +}); + +rule('.o', '.c', function () { + let cmd = util.format('cp %s %s', this.source, this.name); + console.log(cmd + ' task'); + exec(cmd); +}); + +file('tmp_dep1.c', function () { + fs.writeFileSync('tmp_dep1.c', 'src_1'); + console.log('tmp_dep1.c task'); +}); + +// note that tmp_dep2.o depends on tmp_dep2.c, which is a +// static file. +task('tmp_init', function () { + fs.writeFileSync('tmp_dep2.c', 'src_2'); + console.log('tmp_dep2.c task'); +}); +//////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// Pattern Rule +file('tmp_p', ['tmp_init', 'tmp_dep1.oo', 'tmp_dep2.oo'], function (params) { + console.log('tmp pattern task'); + let data1 = fs.readFileSync('tmp_dep1.oo'); + let data2 = fs.readFileSync('tmp_dep2.oo'); + fs.writeFileSync('tmp_p', data1 + data2 + ' pattern'); +}); + +rule('%.oo', '%.c', function () { + let cmd = util.format('cp %s %s', this.source, this.name); + console.log(cmd + ' task'); + exec(cmd); +}); +//////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// Pattern Rule with Folder +// i.e. rule('tmpbin/%.oo', 'tmpsrc/%.c', ... +file('tmp_pf', [ + 'tmp_src_init' + , 'tmpbin' + , 'tmpbin/tmp_dep1.oo' + , 'tmpbin/tmp_dep2.oo' ], function (params) { + console.log('tmp pattern folder task'); + let data1 = fs.readFileSync('tmpbin/tmp_dep1.oo'); + let data2 = fs.readFileSync('tmpbin/tmp_dep2.oo'); + fs.writeFileSync('tmp_pf', data1 + data2 + ' pattern folder'); +}); + +rule('tmpbin/%.oo', 'tmpsrc/%.c', function () { + let cmd = util.format('cp %s %s', this.source, this.name); + console.log(cmd + ' task'); + exec(cmd); +}); + +file('tmpsrc/tmp_dep2.c',['tmpsrc'], function () { + fs.writeFileSync('tmpsrc/tmp_dep2.c', 'src/src_2'); + console.log('tmpsrc/tmp_dep2.c task'); +}); + +// Create static files in folder tmpsrc. +task('tmp_src_init', ['tmpsrc'], function () { + fs.writeFileSync('tmpsrc/tmp_dep1.c', 'src/src_1'); + console.log('tmpsrc/tmp_dep1.c task'); +}); +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// Namespace Test. This is a Mixed Test. +// Test for +// - rules belonging to different namespace. +// - rules with folder and pattern +task('tmp_ns', [ + 'tmpbin' + , 'rule:init' + , 'tmpbin/tmp_dep2.oo' // *** This relies on a rule defined before. + , 'rule:tmpbin/dep1.oo' + , 'rule:tmpbin/file2.oo' ], function () { + console.log('tmp pattern folder namespace task'); + let data1 = fs.readFileSync('tmpbin/dep1.oo'); + let data2 = fs.readFileSync('tmpbin/tmp_dep2.oo'); + let data3 = fs.readFileSync('tmpbin/file2.oo'); + fs.writeFileSync('tmp_ns', data1 + data2 + data3 + ' pattern folder namespace'); +}); + +namespace('rule', function () { + task('init', ['tmpsrc'], function () { + fs.writeFileSync('tmpsrc/file2.c', 'src/src_3'); + console.log('tmpsrc/file2.c init task'); + }); + + file('tmpsrc/dep1.c',['tmpsrc'], function () { + fs.writeFileSync('tmpsrc/dep1.c', 'src/src_1'); + console.log('tmpsrc/dep1.c task'); + }, {async: true}); + + rule('tmpbin/%.oo', 'tmpsrc/%.c', function () { + let cmd = util.format('cp %s %s', this.source, this.name); + console.log(cmd + ' ns task'); + exec(cmd); + }); +}); +//////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// Chain rule +// rule('tmpbin/%.pdf', 'tmpbin/%.dvi', function() { ... +// rule('tmpbin/%.dvi', 'tmpsrc/%.tex', ['tmpbin'], function() { ... +task('tmp_cr', [ + 'chainrule:init' + , 'chainrule:tmpbin/file1.pdf' + , 'chainrule:tmpbin/file2.pdf' ], function () { + console.log('tmp chainrule namespace task'); + let data1 = fs.readFileSync('tmpbin/file1.pdf'); + let data2 = fs.readFileSync('tmpbin/file2.pdf'); + fs.writeFileSync('tmp_cr', data1 + data2 + ' chainrule namespace'); +}); + +namespace('chainrule', function () { + task('init', ['tmpsrc', 'tmpbin'], function () { + fs.writeFileSync('tmpsrc/file1.tex', 'tex1 '); + fs.writeFileSync('tmpsrc/file2.tex', 'tex2 '); + console.log('chainrule init task'); + }); + + rule('tmpbin/%.pdf', 'tmpbin/%.dvi', function () { + let cmd = util.format('cp %s %s', this.source, this.name); + console.log(cmd + ' dvi->pdf task'); + exec(cmd); + }); + + rule('tmpbin/%.dvi', 'tmpsrc/%.tex', ['tmpbin'], function () { + let cmd = util.format('cp %s %s', this.source, this.name); + console.log(cmd + ' tex->dvi task'); + exec(cmd); + }); +}); +//////////////////////////////////////////////////////////// +namespace('precedence', function () { + task('test', ['foo.html'], function () { + console.log('ran test'); + }); + + rule('.html', '.txt', function () { + console.log('created html'); + let data = fs.readFileSync(this.source); + fs.writeFileSync(this.name, data.toString()); + }); +}); + +namespace('regexPattern', function () { + task('test', ['foo.html'], function () { + console.log('ran test'); + }); + + rule(/\.html$/, '.txt', function () { + console.log('created html'); + let data = fs.readFileSync(this.source); + fs.writeFileSync(this.name, data.toString()); + }); +}); + +namespace('sourceFunction', function () { + + let srcFunc = function (taskName) { + return taskName.replace(/\.[^.]+$/, '.txt'); + }; + + task('test', ['foo.html'], function () { + console.log('ran test'); + }); + + rule('.html', srcFunc, function () { + console.log('created html'); + let data = fs.readFileSync(this.source); + fs.writeFileSync(this.name, data.toString()); + }); +}); + +//////////////////////////////////////////////////////////// +task('clean', function () { + rmRf('./foo'); + rmRf('./tmp'); +}); diff --git a/node_modules/jake/test/integration/list_tasks.js b/node_modules/jake/test/integration/list_tasks.js new file mode 100644 index 0000000..c21d030 --- /dev/null +++ b/node_modules/jake/test/integration/list_tasks.js @@ -0,0 +1,15 @@ +const PROJECT_DIR = process.env.PROJECT_DIR; +const JAKE_CMD = `${PROJECT_DIR}/bin/cli.js`; + +let assert = require('assert'); +let proc = require('child_process'); + +suite('listTasks', function () { + test('execute "jake -T" without any errors', function () { + let message = 'cannot run "jake -T" command'; + let listTasks = function () { + proc.execFileSync(JAKE_CMD, ['-T']); + }; + assert.doesNotThrow(listTasks, TypeError, message); + }); +}); diff --git a/node_modules/jake/test/integration/publish_task.js b/node_modules/jake/test/integration/publish_task.js new file mode 100644 index 0000000..a941b30 --- /dev/null +++ b/node_modules/jake/test/integration/publish_task.js @@ -0,0 +1,27 @@ +let assert = require('assert'); +let exec = require('child_process').execSync; + +const PROJECT_DIR = process.env.PROJECT_DIR; +const JAKE_CMD = `${PROJECT_DIR}/bin/cli.js`; + +suite('publishTask', function () { + + this.timeout(7000); + + test('default task', function () { + let out = exec(`${JAKE_CMD} -q publish`).toString().trim(); + let expected = [ + 'Fetched remote tags.' + , 'On branch v0.0' + , 'Bumped version number to v0.0.2.' + , 'Created package for zerb v0.0.2' + , 'Publishing zerb v0.0.2' + , './pkg/zerb-v0.0.2.tar.gz' + , 'BOOM! Published.' + , 'Cleaned up package' + ].join('\n'); + assert.equal(expected, out); + }); + +}); + diff --git a/node_modules/jake/test/integration/rule.js b/node_modules/jake/test/integration/rule.js new file mode 100644 index 0000000..468db01 --- /dev/null +++ b/node_modules/jake/test/integration/rule.js @@ -0,0 +1,217 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +const PROJECT_DIR = process.env.PROJECT_DIR; +const JAKE_CMD = `${PROJECT_DIR}/bin/cli.js`; + +let assert = require('assert'); +let exec = require('child_process').execSync; +let fs = require('fs'); +let { Rule } = require(`${PROJECT_DIR}/lib/rule`); +let { rmRf } = require(`${PROJECT_DIR}/lib/jake`); + +let cleanUpAndNext = function (callback) { + // Gotta add globbing to file utils rmRf + let tmpFiles = [ + 'tmp' + , 'tmp_ns' + , 'tmp_cr' + , 'tmp_p' + , 'tmp_pf' + , 'tmpbin' + , 'tmpsrc' + , 'tmp_dep1.c' + , 'tmp_dep1.o' + , 'tmp_dep1.oo' + , 'tmp_dep2.c' + , 'tmp_dep2.o' + , 'tmp_dep2.oo' + , 'foo' + , 'foo.html' + ]; + tmpFiles.forEach(function (f) { + rmRf(f, { + silent: true + }); + }); + callback && callback(); +}; + +suite('rule', function () { + + this.timeout(7000); + + setup(function (next) { + cleanUpAndNext(next); + }); + + + // - name foo:bin/main.o + // - pattern bin/%.o + // - source src/%.c + // + // return { + // 'dep' : 'foo:src/main.c', + // 'file': 'src/main.c' + // }; + test('Rule.getSource', function () { + let src = Rule.getSource('foo:bin/main.o', 'bin/%.o', 'src/%.c'); + assert.equal('foo:src/main.c', src); + }); + + test('rule w/o pattern', function () { + let out = exec( `${JAKE_CMD} -q tmp`).toString().trim(); + let output = [ + "tmp_dep2.c task" + , "tmp_dep1.c task" + , "cp tmp_dep1.c tmp_dep1.o task" + , "cp tmp_dep2.c tmp_dep2.o task" + , "tmp task"]; + assert.equal( output.join('\n'), out); + let data = fs.readFileSync(process.cwd() + '/tmp'); + assert.equal('src_1src_2', data.toString()); + cleanUpAndNext(); + }); + + test('rule w pattern w/o folder w/o namespace', function () { + let out = exec( `${JAKE_CMD} -q tmp_p`).toString().trim(); + let output = [ + "tmp_dep2.c task" + , "tmp_dep1.c task" + , "cp tmp_dep1.c tmp_dep1.oo task" + , "cp tmp_dep2.c tmp_dep2.oo task" + , "tmp pattern task"]; + let data; + assert.equal( output.join('\n'), out); + data = fs.readFileSync(process.cwd() + '/tmp_p'); + assert.equal('src_1src_2 pattern', data.toString()); + cleanUpAndNext(); + }); + + test('rule w pattern w folder w/o namespace', function () { + let out = exec( `${JAKE_CMD} -q tmp_pf`).toString().trim(); + let output = [ + "tmpsrc/tmp_dep1.c task" + , "cp tmpsrc/tmp_dep1.c tmpbin/tmp_dep1.oo task" + , "tmpsrc/tmp_dep2.c task" + , "cp tmpsrc/tmp_dep2.c tmpbin/tmp_dep2.oo task" + , "tmp pattern folder task"]; + let data; + assert.equal( output.join('\n'), out); + data = fs.readFileSync(process.cwd() + '/tmp_pf'); + assert.equal('src/src_1src/src_2 pattern folder', data.toString()); + cleanUpAndNext(); + }); + + test.skip('rule w pattern w folder w namespace', function () { + let out = exec( `${JAKE_CMD} -q tmp_ns`).toString().trim(); + let output = [ + "tmpsrc/file2.c init task" // yes + , "tmpsrc/tmp_dep2.c task" // no + , "cp tmpsrc/tmp_dep2.c tmpbin/tmp_dep2.oo task" // no + , "tmpsrc/dep1.c task" // no + , "cp tmpsrc/dep1.c tmpbin/dep1.oo ns task" // no + , "cp tmpsrc/file2.c tmpbin/file2.oo ns task" // yes + , "tmp pattern folder namespace task"]; // yes + let data; + assert.equal( output.join('\n'), out); + data = fs.readFileSync(process.cwd() + '/tmp_ns'); + assert.equal('src/src_1src/src_2src/src_3 pattern folder namespace', data.toString()); + cleanUpAndNext(); + }); + + test.skip('rule w chain w pattern w folder w namespace', function () { + let out = exec( `${JAKE_CMD} -q tmp_cr`).toString().trim(); + let output = [ + "chainrule init task" + , "cp tmpsrc/file1.tex tmpbin/file1.dvi tex->dvi task" + , "cp tmpbin/file1.dvi tmpbin/file1.pdf dvi->pdf task" + , "cp tmpsrc/file2.tex tmpbin/file2.dvi tex->dvi task" + , "cp tmpbin/file2.dvi tmpbin/file2.pdf dvi->pdf task" + , "tmp chainrule namespace task"]; + let data; + assert.equal( output.join('\n'), out); + data = fs.readFileSync(process.cwd() + '/tmp_cr'); + assert.equal('tex1 tex2 chainrule namespace', data.toString()); + cleanUpAndNext(); + }); + + + ['precedence', 'regexPattern', 'sourceFunction'].forEach(function (key) { + + test('rule with source file not created yet (' + key + ')', function () { + let write = process.stderr.write; + process.stderr.write = () => {}; + rmRf('foo.txt', {silent: true}); + rmRf('foo.html', {silent: true}); + try { + exec(`${JAKE_CMD} ` + key + ':test'); + } + catch(err) { + // foo.txt prereq doesn't exist yet + assert.ok(err.message.indexOf('Unknown task "foo.html"') > -1); + } + process.stderr.write = write; + }); + + test('rule with source file now created (' + key + ')', function () { + fs.writeFileSync('foo.txt', ''); + let out = exec(`${JAKE_CMD} -q ` + key + ':test').toString().trim(); + // Should run prereq and test task + let output = [ + 'created html' + , 'ran test' + ]; + assert.equal(output.join('\n'), out); + }); + + test('rule with source file modified (' + key + ')', function (next) { + setTimeout(function () { + fs.writeFileSync('foo.txt', ''); + let out = exec(`${JAKE_CMD} -q ` + key + ':test').toString().trim(); + // Should again run both prereq and test task + let output = [ + 'created html' + , 'ran test' + ]; + assert.equal(output.join('\n'), out); + //next(); + cleanUpAndNext(next); + }, 1000); // Wait to do the touch to ensure mod-time is different + }); + + test('rule with existing objective file and no source ' + + ' (should be normal file-task) (' + key + ')', function () { + // Remove just the source file + fs.writeFileSync('foo.html', ''); + rmRf('foo.txt', {silent: true}); + let out = exec(`${JAKE_CMD} -q ` + key + ':test').toString().trim(); + // Should treat existing objective file as plain file-task, + // and just run test-task + let output = [ + 'ran test' + ]; + assert.equal(output.join('\n'), out); + cleanUpAndNext(); + }); + + }); + +}); + + diff --git a/node_modules/jake/test/integration/selfdep.js b/node_modules/jake/test/integration/selfdep.js new file mode 100644 index 0000000..3195d08 --- /dev/null +++ b/node_modules/jake/test/integration/selfdep.js @@ -0,0 +1,42 @@ +let assert = require('assert'); +let exec = require('child_process').execSync; + +const PROJECT_DIR = process.env.PROJECT_DIR; +const JAKE_CMD = `${PROJECT_DIR}/bin/cli.js`; + +suite('selfDep', function () { + + this.timeout(7000); + + let origStderrWrite; + + setup(function () { + origStderrWrite = process.stderr.write; + process.stderr.write = function () {}; + }); + + teardown(function () { + process.stderr.write = origStderrWrite; + }); + + test('self dep const', function () { + try { + exec(`${JAKE_CMD} selfdepconst`); + } + catch(e) { + assert(e.message.indexOf('dependency of itself') > -1); + } + }); + + test('self dep dyn', function () { + try { + exec(`${JAKE_CMD} selfdepdyn`); + } + catch(e) { + assert(e.message.indexOf('dependency of itself') > -1); + } + }); + +}); + + diff --git a/node_modules/jake/test/integration/task_base.js b/node_modules/jake/test/integration/task_base.js new file mode 100644 index 0000000..9aa501d --- /dev/null +++ b/node_modules/jake/test/integration/task_base.js @@ -0,0 +1,167 @@ +let assert = require('assert'); +let h = require('./helpers'); +let exec = require('child_process').execSync; + +const PROJECT_DIR = process.env.PROJECT_DIR; +const JAKE_CMD = `${PROJECT_DIR}/bin/cli.js`; + +suite('taskBase', function () { + + this.timeout(7000); + + test('default task', function () { + let out; + out = exec(`${JAKE_CMD} -q`).toString().trim(); + assert.equal(out, 'default task'); + out = exec(`${JAKE_CMD} -q default`).toString().trim(); + assert.equal(out, 'default task'); + }); + + test('task with no action', function () { + let out = exec(`${JAKE_CMD} -q noAction`).toString().trim(); + assert.equal(out, 'default task'); + }); + + test('a task with no action and no prereqs', function () { + exec(`${JAKE_CMD} noActionNoPrereqs`); + }); + + test('a task that exists at the top-level, and not in the specified namespace, should error', function () { + let res = require('child_process').spawnSync(`${JAKE_CMD}`, + ['asdfasdfasdf:zerbofrangazoomy']); + let err = res.stderr.toString(); + assert.ok(err.indexOf('Unknown task' > -1)); + }); + + test('passing args to a task', function () { + let out = exec(`${JAKE_CMD} -q argsEnvVars[foo,bar]`).toString().trim(); + let parsed = h.parse(out); + let args = parsed.args; + assert.equal(args[0], 'foo'); + assert.equal(args[1], 'bar'); + }); + + test('a task with environment vars', function () { + let out = exec(`${JAKE_CMD} -q argsEnvVars foo=bar baz=qux`).toString().trim(); + let parsed = h.parse(out); + let env = parsed.env; + assert.equal(env.foo, 'bar'); + assert.equal(env.baz, 'qux'); + }); + + test('passing args and using environment vars', function () { + let out = exec(`${JAKE_CMD} -q argsEnvVars[foo,bar] foo=bar baz=qux`).toString().trim(); + let parsed = h.parse(out); + let args = parsed.args; + let env = parsed.env; + assert.equal(args[0], 'foo'); + assert.equal(args[1], 'bar'); + assert.equal(env.foo, 'bar'); + assert.equal(env.baz, 'qux'); + }); + + test('a simple prereq', function () { + let out = exec(`${JAKE_CMD} -q foo:baz`).toString().trim(); + assert.equal(out, 'foo:bar task\nfoo:baz task'); + }); + + test('a duplicate prereq only runs once', function () { + let out = exec(`${JAKE_CMD} -q foo:asdf`).toString().trim(); + assert.equal(out, 'foo:bar task\nfoo:baz task\nfoo:asdf task'); + }); + + test('a prereq with command-line args', function () { + let out = exec(`${JAKE_CMD} -q foo:qux`).toString().trim(); + assert.equal(out, 'foo:bar[asdf,qwer] task\nfoo:qux task'); + }); + + test('a prereq with args via invoke', function () { + let out = exec(`${JAKE_CMD} -q foo:frang[zxcv,uiop]`).toString().trim(); + assert.equal(out, 'foo:bar[zxcv,uiop] task\nfoo:frang task'); + }); + + test('a prereq with args via execute', function () { + let out = exec(`${JAKE_CMD} -q foo:zerb[zxcv,uiop]`).toString().trim(); + assert.equal(out, 'foo:bar[zxcv,uiop] task\nfoo:zerb task'); + }); + + test('repeating the task via execute', function () { + let out = exec(`${JAKE_CMD} -q foo:voom`).toString().trim(); + assert.equal(out, 'foo:bar task\nfoo:bar task\ncomplete\ncomplete'); + }); + + test('prereq execution-order', function () { + let out = exec(`${JAKE_CMD} -q hoge:fuga`).toString().trim(); + assert.equal(out, 'hoge:hoge task\nhoge:piyo task\nhoge:fuga task'); + }); + + test('basic async task', function () { + let out = exec(`${JAKE_CMD} -q bar:bar`).toString().trim(); + assert.equal(out, 'bar:foo task\nbar:bar task'); + }); + + test('promise async task', function () { + let out = exec(`${JAKE_CMD} -q bar:dependOnpromise`).toString().trim(); + assert.equal(out, 'bar:promise task\nbar:dependOnpromise task saw value 123654'); + }); + + test('failing promise async task', function () { + try { + exec(`${JAKE_CMD} -q bar:brokenPromise`); + } + catch(e) { + assert(e.message.indexOf('Command failed') > -1); + } + }); + + test('that current-prereq index gets reset', function () { + let out = exec(`${JAKE_CMD} -q hoge:kira`).toString().trim(); + assert.equal(out, 'hoge:hoge task\nhoge:piyo task\nhoge:fuga task\n' + + 'hoge:charan task\nhoge:gero task\nhoge:kira task'); + }); + + test('modifying a task by adding prereq during execution', function () { + let out = exec(`${JAKE_CMD} -q voom`).toString().trim(); + assert.equal(out, 2); + }); + + test('listening for task error-event', function () { + try { + exec(`${JAKE_CMD} -q vronk:groo`).toString().trim(); + } + catch(e) { + assert(e.message.indexOf('OMFGZONG') > -1); + } + }); + + test('listening for jake error-event', function () { + let out = exec(`${JAKE_CMD} -q throwy`).toString().trim(); + assert(out.indexOf('Emitted\nError: I am bad') > -1); + }); + + test('listening for jake unhandledRejection-event', function () { + let out = exec(`${JAKE_CMD} -q promiseRejecter`).toString().trim(); + assert.equal(out, ''); + }); + + test('large number of same prereqs', function () { + let out = exec(`${JAKE_CMD} -q large:same`).toString().trim(); + assert.equal(out, 'large:leaf\nlarge:same'); + }); + + test('large number of different prereqs', function () { + let out = exec(`${JAKE_CMD} -q large:different`).toString().trim(); + assert.equal(out, 'leaf-12\nleaf-123\nlarge:different'); + }); + + test('large number of different prereqs', function () { + let out = exec(`${JAKE_CMD} -q usingRequire:test`).toString().trim(); + assert.equal(out, 'howdy test'); + }); + + test('modifying a namespace by adding a new task', function () { + let out = exec(`${JAKE_CMD} -q one:two`).toString().trim(); + assert.equal('one:one\none:two', out); + }); + +}); diff --git a/node_modules/jake/test/unit/jakefile.js b/node_modules/jake/test/unit/jakefile.js new file mode 100644 index 0000000..89ff523 --- /dev/null +++ b/node_modules/jake/test/unit/jakefile.js @@ -0,0 +1,36 @@ + +task('foo', function () { + console.log('ran top-level foo'); +}); + +task('bar', function () { + console.log('ran top-level bar'); +}); + +task('zerb', function () { + console.log('ran zerb'); +}); + +namespace('zooby', function () { + task('zerp', function () {}); + + task('derp', ['zerp'], function () {}); + + namespace('frang', function () { + + namespace('w00t', function () { + task('bar', function () { + console.log('ran zooby:frang:w00t:bar'); + }); + }); + + task('asdf', function () {}); + }); + +}); + +namespace('hurr', function () { + namespace('durr'); +}); + + diff --git a/node_modules/jake/test/unit/namespace.js b/node_modules/jake/test/unit/namespace.js new file mode 100644 index 0000000..c6b3ff5 --- /dev/null +++ b/node_modules/jake/test/unit/namespace.js @@ -0,0 +1,77 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +const PROJECT_DIR = process.env.PROJECT_DIR; + +// Load the jake global +require(`${PROJECT_DIR}/lib/jake`); +let { Namespace } = require(`${PROJECT_DIR}/lib/namespace`); + +require('./jakefile'); + +let assert = require('assert'); + +suite('namespace', function () { + + this.timeout(7000); + + test('resolve namespace by relative name', function () { + let aaa, bbb, ccc; + aaa = namespace('aaa', function () { + bbb = namespace('bbb', function () { + ccc = namespace('ccc', function () { + }); + }); + }); + + assert.ok(aaa, Namespace.ROOT_NAMESPACE.resolveNamespace('aaa')); + assert.ok(bbb === aaa.resolveNamespace('bbb')); + assert.ok(ccc === aaa.resolveNamespace('bbb:ccc')); + }); + + test('resolve task in sub-namespace by relative path', function () { + let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('zooby'); + let task = curr.resolveTask('frang:w00t:bar'); + assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1); + }); + + test('prefer local to top-level', function () { + let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('zooby:frang:w00t'); + let task = curr.resolveTask('bar'); + assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1); + }); + + test('does resolve top-level', function () { + let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('zooby:frang:w00t'); + let task = curr.resolveTask('foo'); + assert.ok(task.action.toString().indexOf('top-level foo') > -1); + }); + + test('absolute lookup works from sub-namespaces', function () { + let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('hurr:durr'); + let task = curr.resolveTask('zooby:frang:w00t:bar'); + assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1); + }); + + test('resolution miss with throw error', function () { + let curr = Namespace.ROOT_NAMESPACE; + let task = curr.resolveTask('asdf:qwer'); + assert.ok(!task); + }); + +}); diff --git a/node_modules/jake/test/unit/parseargs.js b/node_modules/jake/test/unit/parseargs.js new file mode 100644 index 0000000..7a3ddd5 --- /dev/null +++ b/node_modules/jake/test/unit/parseargs.js @@ -0,0 +1,169 @@ +/* + * Jake JavaScript build tool + * Copyright 2112 Matthew Eernisse (mde@fleegix.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +const PROJECT_DIR = process.env.PROJECT_DIR; + +let parseargs = require(`${PROJECT_DIR}/lib/parseargs`); +let assert = require('assert'); +let optsReg = [ + { full: 'directory', + abbr: 'C', + preempts: false, + expectValue: true + }, + { full: 'jakefile', + abbr: 'f', + preempts: false, + expectValue: true + }, + { full: 'tasks', + abbr: 'T', + preempts: true + }, + { full: 'tasks', + abbr: 'ls', + preempts: true + }, + { full: 'trace', + abbr: 't', + preempts: false, + expectValue: false + }, + { full: 'help', + abbr: 'h', + preempts: true + }, + { full: 'version', + abbr: 'V', + preempts: true + } +]; +let p = new parseargs.Parser(optsReg); +let z = function (s) { return s.split(' '); }; +let res; + +suite('parseargs', function () { + + test('long preemptive opt and val with equal-sign, ignore further opts', function () { + res = p.parse(z('--tasks=foo --jakefile=asdf')); + assert.equal('foo', res.opts.tasks); + assert.equal(undefined, res.opts.jakefile); + }); + + test('long preemptive opt and val without equal-sign, ignore further opts', function () { + res = p.parse(z('--tasks foo --jakefile=asdf')); + assert.equal('foo', res.opts.tasks); + assert.equal(undefined, res.opts.jakefile); + }); + + test('long preemptive opt and no val, ignore further opts', function () { + res = p.parse(z('--tasks --jakefile=asdf')); + assert.equal(true, res.opts.tasks); + assert.equal(undefined, res.opts.jakefile); + }); + + test('preemptive opt with no val, should be true', function () { + res = p.parse(z('-T')); + assert.equal(true, res.opts.tasks); + }); + + test('preemptive opt with no val, should be true and ignore further opts', function () { + res = p.parse(z('-T -f')); + assert.equal(true, res.opts.tasks); + assert.equal(undefined, res.opts.jakefile); + }); + + test('preemptive opt with val, should be val', function () { + res = p.parse(z('-T zoobie -f foo/bar/baz')); + assert.equal('zoobie', res.opts.tasks); + assert.equal(undefined, res.opts.jakefile); + }); + + test('-f expects a value, -t does not (howdy is task-name)', function () { + res = p.parse(z('-f zoobie -t howdy')); + assert.equal('zoobie', res.opts.jakefile); + assert.equal(true, res.opts.trace); + assert.equal('howdy', res.taskNames[0]); + }); + + test('different order, -f expects a value, -t does not (howdy is task-name)', function () { + res = p.parse(z('-f zoobie howdy -t')); + assert.equal('zoobie', res.opts.jakefile); + assert.equal(true, res.opts.trace); + assert.equal('howdy', res.taskNames[0]); + }); + + test('-f expects a value, -t does not (foo=bar is env var)', function () { + res = p.parse(z('-f zoobie -t foo=bar')); + assert.equal('zoobie', res.opts.jakefile); + assert.equal(true, res.opts.trace); + assert.equal('bar', res.envVars.foo); + assert.equal(undefined, res.taskNames[0]); + }); + + test('-f expects a value, -t does not (foo=bar is env-var, task-name follows)', function () { + res = p.parse(z('-f zoobie -t howdy foo=bar')); + assert.equal('zoobie', res.opts.jakefile); + assert.equal(true, res.opts.trace); + assert.equal('bar', res.envVars.foo); + assert.equal('howdy', res.taskNames[0]); + }); + + test('-t does not expect a value, -f does (howdy is task-name)', function () { + res = p.parse(z('-t howdy -f zoobie')); + assert.equal(true, res.opts.trace); + assert.equal('zoobie', res.opts.jakefile); + assert.equal('howdy', res.taskNames[0]); + }); + + test('--trace does not expect a value, -f does (howdy is task-name)', function () { + res = p.parse(z('--trace howdy --jakefile zoobie')); + assert.equal(true, res.opts.trace); + assert.equal('zoobie', res.opts.jakefile); + assert.equal('howdy', res.taskNames[0]); + }); + + test('--trace does not expect a value (equal), -f does (throw howdy away)', function () { + res = p.parse(z('--trace=howdy --jakefile=zoobie')); + assert.equal(true, res.opts.trace); + assert.equal('zoobie', res.opts.jakefile); + assert.equal(undefined, res.taskNames[0]); + }); + + /* +, test('task-name with positional args', function () { + res = p.parse(z('foo:bar[asdf,qwer]')); + assert.equal('asdf', p.taskArgs[0]); + assert.equal('qwer', p.taskArgs[1]); + } + +, test('opts, env vars, task-name with positional args', function () { + res = p.parse(z('-f ./tests/Jakefile -t default[asdf,qwer] foo=bar')); + assert.equal('./tests/Jakefile', res.opts.jakefile); + assert.equal(true, res.opts.trace); + assert.equal('bar', res.envVars.foo); + assert.equal('default', res.taskName); + assert.equal('asdf', p.taskArgs[0]); + assert.equal('qwer', p.taskArgs[1]); + } +*/ + + +}); + + diff --git a/node_modules/jake/usage.txt b/node_modules/jake/usage.txt new file mode 100644 index 0000000..40395c5 --- /dev/null +++ b/node_modules/jake/usage.txt @@ -0,0 +1,17 @@ +Jake JavaScript build tool +******************************************************************************** +If no flags are given, Jake looks for a Jakefile or Jakefile.js in the current directory. +******************************************************************************** +{Usage}: jake [options ...] [env variables ...] target + +{Options}: + -f, --jakefile FILE Use FILE as the Jakefile. + -C, --directory DIRECTORY Change to DIRECTORY before running tasks. + -q, --quiet Do not log messages to standard output. + -B, --always-make Unconditionally make all targets. + -T/-ls, --tasks Display the tasks (matching optional PATTERN) with descriptions, then exit. + -J, --jakelibdir JAKELIBDIR Auto-import any .jake files in JAKELIBDIR. (default is \'jakelib\') + -h, --help Display this help message. + -V/-v, --version Display the Jake version. + -ar, --allow-rejection Keep running even after unhandled promise rejection. + diff --git a/node_modules/jiti/LICENSE b/node_modules/jiti/LICENSE new file mode 100644 index 0000000..e739abc --- /dev/null +++ b/node_modules/jiti/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Pooya Parsa + +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. diff --git a/node_modules/jiti/README.md b/node_modules/jiti/README.md new file mode 100644 index 0000000..2da8e4e --- /dev/null +++ b/node_modules/jiti/README.md @@ -0,0 +1,164 @@ +# jiti + +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] +[![bundle][bundle-src]][bundle-href] +[![License][license-src]][license-href] + +Runtime Typescript and ESM support for Node.js. + +> [!IMPORTANT] +> This is the support branch for jiti v1. Check out [jiti/main](https://github.com/unjs/jiti/tree/main) for the latest version and [unjs/jiti#174](https://github.com/unjs/jiti/issues/174) for the roadmap. + +## Features + +- Seamless typescript and ESM syntax support +- Seamless interoperability between ESM and CommonJS +- Synchronous API to replace `require` +- Super slim and zero dependency +- Smart syntax detection to avoid extra transforms +- CommonJS cache integration +- Filesystem transpile hard cache +- V8 compile cache +- Custom resolve alias + +## Usage + +### Programmatic + +```js +const jiti = require("jiti")(__filename); + +jiti("./path/to/file.ts"); +``` + +You can also pass options as second argument: + +```js +const jiti = require("jiti")(__filename, { debug: true }); +``` + +### CLI + +```bash +jiti index.ts +# or npx jiti index.ts +``` + +### Register require hook + +```bash +node -r jiti/register index.ts +``` + +Alternatively, you can register `jiti` as a require hook programmatically: + +```js +const jiti = require("jiti")(); +const unregister = jiti.register(); +``` + +## Options + +### `debug` + +- Type: Boolean +- Default: `false` +- Environment Variable: `JITI_DEBUG` + +Enable debug to see which files are transpiled + +### `cache` + +- Type: Boolean | String +- Default: `true` +- Environment Variable: `JITI_CACHE` + +Use transpile cache + +If set to `true` will use `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/node-jiti` + +### `esmResolve` + +- Type: Boolean | String +- Default: `false` +- Environment Variable: `JITI_ESM_RESOLVE` + +Using esm resolution algorithm to support `import` condition. + +### `transform` + +- Type: Function +- Default: Babel (lazy loaded) + +Transform function. See [src/babel](./src/babel.ts) for more details + +### `sourceMaps` + +- Type: Boolean +- Default `false` +- Environment Variable: `JITI_SOURCE_MAPS` + +Add inline source map to transformed source for better debugging. + +### `interopDefault` + +- Type: Boolean +- Default: `false` + +Return the `.default` export of a module at the top-level. + +### `alias` + +- Type: Object +- Default: - +- Environment Variable: `JITI_ALIAS` + +Custom alias map used to resolve ids. + +### `nativeModules` + +- Type: Array +- Default: ['typescript`] +- Environment Variable: `JITI_NATIVE_MODULES` + +List of modules (within `node_modules`) to always use native require for them. + +### `transformModules` + +- Type: Array +- Default: [] +- Environment Variable: `JITI_TRANSFORM_MODULES` + +List of modules (within `node_modules`) to transform them regardless of syntax. + +### `experimentalBun` + +- Type: Boolean +- Default: Enabled if `process.versions.bun` exists (Bun runtime) +- Environment Variable: `JITI_EXPERIMENTAL_BUN` + +Enable experimental native Bun support for transformations. + +## Development + +- Clone this repository +- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` +- Install dependencies using `pnpm install` +- Run `pnpm dev` +- Run `pnpm jiti ./test/path/to/file.ts` + +## License + +MIT. Made with 💖 + + + +[npm-version-src]: https://img.shields.io/npm/v/jiti?style=flat&colorA=18181B&colorB=F0DB4F +[npm-version-href]: https://npmjs.com/package/jiti +[npm-downloads-src]: https://img.shields.io/npm/dm/jiti?style=flat&colorA=18181B&colorB=F0DB4F +[npm-downloads-href]: https://npmjs.com/package/jiti +[bundle-src]: https://img.shields.io/bundlephobia/minzip/jiti?style=flat&colorA=18181B&colorB=F0DB4F +[bundle-href]: https://bundlephobia.com/result?p=h3 +[license-src]: https://img.shields.io/github/license/unjs/jiti.svg?style=flat&colorA=18181B&colorB=F0DB4F +[license-href]: https://github.com/unjs/jiti/blob/main/LICENSE diff --git a/node_modules/jiti/bin/jiti.js b/node_modules/jiti/bin/jiti.js new file mode 100755 index 0000000..2867c64 --- /dev/null +++ b/node_modules/jiti/bin/jiti.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +const { resolve } = require("node:path"); + +const script = process.argv.splice(2, 1)[0]; + +if (!script) { + + console.error("Usage: jiti [...arguments]"); + process.exit(1); +} + +const pwd = process.cwd(); +const jiti = require("..")(pwd); +const resolved = (process.argv[1] = jiti.resolve(resolve(pwd, script))); +jiti(resolved); diff --git a/node_modules/jiti/dist/babel.d.ts b/node_modules/jiti/dist/babel.d.ts new file mode 100644 index 0000000..ea178d4 --- /dev/null +++ b/node_modules/jiti/dist/babel.d.ts @@ -0,0 +1,2 @@ +import { TransformOptions, TRANSFORM_RESULT } from "./types"; +export default function transform(opts: TransformOptions): TRANSFORM_RESULT; diff --git a/node_modules/jiti/dist/babel.js b/node_modules/jiti/dist/babel.js new file mode 100644 index 0000000..57b1ae6 --- /dev/null +++ b/node_modules/jiti/dist/babel.js @@ -0,0 +1,202 @@ +(()=>{var __webpack_modules__={"./node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/dist/remapping.umd.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=function(traceMapping,genMapping){"use strict";const SOURCELESS_MAPPING=SegmentObject("",-1,-1,"",null,!1),EMPTY_SOURCES=[];function SegmentObject(source,line,column,name,content,ignore){return{source,line,column,name,content,ignore}}function Source(map,sources,source,content,ignore){return{map,sources,source,content,ignore}}function MapSource(map,sources){return Source(map,sources,"",null,!1)}function OriginalSource(source,content,ignore){return Source(null,EMPTY_SOURCES,source,content,ignore)}function traceMappings(tree){const gen=new genMapping.GenMapping({file:tree.map.file}),{sources:rootSources,map}=tree,rootNames=map.names,rootMappings=traceMapping.decodedMappings(map);for(let i=0;inew traceMapping.TraceMap(m,""))),map=maps.pop();for(let i=0;i1)throw new Error(`Transformation map ${i} must have exactly one source file.\nDid you specify these with the most recent transformation maps first?`);let tree=build(map,loader,"",0);for(let i=maps.length-1;i>=0;i--)tree=MapSource(maps[i],[tree]);return tree}function build(map,loader,importer,importerDepth){const{resolvedSources,sourcesContent,ignoreList}=map,depth=importerDepth+1;return MapSource(map,resolvedSources.map(((sourceFile,i)=>{const ctx={importer,depth,source:sourceFile||"",content:void 0,ignore:void 0},sourceMap=loader(ctx.source,ctx),{source,content,ignore}=ctx;return sourceMap?build(new traceMapping.TraceMap(sourceMap,source),loader,source,depth):OriginalSource(source,void 0!==content?content:sourcesContent?sourcesContent[i]:null,void 0!==ignore?ignore:!!ignoreList&&ignoreList.includes(i))})))}class SourceMap{constructor(map,options){const out=options.decodedMappings?genMapping.toDecodedMap(map):genMapping.toEncodedMap(map);this.version=out.version,this.file=out.file,this.mappings=out.mappings,this.names=out.names,this.ignoreList=out.ignoreList,this.sourceRoot=out.sourceRoot,this.sources=out.sources,options.excludeContent||(this.sourcesContent=out.sourcesContent)}toString(){return JSON.stringify(this)}}function remapping(input,loader,options){const opts="object"==typeof options?options:{excludeContent:!!options,decodedMappings:!1},tree=buildSourceMapTree(input,loader);return new SourceMap(traceMappings(tree),opts)}return remapping}(__webpack_require__("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.5/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"))},"./node_modules/.pnpm/@babel+core@7.24.7/node_modules/@babel/core/lib/config/files lazy recursive":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/@babel+core@7.24.7/node_modules/@babel/core/lib/config/files lazy recursive",module.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/@babel+core@7.24.7/node_modules/@babel/core/lib/config/files sync recursive":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/.pnpm/@babel+core@7.24.7/node_modules/@babel/core/lib/config/files sync recursive",module.exports=webpackEmptyContext},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.24.7/node_modules/@babel/plugin-syntax-class-properties/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.24.7/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-class-properties",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("classProperties","classPrivateProperties","classPrivateMethods")}})));exports.default=_default},"./node_modules/.pnpm/@babel+plugin-syntax-export-namespace-from@7.8.3_@babel+core@7.24.7/node_modules/@babel/plugin-syntax-export-namespace-from/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.A=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.24.7/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-export-namespace-from",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("exportNamespaceFrom")}})));exports.A=_default},"./node_modules/.pnpm/@babel+plugin-syntax-nullish-coalescing-operator@7.8.3_@babel+core@7.24.7/node_modules/@babel/plugin-syntax-nullish-coalescing-operator/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.A=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.24.7/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-nullish-coalescing-operator",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("nullishCoalescingOperator")}})));exports.A=_default},"./node_modules/.pnpm/@babel+plugin-syntax-optional-chaining@7.8.3_@babel+core@7.24.7/node_modules/@babel/plugin-syntax-optional-chaining/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.A=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.24.7/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-optional-chaining",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("optionalChaining")}})));exports.A=_default},"./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.5/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js":function(__unused_webpack_module,exports,__webpack_require__){!function(exports,setArray,sourcemapCodec,traceMapping){"use strict";const COLUMN=0,SOURCES_INDEX=1,SOURCE_LINE=2,SOURCE_COLUMN=3,NAMES_INDEX=4,NO_NAME=-1;class GenMapping{constructor({file,sourceRoot}={}){this._names=new setArray.SetArray,this._sources=new setArray.SetArray,this._sourcesContent=[],this._mappings=[],this.file=file,this.sourceRoot=sourceRoot,this._ignoreList=new setArray.SetArray}}function cast(map){return map}function addSegment(map,genLine,genColumn,source,sourceLine,sourceColumn,name,content){return addSegmentInternal(!1,map,genLine,genColumn,source,sourceLine,sourceColumn,name,content)}function addMapping(map,mapping){return addMappingInternal(!1,map,mapping)}const maybeAddSegment=(map,genLine,genColumn,source,sourceLine,sourceColumn,name,content)=>addSegmentInternal(!0,map,genLine,genColumn,source,sourceLine,sourceColumn,name,content),maybeAddMapping=(map,mapping)=>addMappingInternal(!0,map,mapping);function setSourceContent(map,source,content){const{_sources:sources,_sourcesContent:sourcesContent}=cast(map);sourcesContent[setArray.put(sources,source)]=content}function setIgnore(map,source,ignore=!0){const{_sources:sources,_sourcesContent:sourcesContent,_ignoreList:ignoreList}=cast(map),index=setArray.put(sources,source);index===sourcesContent.length&&(sourcesContent[index]=null),ignore?setArray.put(ignoreList,index):setArray.remove(ignoreList,index)}function toDecodedMap(map){const{_mappings:mappings,_sources:sources,_sourcesContent:sourcesContent,_names:names,_ignoreList:ignoreList}=cast(map);return removeEmptyFinalLines(mappings),{version:3,file:map.file||void 0,names:names.array,sourceRoot:map.sourceRoot||void 0,sources:sources.array,sourcesContent,mappings,ignoreList:ignoreList.array}}function toEncodedMap(map){const decoded=toDecodedMap(map);return Object.assign(Object.assign({},decoded),{mappings:sourcemapCodec.encode(decoded.mappings)})}function fromMap(input){const map=new traceMapping.TraceMap(input),gen=new GenMapping({file:map.file,sourceRoot:map.sourceRoot});return putAll(cast(gen)._names,map.names),putAll(cast(gen)._sources,map.sources),cast(gen)._sourcesContent=map.sourcesContent||map.sources.map((()=>null)),cast(gen)._mappings=traceMapping.decodedMappings(map),map.ignoreList&&putAll(cast(gen)._ignoreList,map.ignoreList),gen}function allMappings(map){const out=[],{_mappings:mappings,_sources:sources,_names:names}=cast(map);for(let i=0;i=0&&!(genColumn>=line[i][COLUMN]);index=i--);return index}function insert(array,index,value){for(let i=array.length;i>index;i--)array[i]=array[i-1];array[index]=value}function removeEmptyFinalLines(mappings){const{length}=mappings;let len=length;for(let i=len-1;i>=0&&!(mappings[i].length>0);len=i,i--);leninputType&&(inputType=baseType)}normalizePath(url,inputType);const queryHash=url.query+url.hash;switch(inputType){case 2:case 3:return queryHash;case 4:{const path=url.path.slice(1);return path?isRelative(base||input)&&!isRelative(path)?"./"+path+queryHash:path+queryHash:queryHash||"."}case 5:return url.path+queryHash;default:return url.scheme+"//"+url.user+url.host+url.port+url.path+queryHash}}return resolve}()},"./node_modules/.pnpm/@jridgewell+set-array@1.2.1/node_modules/@jridgewell/set-array/dist/set-array.umd.js":function(__unused_webpack_module,exports){!function(exports){"use strict";class SetArray{constructor(){this._indexes={__proto__:null},this.array=[]}}function cast(set){return set}function get(setarr,key){return cast(setarr)._indexes[key]}function put(setarr,key){const index=get(setarr,key);if(void 0!==index)return index;const{array,_indexes:indexes}=cast(setarr),length=array.push(key);return indexes[key]=length-1}function pop(setarr){const{array,_indexes:indexes}=cast(setarr);0!==array.length&&(indexes[array.pop()]=void 0)}function remove(setarr,key){const index=get(setarr,key);if(void 0===index)return;const{array,_indexes:indexes}=cast(setarr);for(let i=index+1;iBuffer.from(buf.buffer,buf.byteOffset,buf.byteLength).toString()}:{decode(buf){let out="";for(let i=0;i>>=1,shouldNegate&&(value=-2147483648|-value),state[j]+=value,pos}function hasMoreVlq(mappings,i,length){return!(i>=length)&&mappings.charCodeAt(i)!==comma}function sort(line){line.sort(sortComparator)}function sortComparator(a,b){return a[0]-b[0]}function encode(decoded){const state=new Int32Array(5),bufLength=16384,subLength=bufLength-36,buf=new Uint8Array(bufLength),sub=buf.subarray(0,subLength);let pos=0,out="";for(let i=0;i0&&(pos===bufLength&&(out+=td.decode(buf),pos=0),buf[pos++]=semicolon),0!==line.length){state[0]=0;for(let j=0;jsubLength&&(out+=td.decode(sub),buf.copyWithin(0,subLength,pos),pos-=subLength),j>0&&(buf[pos++]=comma),pos=encodeInteger(buf,pos,state,segment,0),1!==segment.length&&(pos=encodeInteger(buf,pos,state,segment,1),pos=encodeInteger(buf,pos,state,segment,2),pos=encodeInteger(buf,pos,state,segment,3),4!==segment.length&&(pos=encodeInteger(buf,pos,state,segment,4)))}}}return out+td.decode(buf.subarray(0,pos))}function encodeInteger(buf,pos,state,segment,j){const next=segment[j];let num=next-state[j];state[j]=next,num=num<0?-num<<1|1:num<<1;do{let clamped=31#num>>>=5,num>0&&(clamped|=32),buf[pos++]=intToChar[clamped]}while(num>0);return pos}exports.decode=decode,exports.encode=encode,Object.defineProperty(exports,"__esModule",{value:!0})}(exports)},"./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js":function(__unused_webpack_module,exports,__webpack_require__){!function(exports,sourcemapCodec,resolveUri){"use strict";function resolve(input,base){return base&&!base.endsWith("/")&&(base+="/"),resolveUri(input,base)}function stripFilename(path){if(!path)return"";const index=path.lastIndexOf("/");return path.slice(0,index+1)}const COLUMN=0,SOURCES_INDEX=1,SOURCE_LINE=2,SOURCE_COLUMN=3,NAMES_INDEX=4,REV_GENERATED_LINE=1,REV_GENERATED_COLUMN=2;function maybeSort(mappings,owned){const unsortedIndex=nextUnsortedSegmentLine(mappings,0);if(unsortedIndex===mappings.length)return mappings;owned||(mappings=mappings.slice());for(let i=unsortedIndex;i>1),cmp=haystack[mid][COLUMN]-needle;if(0===cmp)return found=!0,mid;cmp<0?low=mid+1:high=mid-1}return found=!1,low-1}function upperBound(haystack,needle,index){for(let i=index+1;i=0&&haystack[i][COLUMN]===needle;index=i--);return index}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function memoizedBinarySearch(haystack,needle,state,key){const{lastKey,lastNeedle,lastIndex}=state;let low=0,high=haystack.length-1;if(key===lastKey){if(needle===lastNeedle)return found=-1!==lastIndex&&haystack[lastIndex][COLUMN]===needle,lastIndex;needle>=lastNeedle?low=-1===lastIndex?0:lastIndex:high=lastIndex}return state.lastKey=key,state.lastNeedle=needle,state.lastIndex=binarySearch(haystack,needle,low,high)}function buildBySources(decoded,memos){const sources=memos.map(buildNullArray);for(let i=0;iindex;i--)array[i]=array[i-1];array[index]=value}function buildNullArray(){return{__proto__:null}}const AnyMap=function(map,mapUrl){const parsed=parse(map);if(!("sections"in parsed))return new TraceMap(parsed,mapUrl);const mappings=[],sources=[],sourcesContent=[],names=[],ignoreList=[];return recurse(parsed,mapUrl,mappings,sources,sourcesContent,names,ignoreList,0,0,1/0,1/0),presortedDecodedMap({version:3,file:parsed.file,names,sources,sourcesContent,mappings,ignoreList})};function parse(map){return"string"==typeof map?JSON.parse(map):map}function recurse(input,mapUrl,mappings,sources,sourcesContent,names,ignoreList,lineOffset,columnOffset,stopLine,stopColumn){const{sections}=input;for(let i=0;istopLine)return;const out=getLine(mappings,lineI),cOffset=0===i?columnOffset:0,line=decoded[i];for(let j=0;j=stopColumn)return;if(1===seg.length){out.push([column]);continue}const sourcesIndex=sourcesOffset+seg[SOURCES_INDEX],sourceLine=seg[SOURCE_LINE],sourceColumn=seg[SOURCE_COLUMN];out.push(4===seg.length?[column,sourcesIndex,sourceLine,sourceColumn]:[column,sourcesIndex,sourceLine,sourceColumn,namesOffset+seg[NAMES_INDEX]])}}}function append(arr,other){for(let i=0;iresolve(s||"",from)));const{mappings}=parsed;"string"==typeof mappings?(this._encoded=mappings,this._decoded=void 0):(this._encoded=void 0,this._decoded=maybeSort(mappings,isString)),this._decodedMemo=memoizedState(),this._bySources=void 0,this._bySourceMemos=void 0}}function cast(map){return map}function encodedMappings(map){var _a,_b;return null!==(_a=(_b=cast(map))._encoded)&&void 0!==_a?_a:_b._encoded=sourcemapCodec.encode(cast(map)._decoded)}function decodedMappings(map){var _a;return(_a=cast(map))._decoded||(_a._decoded=sourcemapCodec.decode(cast(map)._encoded))}function traceSegment(map,line,column){const decoded=decodedMappings(map);if(line>=decoded.length)return null;const segments=decoded[line],index=traceSegmentInternal(segments,cast(map)._decodedMemo,line,column,GREATEST_LOWER_BOUND);return-1===index?null:segments[index]}function originalPositionFor(map,needle){let{line,column,bias}=needle;if(line--,line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const decoded=decodedMappings(map);if(line>=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line],index=traceSegmentInternal(segments,cast(map)._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(-1===index)return OMapping(null,null,null,null);const segment=segments[index];if(1===segment.length)return OMapping(null,null,null,null);const{names,resolvedSources}=map;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],5===segment.length?names[segment[NAMES_INDEX]]:null)}function generatedPositionFor(map,needle){const{source,line,column,bias}=needle;return generatedPosition(map,source,line,column,bias||GREATEST_LOWER_BOUND,!1)}function allGeneratedPositionsFor(map,needle){const{source,line,column,bias}=needle;return generatedPosition(map,source,line,column,bias||LEAST_UPPER_BOUND,!0)}function eachMapping(map,cb){const decoded=decodedMappings(map),{names,resolvedSources}=map;for(let i=0;i{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(api){var transformImport=(0,_utils.createDynamicImportTransform)(api);return{manipulateOptions:function(opts,parserOpts){parserOpts.plugins.push("dynamicImport")},visitor:{Import:function(path){transformImport(this,path)}}}};var _utils=__webpack_require__("./node_modules/.pnpm/babel-plugin-dynamic-import-node@2.3.3/node_modules/babel-plugin-dynamic-import-node/lib/utils.js");module.exports=exports.default},"./node_modules/.pnpm/babel-plugin-dynamic-import-node@2.3.3/node_modules/babel-plugin-dynamic-import-node/lib/utils.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function getImportSource(t,callNode){var importArguments=callNode.arguments,importPath=_slicedToArray(importArguments,1)[0];return t.isStringLiteral(importPath)||t.isTemplateLiteral(importPath)?(t.removeComments(importPath),importPath):t.templateLiteral([t.templateElement({raw:"",cooked:""}),t.templateElement({raw:"",cooked:""},!0)],importArguments)}exports.getImportSource=getImportSource,exports.createDynamicImportTransform=function(_ref){var template=_ref.template,t=_ref.types,builders={static:{interop:template("Promise.resolve().then(() => INTEROP(require(SOURCE)))"),noInterop:template("Promise.resolve().then(() => require(SOURCE))")},dynamic:{interop:template("Promise.resolve(SOURCE).then(s => INTEROP(require(s)))"),noInterop:template("Promise.resolve(SOURCE).then(s => require(s))")}},visited="function"==typeof WeakSet&&new WeakSet;return function(context,path){if(visited){if(visited.has(path))return;visited.add(path)}var node,SOURCE=getImportSource(t,path.parent),builder=(node=SOURCE,t.isStringLiteral(node)||t.isTemplateLiteral(node)&&0===node.expressions.length?builders.static:builders.dynamic),newImport=context.opts.noInterop?builder.noInterop({SOURCE}):builder.interop({SOURCE,INTEROP:context.addHelper("interopRequireWildcard")});path.parentPath.replaceWith(newImport)}}},"./node_modules/.pnpm/babel-plugin-parameter-decorator@1.0.16/node_modules/babel-plugin-parameter-decorator/lib/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";var _path=__webpack_require__("path");function isInType(path){switch(path.parent.type){case"TSTypeReference":case"TSQualifiedName":case"TSExpressionWithTypeArguments":case"TSTypeQuery":return!0;default:return!1}}module.exports=function(_ref){var types=_ref.types,decoratorExpressionForConstructor=function(decorator,param){return function(className){var resultantDecorator=types.callExpression(decorator.expression,[types.Identifier(className),types.Identifier("undefined"),types.NumericLiteral(param.key)]),resultantDecoratorWithFallback=types.logicalExpression("||",resultantDecorator,types.Identifier(className)),assignment=types.assignmentExpression("=",types.Identifier(className),resultantDecoratorWithFallback);return types.expressionStatement(assignment)}},decoratorExpressionForMethod=function(decorator,param){return function(className,functionName){var resultantDecorator=types.callExpression(decorator.expression,[types.Identifier("".concat(className,".prototype")),types.StringLiteral(functionName),types.NumericLiteral(param.key)]);return types.expressionStatement(resultantDecorator)}};return{visitor:{Program:function(path,state){var extension=(0,_path.extname)(state.file.opts.filename);".ts"!==extension&&".tsx"!==extension||function(){var decorators=Object.create(null);path.node.body.filter((function(it){var type=it.type,declaration=it.declaration;switch(type){case"ClassDeclaration":return!0;case"ExportNamedDeclaration":case"ExportDefaultDeclaration":return declaration&&"ClassDeclaration"===declaration.type;default:return!1}})).map((function(it){return"ClassDeclaration"===it.type?it:it.declaration})).forEach((function(clazz){clazz.body.body.forEach((function(body){(body.params||[]).forEach((function(param){(param.decorators||[]).forEach((function(decorator){decorator.expression.callee?decorators[decorator.expression.callee.name]=decorator:decorators[decorator.expression.name]=decorator}))}))}))}));var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=path.get("body")[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var stmt=_step.value;if("ImportDeclaration"===stmt.node.type){if(0===stmt.node.specifiers.length)continue;var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_loop=function(){var specifier=_step2.value,binding=stmt.scope.getBinding(specifier.local.name);binding.referencePaths.length?binding.referencePaths.reduce((function(prev,next){return prev||isInType(next)}),!1)&&Object.keys(decorators).forEach((function(k){var decorator=decorators[k];(decorator.expression.arguments||[]).forEach((function(arg){arg.name===specifier.local.name&&binding.referencePaths.push({parent:decorator.expression})}))})):decorators[specifier.local.name]&&binding.referencePaths.push({parent:decorators[specifier.local.name]})},_iterator2=stmt.node.specifiers[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0)_loop()}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}}()},Function:function(path){var functionName="";path.node.id?functionName=path.node.id.name:path.node.key&&(functionName=path.node.key.name),(path.get("params")||[]).slice().forEach((function(param){var decorators=param.node.decorators||[],transformable=decorators.length;if(decorators.slice().forEach((function(decorator){if("ClassMethod"===path.type){var classIdentifier,parentNode=path.parentPath.parentPath,classDeclaration=path.findParent((function(p){return"ClassDeclaration"===p.type}));if(classDeclaration?classIdentifier=classDeclaration.node.id.name:(parentNode.insertAfter(null),classIdentifier=function(path){var assignment=path.findParent((function(p){return"AssignmentExpression"===p.node.type}));return"SequenceExpression"===assignment.node.right.type?assignment.node.right.expressions[1].name:"ClassExpression"===assignment.node.right.type?assignment.node.left.name:null}(path)),"constructor"===functionName){var expression=decoratorExpressionForConstructor(decorator,param)(classIdentifier);parentNode.insertAfter(expression)}else{var _expression=decoratorExpressionForMethod(decorator,param)(classIdentifier,functionName);parentNode.insertAfter(_expression)}}else{var className=path.findParent((function(p){return"VariableDeclarator"===p.node.type})).node.id.name;if(functionName===className){var _expression2=decoratorExpressionForConstructor(decorator,param)(className);if("body"===path.parentKey)path.insertAfter(_expression2);else path.findParent((function(p){return"body"===p.parentKey})).insertAfter(_expression2)}else{var classParent=path.findParent((function(p){return"CallExpression"===p.node.type})),_expression3=decoratorExpressionForMethod(decorator,param)(className,functionName);classParent.insertAfter(_expression3)}}})),transformable){var replacement=function(path){switch(path.node.type){case"ObjectPattern":return types.ObjectPattern(path.node.properties);case"AssignmentPattern":return types.AssignmentPattern(path.node.left,path.node.right);case"TSParameterProperty":return types.Identifier(path.node.parameter.name);default:return types.Identifier(path.node.name)}}(param);param.replaceWith(replacement)}}))}}}}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.24.7_@babel+traverse@7.24.7/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/metadataVisitor.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.metadataVisitor=function(classPath,path){const field=path.node,classNode=classPath.node;switch(field.type){case"ClassMethod":const decorators="constructor"===field.kind?classNode.decorators:field.decorators;if(!decorators||0===decorators.length)return;decorators.push(createMetadataDesignDecorator("design:type",_core.types.identifier("Function"))),decorators.push(createMetadataDesignDecorator("design:paramtypes",_core.types.arrayExpression(field.params.map((param=>(0,_serializeType.serializeType)(classPath,param))))));break;case"ClassProperty":if(!field.decorators||0===field.decorators.length)return;if(!field.typeAnnotation||"TSTypeAnnotation"!==field.typeAnnotation.type)return;field.decorators.push(createMetadataDesignDecorator("design:type",(0,_serializeType.serializeType)(classPath,field)))}};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.24.7/node_modules/@babel/core/lib/index.js"),_serializeType=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.24.7_@babel+traverse@7.24.7/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/serializeType.js");function createMetadataDesignDecorator(design,typeArg){return _core.types.decorator(_core.types.callExpression(_core.types.memberExpression(_core.types.identifier("Reflect"),_core.types.identifier("metadata")),[_core.types.stringLiteral(design),typeArg]))}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.24.7_@babel+traverse@7.24.7/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/serializeType.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.serializeType=function(classPath,param){const node=getTypedNode(param);if(null==node)return createVoidZero();if(!node.typeAnnotation||"TSTypeAnnotation"!==node.typeAnnotation.type)return createVoidZero();const annotation=node.typeAnnotation.typeAnnotation;return serializeTypeNode(classPath.node.id?classPath.node.id.name:"",annotation)},exports.isClassType=isClassType;var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.24.7/node_modules/@babel/core/lib/index.js");function createVoidZero(){return _core.types.unaryExpression("void",_core.types.numericLiteral(0))}function getTypedNode(param){return null==param?null:"ClassProperty"===param.type||"Identifier"===param.type||"ObjectPattern"===param.type?param:"AssignmentPattern"===param.type&&"Identifier"===param.left.type?param.left:"TSParameterProperty"===param.type?getTypedNode(param.parameter):null}function serializeTypeReferenceNode(className,node){const reference=serializeReference(node.typeName);return isClassType(className,reference)?_core.types.identifier("Object"):_core.types.conditionalExpression(_core.types.binaryExpression("===",_core.types.unaryExpression("typeof",reference),_core.types.stringLiteral("undefined")),_core.types.identifier("Object"),_core.types.cloneDeep(reference))}function isClassType(className,node){switch(node.type){case"Identifier":return node.name===className;case"MemberExpression":return isClassType(className,node.object);default:throw new Error(`The property expression at ${node.start} is not valid as a Type to be used in Reflect.metadata`)}}function serializeReference(typeName){return"Identifier"===typeName.type?_core.types.identifier(typeName.name):_core.types.memberExpression(serializeReference(typeName.left),typeName.right)}function serializeTypeNode(className,node){if(void 0===node)return _core.types.identifier("Object");switch(node.type){case"TSVoidKeyword":case"TSUndefinedKeyword":case"TSNullKeyword":case"TSNeverKeyword":return createVoidZero();case"TSParenthesizedType":return serializeTypeNode(className,node.typeAnnotation);case"TSFunctionType":case"TSConstructorType":return _core.types.identifier("Function");case"TSArrayType":case"TSTupleType":return _core.types.identifier("Array");case"TSTypePredicate":case"TSBooleanKeyword":return _core.types.identifier("Boolean");case"TSStringKeyword":return _core.types.identifier("String");case"TSObjectKeyword":return _core.types.identifier("Object");case"TSLiteralType":switch(node.literal.type){case"StringLiteral":return _core.types.identifier("String");case"NumericLiteral":return _core.types.identifier("Number");case"BooleanLiteral":return _core.types.identifier("Boolean");default:throw new Error("Bad type for decorator"+node.literal)}case"TSNumberKeyword":case"TSBigIntKeyword":return _core.types.identifier("Number");case"TSSymbolKeyword":return _core.types.identifier("Symbol");case"TSTypeReference":return serializeTypeReferenceNode(className,node);case"TSIntersectionType":case"TSUnionType":return serializeTypeList(className,node.types);case"TSConditionalType":return serializeTypeList(className,[node.trueType,node.falseType]);case"TSTypeQuery":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSTypeLiteral":case"TSAnyKeyword":case"TSUnknownKeyword":case"TSThisType":break;default:throw new Error("Bad type for decorator")}return _core.types.identifier("Object")}function serializeTypeList(className,types){let serializedUnion;for(let typeNode of types){for(;"TSParenthesizedType"===typeNode.type;)typeNode=typeNode.typeAnnotation;if("TSNeverKeyword"===typeNode.type)continue;if("TSNullKeyword"===typeNode.type||"TSUndefinedKeyword"===typeNode.type)continue;const serializedIndividual=serializeTypeNode(className,typeNode);if(_core.types.isIdentifier(serializedIndividual)&&"Object"===serializedIndividual.name)return serializedIndividual;if(serializedUnion){if(!_core.types.isIdentifier(serializedUnion)||!_core.types.isIdentifier(serializedIndividual)||serializedUnion.name!==serializedIndividual.name)return _core.types.identifier("Object")}else serializedUnion=serializedIndividual}return serializedUnion||createVoidZero()}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.24.7_@babel+traverse@7.24.7/node_modules/babel-plugin-transform-typescript-metadata/lib/parameter/parameterVisitor.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parameterVisitor=function(classPath,path){if("ClassMethod"!==path.type)return;if("ClassMethod"!==path.node.type)return;if("Identifier"!==path.node.key.type)return;const methodPath=path;(methodPath.get("params")||[]).slice().forEach((function(param){let resultantDecorator;null!=("Identifier"===param.node.type||"ObjectPattern"===param.node.type?param.node:"TSParameterProperty"===param.node.type&&"Identifier"===param.node.parameter.type?param.node.parameter:null)&&((param.node.decorators||[]).slice().forEach((function(decorator){"constructor"===methodPath.node.kind?(resultantDecorator=createParamDecorator(param.key,decorator.expression,!0),classPath.node.decorators||(classPath.node.decorators=[]),classPath.node.decorators.push(resultantDecorator)):(resultantDecorator=createParamDecorator(param.key,decorator.expression,!1),methodPath.node.decorators||(methodPath.node.decorators=[]),methodPath.node.decorators.push(resultantDecorator))})),resultantDecorator&&(param.node.decorators=null))}))};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.24.7/node_modules/@babel/core/lib/index.js");function createParamDecorator(paramIndex,decoratorExpression,isConstructor=!1){return _core.types.decorator(_core.types.functionExpression(null,[_core.types.identifier("target"),_core.types.identifier("key")],_core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(decoratorExpression,[_core.types.identifier("target"),_core.types.identifier(isConstructor?"undefined":"key"),_core.types.numericLiteral(paramIndex)]))])))}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.24.7_@babel+traverse@7.24.7/node_modules/babel-plugin-transform-typescript-metadata/lib/plugin.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _helperPluginUtils=__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.24.7/node_modules/@babel/helper-plugin-utils/lib/index.js"),_parameterVisitor=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.24.7_@babel+traverse@7.24.7/node_modules/babel-plugin-transform-typescript-metadata/lib/parameter/parameterVisitor.js"),_metadataVisitor=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.24.7_@babel+traverse@7.24.7/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/metadataVisitor.js"),_default=(0,_helperPluginUtils.declare)((api=>(api.assertVersion(7),{visitor:{Program(programPath){programPath.traverse({ClassDeclaration(path){for(const field of path.get("body").get("body"))"ClassMethod"!==field.type&&"ClassProperty"!==field.type||((0,_parameterVisitor.parameterVisitor)(path,field),(0,_metadataVisitor.metadataVisitor)(path,field));path.parentPath.scope.crawl()}})}}})));exports.default=_default},"./node_modules/.pnpm/convert-source-map@2.0.0/node_modules/convert-source-map/index.js":(__unused_webpack_module,exports)=>{"use strict";var decodeBase64;function Converter(sm,opts){(opts=opts||{}).hasComment&&(sm=function(sm){return sm.split(",").pop()}(sm)),"base64"===opts.encoding?sm=decodeBase64(sm):"uri"===opts.encoding&&(sm=decodeURIComponent(sm)),(opts.isJSON||opts.encoding)&&(sm=JSON.parse(sm)),this.sourcemap=sm}function makeConverter(sm){return new Converter(sm,{isJSON:!0})}Object.defineProperty(exports,"commentRegex",{get:function(){return/^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/gm}}),Object.defineProperty(exports,"mapFileCommentRegex",{get:function(){return/(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/gm}}),decodeBase64="undefined"!=typeof Buffer?"function"==typeof Buffer.from?function(base64){return Buffer.from(base64,"base64").toString()}:function(base64){if("number"==typeof value)throw new TypeError("The value to decode must not be of type number.");return new Buffer(base64,"base64").toString()}:function(base64){return decodeURIComponent(escape(atob(base64)))},Converter.prototype.toJSON=function(space){return JSON.stringify(this.sourcemap,null,space)},"undefined"!=typeof Buffer?"function"==typeof Buffer.from?Converter.prototype.toBase64=function(){var json=this.toJSON();return Buffer.from(json,"utf8").toString("base64")}:Converter.prototype.toBase64=function(){var json=this.toJSON();if("number"==typeof json)throw new TypeError("The json to encode must not be of type number.");return new Buffer(json,"utf8").toString("base64")}:Converter.prototype.toBase64=function(){var json=this.toJSON();return btoa(unescape(encodeURIComponent(json)))},Converter.prototype.toURI=function(){var json=this.toJSON();return encodeURIComponent(json)},Converter.prototype.toComment=function(options){var encoding,content,data;return null!=options&&"uri"===options.encoding?(encoding="",content=this.toURI()):(encoding=";base64",content=this.toBase64()),data="sourceMappingURL=data:application/json;charset=utf-8"+encoding+","+content,null!=options&&options.multiline?"/*# "+data+" */":"//# "+data},Converter.prototype.toObject=function(){return JSON.parse(this.toJSON())},Converter.prototype.addProperty=function(key,value){if(this.sourcemap.hasOwnProperty(key))throw new Error('property "'+key+'" already exists on the sourcemap, use set property instead');return this.setProperty(key,value)},Converter.prototype.setProperty=function(key,value){return this.sourcemap[key]=value,this},Converter.prototype.getProperty=function(key){return this.sourcemap[key]},exports.fromObject=function(obj){return new Converter(obj)},exports.fromJSON=function(json){return new Converter(json,{isJSON:!0})},exports.fromURI=function(uri){return new Converter(uri,{encoding:"uri"})},exports.fromBase64=function(base64){return new Converter(base64,{encoding:"base64"})},exports.fromComment=function(comment){var m;return new Converter(comment=comment.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),{encoding:(m=exports.commentRegex.exec(comment))&&m[4]||"uri",hasComment:!0})},exports.fromMapFileComment=function(comment,read){if("string"==typeof read)throw new Error("String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var sm=function(sm,read){var r=exports.mapFileCommentRegex.exec(sm),filename=r[1]||r[2];try{return null!=(sm=read(filename))&&"function"==typeof sm.catch?sm.catch(throwError):sm}catch(e){throwError(e)}function throwError(e){throw new Error("An error occurred while trying to read the map file at "+filename+"\n"+e.stack)}}(comment,read);return null!=sm&&"function"==typeof sm.then?sm.then(makeConverter):makeConverter(sm)},exports.fromSource=function(content){var m=content.match(exports.commentRegex);return m?exports.fromComment(m.pop()):null},exports.fromMapFileSource=function(content,read){if("string"==typeof read)throw new Error("String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var m=content.match(exports.mapFileCommentRegex);return m?exports.fromMapFileComment(m.pop(),read):null},exports.removeComments=function(src){return src.replace(exports.commentRegex,"")},exports.removeMapFileComments=function(src){return src.replace(exports.mapFileCommentRegex,"")},exports.generateMapFileComment=function(file,options){var data="sourceMappingURL="+file;return options&&options.multiline?"/*# "+data+" */":"//# "+data}},"./node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js":(module,exports,__webpack_require__)=>{exports.formatArgs=function(args){if(args[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+args[0]+(this.useColors?"%c ":" ")+"+"+module.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;args.splice(1,0,c,"color: inherit");let index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,(match=>{"%%"!==match&&(index++,"%c"===match&&(lastC=index))})),args.splice(lastC,0,c)},exports.save=function(namespaces){try{namespaces?exports.storage.setItem("debug",namespaces):exports.storage.removeItem("debug")}catch(error){}},exports.load=function(){let r;try{r=exports.storage.getItem("debug")}catch(error){}!r&&"undefined"!=typeof process&&"env"in process&&(r=process.env.DEBUG);return r},exports.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},exports.storage=function(){try{return localStorage}catch(error){}}(),exports.destroy=(()=>{let warned=!1;return()=>{warned||(warned=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),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"],exports.log=console.debug||console.log||(()=>{}),module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js")(exports);const{formatters}=module.exports;formatters.j=function(v){try{return JSON.stringify(v)}catch(error){return"[UnexpectedJSONParseError]: "+error.message}}},"./node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=function(env){function createDebug(namespace){let prevTime,namespacesCache,enabledCache,enableOverride=null;function debug(...args){if(!debug.enabled)return;const self=debug,curr=Number(new Date),ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr,args[0]=createDebug.coerce(args[0]),"string"!=typeof args[0]&&args.unshift("%O");let index=0;args[0]=args[0].replace(/%([a-zA-Z%])/g,((match,format)=>{if("%%"===match)return"%";index++;const formatter=createDebug.formatters[format];if("function"==typeof formatter){const val=args[index];match=formatter.call(self,val),args.splice(index,1),index--}return match})),createDebug.formatArgs.call(self,args);(self.log||createDebug.log).apply(self,args)}return debug.namespace=namespace,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(namespace),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==enableOverride?enableOverride:(namespacesCache!==createDebug.namespaces&&(namespacesCache=createDebug.namespaces,enabledCache=createDebug.enabled(namespace)),enabledCache),set:v=>{enableOverride=v}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(namespace,delimiter){const newDebug=createDebug(this.namespace+(void 0===delimiter?":":delimiter)+namespace);return newDebug.log=this.log,newDebug}function toNamespace(regexp){return regexp.toString().substring(2,regexp.toString().length-2).replace(/\.\*\?$/,"*")}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=function(val){if(val instanceof Error)return val.stack||val.message;return val},createDebug.disable=function(){const namespaces=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((namespace=>"-"+namespace))].join(",");return createDebug.enable(""),namespaces},createDebug.enable=function(namespaces){let i;createDebug.save(namespaces),createDebug.namespaces=namespaces,createDebug.names=[],createDebug.skips=[];const split=("string"==typeof namespaces?namespaces:"").split(/[\s,]+/),len=split.length;for(i=0;i{createDebug[key]=env[key]})),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function(namespace){let hash=0;for(let i=0;i{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js"):module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js")},"./node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js":(module,exports,__webpack_require__)=>{const tty=__webpack_require__("tty"),util=__webpack_require__("util");exports.init=function(debug){debug.inspectOpts={};const keys=Object.keys(exports.inspectOpts);for(let i=0;i{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),exports.colors=[6,2,3,4,5,1];try{const supportsColor=__webpack_require__("./node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");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){}exports.inspectOpts=Object.keys(process.env).filter((key=>/^debug_/i.test(key))).reduce(((obj,key)=>{const prop=key.substring(6).toLowerCase().replace(/_([a-z])/g,((_,k)=>k.toUpperCase()));let val=process.env[key];return val=!!/^(yes|on|true|enabled)$/i.test(val)||!/^(no|off|false|disabled)$/i.test(val)&&("null"===val?null:Number(val)),obj[prop]=val,obj}),{}),module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js")(exports);const{formatters}=module.exports;formatters.o=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts).split("\n").map((str=>str.trim())).join(" ")},formatters.O=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts)}},"./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js":module=>{"use strict";const GENSYNC_START=Symbol.for("gensync:v1:start"),GENSYNC_SUSPEND=Symbol.for("gensync:v1:suspend"),GENSYNC_EXPECTED_START="GENSYNC_EXPECTED_START",GENSYNC_EXPECTED_SUSPEND="GENSYNC_EXPECTED_SUSPEND",GENSYNC_OPTIONS_ERROR="GENSYNC_OPTIONS_ERROR";function assertTypeof(type,name,value,allowUndefined){if(typeof value===type||allowUndefined&&void 0===value)return;let msg;throw msg=allowUndefined?`Expected opts.${name} to be either a ${type}, or undefined.`:`Expected opts.${name} to be a ${type}.`,makeError(msg,GENSYNC_OPTIONS_ERROR)}function makeError(msg,code){return Object.assign(new Error(msg),{code})}function buildOperation({name,arity,sync,async}){return setFunctionMetadata(name,arity,(function*(...args){const resume=yield GENSYNC_START;if(!resume){return sync.call(this,args)}let result;try{async.call(this,args,(value=>{result||(result={value},resume())}),(err=>{result||(result={err},resume())}))}catch(err){result={err},resume()}if(yield GENSYNC_SUSPEND,result.hasOwnProperty("err"))throw result.err;return result.value}))}function evaluateSync(gen){let value;for(;!({value}=gen.next()).done;)assertStart(value,gen);return value}function evaluateAsync(gen,resolve,reject){!function step(){try{let value;for(;!({value}=gen.next()).done;){assertStart(value,gen);let sync=!0,didSyncResume=!1;const out=gen.next((()=>{sync?didSyncResume=!0:step()}));if(sync=!1,assertSuspend(out,gen),!didSyncResume)return}return resolve(value)}catch(err){return reject(err)}}()}function assertStart(value,gen){value!==GENSYNC_START&&throwError(gen,makeError(`Got unexpected yielded value in gensync generator: ${JSON.stringify(value)}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,GENSYNC_EXPECTED_START))}function assertSuspend({value,done},gen){(done||value!==GENSYNC_SUSPEND)&&throwError(gen,makeError(done?"Unexpected generator completion. If you get this, it is probably a gensync bug.":`Expected GENSYNC_SUSPEND, got ${JSON.stringify(value)}. If you get this, it is probably a gensync bug.`,GENSYNC_EXPECTED_SUSPEND))}function throwError(gen,err){throw gen.throw&&gen.throw(err),err}function setFunctionMetadata(name,arity,fn){if("string"==typeof name){const nameDesc=Object.getOwnPropertyDescriptor(fn,"name");nameDesc&&!nameDesc.configurable||Object.defineProperty(fn,"name",Object.assign(nameDesc||{},{configurable:!0,value:name}))}if("number"==typeof arity){const lengthDesc=Object.getOwnPropertyDescriptor(fn,"length");lengthDesc&&!lengthDesc.configurable||Object.defineProperty(fn,"length",Object.assign(lengthDesc||{},{configurable:!0,value:arity}))}return fn}module.exports=Object.assign((function(optsOrFn){let genFn=optsOrFn;return genFn="function"!=typeof optsOrFn?function({name,arity,sync,async,errback}){if(assertTypeof("string","name",name,!0),assertTypeof("number","arity",arity,!0),assertTypeof("function","sync",sync),assertTypeof("function","async",async,!0),assertTypeof("function","errback",errback,!0),async&&errback)throw makeError("Expected one of either opts.async or opts.errback, but got _both_.",GENSYNC_OPTIONS_ERROR);if("string"!=typeof name){let fnName;errback&&errback.name&&"errback"!==errback.name&&(fnName=errback.name),async&&async.name&&"async"!==async.name&&(fnName=async.name.replace(/Async$/,"")),sync&&sync.name&&"sync"!==sync.name&&(fnName=sync.name.replace(/Sync$/,"")),"string"==typeof fnName&&(name=fnName)}"number"!=typeof arity&&(arity=sync.length);return buildOperation({name,arity,sync:function(args){return sync.apply(this,args)},async:function(args,resolve,reject){async?async.apply(this,args).then(resolve,reject):errback?errback.call(this,...args,((err,value)=>{null==err?resolve(value):reject(err)})):resolve(sync.apply(this,args))}})}(optsOrFn):function(genFn){return setFunctionMetadata(genFn.name,genFn.length,(function(...args){return genFn.apply(this,args)}))}(optsOrFn),Object.assign(genFn,function(genFn){const fns={sync:function(...args){return evaluateSync(genFn.apply(this,args))},async:function(...args){return new Promise(((resolve,reject)=>{evaluateAsync(genFn.apply(this,args),resolve,reject)}))},errback:function(...args){const cb=args.pop();if("function"!=typeof cb)throw makeError("Asynchronous function called without callback","GENSYNC_ERRBACK_NO_CALLBACK");let gen;try{gen=genFn.apply(this,args)}catch(err){return void cb(err)}evaluateAsync(gen,(val=>cb(void 0,val)),(err=>cb(err)))}};return fns}(genFn))}),{all:buildOperation({name:"all",arity:1,sync:function(args){return Array.from(args[0]).map((item=>evaluateSync(item)))},async:function(args,resolve,reject){const items=Array.from(args[0]);if(0===items.length)return void Promise.resolve().then((()=>resolve([])));let count=0;const results=items.map((()=>{}));items.forEach(((item,i)=>{evaluateAsync(item,(val=>{results[i]=val,count+=1,count===results.length&&resolve(results)}),reject)}))}}),race:buildOperation({name:"race",arity:1,sync:function(args){const items=Array.from(args[0]);if(0===items.length)throw makeError("Must race at least 1 item","GENSYNC_RACE_NONEMPTY");return evaluateSync(items[0])},async:function(args,resolve,reject){const items=Array.from(args[0]);if(0===items.length)throw makeError("Must race at least 1 item","GENSYNC_RACE_NONEMPTY");for(const item of items)evaluateAsync(item,resolve,reject)}})})},"./node_modules/.pnpm/globals@11.12.0/node_modules/globals/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=__webpack_require__("./node_modules/.pnpm/globals@11.12.0/node_modules/globals/globals.json")},"./node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js":module=>{"use strict";module.exports=(flag,argv=process.argv)=>{const prefix=flag.startsWith("-")?"":1===flag.length?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return-1!==position&&(-1===terminatorPosition||position{"use strict";const object={},hasOwnProperty=object.hasOwnProperty,forOwn=(object,callback)=>{for(const key in object)hasOwnProperty.call(object,key)&&callback(key,object[key])},toString=object.toString,isArray=Array.isArray,isBuffer=Buffer.isBuffer,singleEscapes={'"':'\\"',"'":"\\'","\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},regexSingleEscape=/["'\\\b\f\n\r\t]/,regexDigit=/[0-9]/,regexWhitelist=/[ !#-&\(-\[\]-_a-~]/,jsesc=(argument,options)=>{const increaseIndentation=()=>{oldIndent=indent,++options.indentLevel,indent=options.indent.repeat(options.indentLevel)},defaults={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",indentLevel:0,__inline1__:!1,__inline2__:!1},json=options&&options.json;var destination,source;json&&(defaults.quotes="double",defaults.wrap=!0),destination=defaults,"single"!=(options=(source=options)?(forOwn(source,((key,value)=>{destination[key]=value})),destination):destination).quotes&&"double"!=options.quotes&&"backtick"!=options.quotes&&(options.quotes="single");const quote="double"==options.quotes?'"':"backtick"==options.quotes?"`":"'",compact=options.compact,lowercaseHex=options.lowercaseHex;let indent=options.indent.repeat(options.indentLevel),oldIndent="";const inline1=options.__inline1__,inline2=options.__inline2__,newLine=compact?"":"\n";let result,isEmpty=!0;const useBinNumbers="binary"==options.numbers,useOctNumbers="octal"==options.numbers,useDecNumbers="decimal"==options.numbers,useHexNumbers="hexadecimal"==options.numbers;if(json&&argument&&(value=>"function"==typeof value)(argument.toJSON)&&(argument=argument.toJSON()),!(value=>"string"==typeof value||"[object String]"==toString.call(value))(argument)){if((value=>"[object Map]"==toString.call(value))(argument))return 0==argument.size?"new Map()":(compact||(options.__inline1__=!0,options.__inline2__=!1),"new Map("+jsesc(Array.from(argument),options)+")");if((value=>"[object Set]"==toString.call(value))(argument))return 0==argument.size?"new Set()":"new Set("+jsesc(Array.from(argument),options)+")";if(isBuffer(argument))return 0==argument.length?"Buffer.from([])":"Buffer.from("+jsesc(Array.from(argument),options)+")";if(isArray(argument))return result=[],options.wrap=!0,inline1&&(options.__inline1__=!1,options.__inline2__=!0),inline2||increaseIndentation(),((array,callback)=>{const length=array.length;let index=-1;for(;++index{isEmpty=!1,inline2&&(options.__inline2__=!1),result.push((compact||inline2?"":indent)+jsesc(value,options))})),isEmpty?"[]":inline2?"["+result.join(", ")+"]":"["+newLine+result.join(","+newLine)+newLine+(compact?"":oldIndent)+"]";if(!(value=>"number"==typeof value||"[object Number]"==toString.call(value))(argument))return(value=>"[object Object]"==toString.call(value))(argument)?(result=[],options.wrap=!0,increaseIndentation(),forOwn(argument,((key,value)=>{isEmpty=!1,result.push((compact?"":indent)+jsesc(key,options)+":"+(compact?"":" ")+jsesc(value,options))})),isEmpty?"{}":"{"+newLine+result.join(","+newLine)+newLine+(compact?"":oldIndent)+"}"):json?JSON.stringify(argument)||"null":String(argument);if(json)return JSON.stringify(argument);if(useDecNumbers)return String(argument);if(useHexNumbers){let hexadecimal=argument.toString(16);return lowercaseHex||(hexadecimal=hexadecimal.toUpperCase()),"0x"+hexadecimal}if(useBinNumbers)return"0b"+argument.toString(2);if(useOctNumbers)return"0o"+argument.toString(8)}const string=argument;let index=-1;const length=string.length;for(result="";++index=55296&&first<=56319&&length>index+1){const second=string.charCodeAt(index+1);if(second>=56320&&second<=57343){let hexadecimal=(1024*(first-55296)+second-56320+65536).toString(16);lowercaseHex||(hexadecimal=hexadecimal.toUpperCase()),result+="\\u{"+hexadecimal+"}",++index;continue}}}if(!options.escapeEverything){if(regexWhitelist.test(character)){result+=character;continue}if('"'==character){result+=quote==character?'\\"':character;continue}if("`"==character){result+=quote==character?"\\`":character;continue}if("'"==character){result+=quote==character?"\\'":character;continue}}if("\0"==character&&!json&&!regexDigit.test(string.charAt(index+1))){result+="\\0";continue}if(regexSingleEscape.test(character)){result+=singleEscapes[character];continue}const charCode=character.charCodeAt(0);if(options.minimal&&8232!=charCode&&8233!=charCode){result+=character;continue}let hexadecimal=charCode.toString(16);lowercaseHex||(hexadecimal=hexadecimal.toUpperCase());const longhand=hexadecimal.length>2||json,escaped="\\"+(longhand?"u":"x")+("0000"+hexadecimal).slice(longhand?-4:-2);result+=escaped}return options.wrap&&(result=quote+result+quote),"`"==quote&&(result=result.replace(/\$\{/g,"\\${")),options.isScriptContext?result.replace(/<\/(script|style)/gi,"<\\/$1").replace(/ + + + +``` + +Browser support was done mostly for the online demo. If you find any errors - feel +free to send pull requests with fixes. Also note, that IE and other old browsers +needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. + +Notes: + +1. We have no resources to support browserified version. Don't expect it to be + well tested. Don't expect fast fixes if something goes wrong there. +2. `!!js/function` in browser bundle will not work by default. If you really need + it - load `esprima` parser first (via amd or directly). +3. `!!bin` in browser will return `Array`, because browsers do not support + node.js `Buffer` and adding Buffer shims is completely useless on practice. + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and +[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more +info. + +``` javascript +const yaml = require('js-yaml'); +const fs = require('fs'); + +// Get document, or throw exception on error +try { + const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### safeLoad (string [ , options ]) + +**Recommended loading way.** Parses `string` as single YAML document. Returns either a +plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does +not support regexps, functions and undefined. This method is safe for untrusted data. + +options: + +- `filename` _(default: null)_ - string to be used as a file path in + error/warning messages. +- `onWarning` _(default: null)_ - function to call on warning messages. + Loader will call this function with an instance of `YAMLException` for each warning. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. + - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: + http://www.yaml.org/spec/1.2/spec.html#id2802346 + - `JSON_SCHEMA` - all JSON-supported types: + http://www.yaml.org/spec/1.2/spec.html#id2803231 + - `CORE_SCHEMA` - same as `JSON_SCHEMA`: + http://www.yaml.org/spec/1.2/spec.html#id2804923 + - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones + (`!!js/undefined`, `!!js/regexp` and `!!js/function`): + http://yaml.org/type/ + - `DEFAULT_FULL_SCHEMA` - all supported YAML types. +- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. + +NOTE: This function **does not** understand multi-document sources, it throws +exception on those. + +NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. +So, the JSON schema is not as strictly defined in the YAML specification. +It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. +The core schema also has no such restrictions. It allows binary notation for integers. + + +### load (string [ , options ]) + +**Use with care with untrusted sources**. The same as `safeLoad()` but uses +`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: +`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you +must additionally validate object structure to avoid injections: + +``` javascript +const untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; + +// I'm just converting that string, what could possibly go wrong? +require('js-yaml').load(untrusted_code) + '' +``` + + +### safeLoadAll (string [, iterator] [, options ]) + +Same as `safeLoad()`, but understands multi-document sources. Applies +`iterator` to each document if specified, or returns array of documents. + +``` javascript +const yaml = require('js-yaml'); + +yaml.safeLoadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### loadAll (string [, iterator] [ , options ]) + +Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. + + +### safeDump (object [ , options ]) + +Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will +throw an exception if you try to dump regexps or functions. However, you can +disable exceptions by setting the `skipInvalid` option to `true`. + +options: + +- `indent` _(default: 2)_ - indentation width to use (in spaces). +- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements +- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function + in the safe schema) and skip pairs and single values with such types. +- `flowLevel` (default: -1) - specifies level of nesting, when to switch from + block to flow style for collections. -1 means block style everwhere +- `styles` - "tag" => "style" map. Each tag may have own set of styles. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. +- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a + function, use the function to sort the keys. +- `lineWidth` _(default: `80`)_ - set max line width. +- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references +- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older + yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 +- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. + +The following table show availlable styles (e.g. "canonical", +"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml +output is shown on the right side after `=>` (default setting) or `->`: + +``` none +!!null + "canonical" -> "~" + "lowercase" => "null" + "uppercase" -> "NULL" + "camelcase" -> "Null" + +!!int + "binary" -> "0b1", "0b101010", "0b1110001111010" + "octal" -> "01", "052", "016172" + "decimal" => "1", "42", "7290" + "hexadecimal" -> "0x1", "0x2A", "0x1C7A" + +!!bool + "lowercase" => "true", "false" + "uppercase" -> "TRUE", "FALSE" + "camelcase" -> "True", "False" + +!!float + "lowercase" => ".nan", '.inf' + "uppercase" -> ".NAN", '.INF' + "camelcase" -> ".NaN", '.Inf' +``` + +Example: + +``` javascript +safeDump (object, { + 'styles': { + '!!null': 'canonical' // dump null as ~ + }, + 'sortKeys': true // sort object keys +}); +``` + +### dump (object [ , options ]) + +Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). + + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScipt types. See also +[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and +[YAML types repository](http://yaml.org/type/). + +``` +!!null '' # null +!!bool 'yes' # bool +!!int '3...' # number +!!float '3.14...' # number +!!binary '...base64...' # buffer +!!timestamp 'YYYY-...' # date +!!omap [ ... ] # array of key-value pairs +!!pairs [ ... ] # array or array pairs +!!set { ... } # array of objects with given keys and null values +!!str '...' # string +!!seq [ ... ] # array +!!map { ... } # object +``` + +**JavaScript-specific tags** + +``` +!!js/regexp /pattern/gim # RegExp +!!js/undefined '' # Undefined +!!js/function 'function () {...}' # Function +``` + +Caveats +------- + +Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects +or arrays as keys, and stringifies (by calling `toString()` method) them at the +moment of adding them. + +``` yaml +--- +? [ foo, bar ] +: - baz +? { foo: bar } +: - baz + - baz +``` + +``` javascript +{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } +``` + +Also, reading of properties on implicit block mapping keys is not supported yet. +So, the following YAML document cannot be loaded. + +``` yaml +&anchor foo: + foo: bar + *anchor: duplicate key + baz: bat + *anchor: duplicate key +``` + + +js-yaml for enterprise +---------------------- + +Available as part of the Tidelift Subscription + +The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/js-yaml/bin/js-yaml.js b/node_modules/js-yaml/bin/js-yaml.js new file mode 100755 index 0000000..e79186b --- /dev/null +++ b/node_modules/js-yaml/bin/js-yaml.js @@ -0,0 +1,132 @@ +#!/usr/bin/env node + + +'use strict'; + +/*eslint-disable no-console*/ + + +// stdlib +var fs = require('fs'); + + +// 3rd-party +var argparse = require('argparse'); + + +// internal +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new argparse.ArgumentParser({ + prog: 'js-yaml', + version: require('../package.json').version, + addHelp: true +}); + + +cli.addArgument([ '-c', '--compact' ], { + help: 'Display errors in compact mode', + action: 'storeTrue' +}); + + +// deprecated (not needed after we removed output colors) +// option suppressed, but not completely removed for compatibility +cli.addArgument([ '-j', '--to-json' ], { + help: argparse.Const.SUPPRESS, + dest: 'json', + action: 'storeTrue' +}); + + +cli.addArgument([ '-t', '--trace' ], { + help: 'Show stack trace on error', + action: 'storeTrue' +}); + +cli.addArgument([ 'file' ], { + help: 'File to read, utf-8 encoded without BOM', + nargs: '?', + defaultValue: '-' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parseArgs(); + + +//////////////////////////////////////////////////////////////////////////////// + +function readFile(filename, encoding, callback) { + if (options.file === '-') { + // read from stdin + + var chunks = []; + + process.stdin.on('data', function (chunk) { + chunks.push(chunk); + }); + + process.stdin.on('end', function () { + return callback(null, Buffer.concat(chunks).toString(encoding)); + }); + } else { + fs.readFile(filename, encoding, callback); + } +} + +readFile(options.file, 'utf8', function (error, input) { + var output, isYaml; + + if (error) { + if (error.code === 'ENOENT') { + console.error('File not found: ' + options.file); + process.exit(2); + } + + console.error( + options.trace && error.stack || + error.message || + String(error)); + + process.exit(1); + } + + try { + output = JSON.parse(input); + isYaml = false; + } catch (err) { + if (err instanceof SyntaxError) { + try { + output = []; + yaml.loadAll(input, function (doc) { output.push(doc); }, {}); + isYaml = true; + + if (output.length === 0) output = null; + else if (output.length === 1) output = output[0]; + + } catch (e) { + if (options.trace && err.stack) console.error(e.stack); + else console.error(e.toString(options.compact)); + + process.exit(1); + } + } else { + console.error( + options.trace && err.stack || + err.message || + String(err)); + + process.exit(1); + } + } + + if (isYaml) console.log(JSON.stringify(output, null, ' ')); + else console.log(yaml.dump(output)); +}); diff --git a/node_modules/js-yaml/dist/js-yaml.js b/node_modules/js-yaml/dist/js-yaml.js new file mode 100644 index 0000000..7878320 --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.js @@ -0,0 +1,3989 @@ +/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; + +},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; + +},{}],5:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; + +},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; + +},{"./common":2}],7:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; + +},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); + +},{"../schema":7,"./json":12}],9:[function(require,module,exports){ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); + +},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); + +},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); + +},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); + +},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; + +},{"./exception":4}],14:[function(require,module,exports){ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + +},{"../type":13}],15:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],16:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + +},{"../common":2,"../type":13}],17:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); + +},{"../common":2,"../type":13}],18:[function(require,module,exports){ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); + +},{"../../type":13}],19:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); + +},{"../../type":13}],20:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); + +},{"../../type":13}],21:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + +},{"../type":13}],22:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + +},{"../type":13}],23:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],24:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + +},{"../type":13}],25:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + +},{"../type":13}],26:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + +},{"../type":13}],27:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +},{"../type":13}],28:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + +},{"../type":13}],29:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + +},{"../type":13}],"/":[function(require,module,exports){ +'use strict'; + + +var yaml = require('./lib/js-yaml.js'); + + +module.exports = yaml; + +},{"./lib/js-yaml.js":1}]},{},[])("/") +}); diff --git a/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 0000000..1b6ecc1 --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1 @@ +/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}(function(){return function i(r,o,a){function s(t,e){if(!o[t]){if(!r[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=o[t]={exports:{}},r[t][0].call(n.exports,function(e){return s(r[t][1][e]||e)},n,n.exports,i,r,o,a)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e=i.flowLevel;switch(V(r,n,i.indent,t,function(e){return function(e,t){for(var n=0,i=e.implicitTypes.length;n"+z(r,i.indent)+J(U(function(t,n){var e,i=/(\n+)([^\n]*)/g,r=function(){var e=-1!==(e=t.indexOf("\n"))?e:t.length;return i.lastIndex=e,Q(t.slice(0,e),n)}(),o="\n"===t[0]||" "===t[0];for(;e=i.exec(t);){var a=e[1],s=e[2];e=" "===s[0],r+=a+(o||e||""===s?"":"\n")+Q(s,n),o=e}return r}(r,t),e));case G:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+o+'" style');i=r.represent[o](t,o)}e.dump=i}return 1}}function ee(e,t,n,i,r,o){e.tag=null,e.dump=n,X(e,n,!1)||X(e,n,!0);var a=l.call(e.dump);i=i&&(e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return 1}function te(e,t){var n,i,r=[],o=[];for(!function e(t,n,i){var r,o,a;if(null!==t&&"object"==typeof t)if(-1!==(o=n.indexOf(t)))-1===i.indexOf(o)&&i.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;o>10),56320+(c-65536&1023)),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else S(u)?(L(e,n,i,!0),B(e,Y(e,!1,t)),n=i=e.position):e.position===e.lineStart&&R(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}}function K(e,t){var n,i,r=e.tag,o=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&45===i&&O(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,P(e,t,x,!1,!0),a.push(e.result),Y(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)N(e,"bad indentation of a sequence entry");else if(e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt)&&(P(e,t,A,!0,r)&&(m?d=e.result:h=e.result),m||(U(e,l,p,f,d,h,o,a),f=d=h=null),Y(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)N(e,"bad indentation of a mapping entry");else if(e.lineIndentc&&(c=e.lineIndent),S(p))u++;else{if(e.lineIndent=t){a=!0,f=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(L(e,r,o,!1),B(e,e.line-s),r=o=e.position,a=!1),I(f)||(o=e.position+1),f=e.input.charCodeAt(++e.position)}if(L(e,r,o,!1),e.result)return 1;e.kind=l,e.result=p}}(e,i,g===n)&&(d=!0,null===e.tag&&(e.tag="?")):(d=!0,null===e.tag&&null===e.anchor||N(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===p&&(d=s&&K(e,r))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&N(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):N(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||d}function $(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new F(e,t),e=e.indexOf("\0");for(-1!==e&&(n.position=e,N(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.positiont/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t="";return this.name&&(t+='in "'+this.name+'" '),t+="at line "+(this.line+1)+", column "+(this.column+1),e||(e=this.getSnippet())&&(t+=":\n"+e),t},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var r=e("./common"),o=e("./exception"),a=e("./type");function s(e,t,i){var r=[];return e.include.forEach(function(e){i=s(e,t,i)}),e[t].forEach(function(n){i.forEach(function(e,t){e.tag===n.tag&&e.kind===n.kind&&r.push(t)}),i.push(n)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function c(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=s(this,"implicit",[]),this.compiledExplicit=s(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),o.push(r>>8&255),o.push(255&r)),r=r<<6|i.indexOf(t.charAt(a));return 0==(e=n%4*6)?(o.push(r>>16&255),o.push(r>>8&255),o.push(255&r)):18==e?(o.push(r>>10&255),o.push(r>>2&255)):12==e&&o.push(r>>4&255),s?s.from?s.from(o):new s(o):o},predicate:function(e){return s&&s.isBuffer(e)},represent:function(e){for(var t,n="",i=0,r=e.length,o=c,a=0;a>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+e[a];return 0==(t=r%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2==t?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1==t&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}})},{"../type":13}],15:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type"),r=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var o=/^[-+]?[0-9]+e/;t.exports=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!r.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n=e.replace(/_/g,"").toLowerCase(),e="-"===n[0]?-1:1,i=[];return 0<="+-".indexOf(n[0])&&(n=n.slice(1)),".inf"===n?1==e?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===n?NaN:0<=n.indexOf(":")?(n.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),n=0,t=1,i.forEach(function(e){n+=e*t,t*=60}),e*n):e*parseFloat(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return e=e.toString(10),o.test(e)?e.replace("e",".e"):e},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type");t.exports=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; diff --git a/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/js-yaml/lib/js-yaml/exception.js new file mode 100644 index 0000000..b744a1e --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/exception.js @@ -0,0 +1,43 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; diff --git a/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/js-yaml/lib/js-yaml/loader.js new file mode 100644 index 0000000..d7484a5 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/loader.js @@ -0,0 +1,1644 @@ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; diff --git a/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/js-yaml/lib/js-yaml/mark.js new file mode 100644 index 0000000..47b265c --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/mark.js @@ -0,0 +1,76 @@ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; diff --git a/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/js-yaml/lib/js-yaml/schema.js new file mode 100644 index 0000000..ca7cf47 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema.js @@ -0,0 +1,108 @@ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; diff --git a/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/js-yaml/lib/js-yaml/schema/core.js new file mode 100644 index 0000000..206daab --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/core.js @@ -0,0 +1,18 @@ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js new file mode 100644 index 0000000..a55ef42 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js @@ -0,0 +1,25 @@ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js new file mode 100644 index 0000000..11d89bb --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js @@ -0,0 +1,28 @@ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js new file mode 100644 index 0000000..b7a33eb --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js @@ -0,0 +1,17 @@ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/js-yaml/lib/js-yaml/schema/json.js new file mode 100644 index 0000000..5be3dbf --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/json.js @@ -0,0 +1,25 @@ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/js-yaml/lib/js-yaml/type.js new file mode 100644 index 0000000..90b702a --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type.js @@ -0,0 +1,61 @@ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; diff --git a/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/js-yaml/lib/js-yaml/type/binary.js new file mode 100644 index 0000000..10b1875 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -0,0 +1,138 @@ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/js-yaml/lib/js-yaml/type/bool.js new file mode 100644 index 0000000..cb77459 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -0,0 +1,35 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/js-yaml/lib/js-yaml/type/float.js new file mode 100644 index 0000000..127671b --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -0,0 +1,116 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/js-yaml/lib/js-yaml/type/int.js new file mode 100644 index 0000000..ba61c5f --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -0,0 +1,173 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/js-yaml/lib/js-yaml/type/js/function.js new file mode 100644 index 0000000..8fab8c4 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -0,0 +1,93 @@ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js new file mode 100644 index 0000000..43fa470 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -0,0 +1,60 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js new file mode 100644 index 0000000..95b5569 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js @@ -0,0 +1,28 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/js-yaml/lib/js-yaml/type/map.js new file mode 100644 index 0000000..f327bee --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/js-yaml/lib/js-yaml/type/merge.js new file mode 100644 index 0000000..ae08a86 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -0,0 +1,12 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/js-yaml/lib/js-yaml/type/null.js new file mode 100644 index 0000000..6874daa --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -0,0 +1,34 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/js-yaml/lib/js-yaml/type/omap.js new file mode 100644 index 0000000..b2b5323 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -0,0 +1,44 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/js-yaml/lib/js-yaml/type/pairs.js new file mode 100644 index 0000000..74b5240 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -0,0 +1,53 @@ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/js-yaml/lib/js-yaml/type/seq.js new file mode 100644 index 0000000..be8f77f --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/js-yaml/lib/js-yaml/type/set.js new file mode 100644 index 0000000..f885a32 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -0,0 +1,29 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/js-yaml/lib/js-yaml/type/str.js new file mode 100644 index 0000000..27acc10 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js new file mode 100644 index 0000000..8fa9c58 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -0,0 +1,88 @@ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); diff --git a/node_modules/js-yaml/package.json b/node_modules/js-yaml/package.json new file mode 100644 index 0000000..0d23667 --- /dev/null +++ b/node_modules/js-yaml/package.json @@ -0,0 +1,49 @@ +{ + "name": "js-yaml", + "version": "3.14.1", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "homepage": "https://github.com/nodeca/js-yaml", + "author": "Vladimir Zapparov ", + "contributors": [ + "Aleksey V Zapparov (http://www.ixti.net/)", + "Vitaly Puzrin (https://github.com/puzrin)", + "Martin Grenfell (http://got-ravings.blogspot.com)" + ], + "license": "MIT", + "repository": "nodeca/js-yaml", + "files": [ + "index.js", + "lib/", + "bin/", + "dist/" + ], + "bin": { + "js-yaml": "bin/js-yaml.js" + }, + "unpkg": "dist/js-yaml.min.js", + "jsdelivr": "dist/js-yaml.min.js", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "browserify": "^16.2.2", + "codemirror": "^5.13.4", + "eslint": "^7.0.0", + "fast-check": "^1.24.2", + "istanbul": "^0.4.5", + "mocha": "^7.1.2", + "uglify-js": "^3.0.1" + }, + "scripts": { + "test": "make test" + } +} diff --git a/node_modules/jstransformer/CHANGELOG.md b/node_modules/jstransformer/CHANGELOG.md new file mode 100644 index 0000000..f4655b0 --- /dev/null +++ b/node_modules/jstransformer/CHANGELOG.md @@ -0,0 +1,38 @@ +# Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## [1.0.0] - 2016-06-06 +### Changed +- Browser support is fixed +- Marked as stable + +## [0.0.4] - 2015-11-23 +### Changed +- Switched to [Keep a Changelog](http://keepachangelog.com/) spec for CHANGELOG.md +- Creates an `options.filename` for `*File()` functions, if one is not provided + +## [0.0.3] - 2015-07-13 +### Added +- Added `.render()` fallbacks for `.compile()` + +### Changed +- Prefers locals over options when passing a single argument to `.render()` +- Updated dependencies + +## [0.0.2] - 2015-04-11 +### Added +- Now have a logo +- Added tests + +### Changed +- Updated documentation + +## 0.0.1 - 2015-02-09 +### Added +- Initial release + +[1.0.0]: https://github.com/jstransformers/jstransformer/compare/0.0.4...1.0.0 +[0.0.4]: https://github.com/jstransformers/jstransformer/compare/0.0.3...0.0.4 +[0.0.3]: https://github.com/jstransformers/jstransformer/compare/0.0.2...0.0.3 +[0.0.2]: https://github.com/jstransformers/jstransformer/compare/0.0.1...0.0.2 diff --git a/node_modules/jstransformer/LICENSE.md b/node_modules/jstransformer/LICENSE.md new file mode 100644 index 0000000..006e201 --- /dev/null +++ b/node_modules/jstransformer/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) + +Copyright (c) 2015 Forbes Lindesay + +> 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. diff --git a/node_modules/jstransformer/README.md b/node_modules/jstransformer/README.md new file mode 100644 index 0000000..99dca54 --- /dev/null +++ b/node_modules/jstransformer/README.md @@ -0,0 +1,114 @@ +

    +

    JSTransformer

    +

    Normalize the API of any jstransformer

    + +

    Build Status +Dependency Status +Developers' Dependency Status +Coverage Status +NPM version

    + +## Installation + + npm install jstransformer + +## Usage + +```js +var transformer = require('jstransformer'); +var marked = transformer(require('jstransformer-marked')); + +var options = {}; +var res = marked.render('Some **markdown**', options); +// => {body: 'Some markdown', dependencies: []} +``` + +This gives the same API regardless of the jstransformer passed in. + +## API + +A transformer, once normalised using this module, will implement the following methods. Note that if the underlying transformer cannot be used to implement the functionality, it may ultimately just throw an error. + +### Returned object from `.render*` + +```js +{body: String, dependencies: Array.} +``` + + - `body` represents the result as a string + - `dependencies` is an array of files that were read in as part of the render process (or an empty array if there were no dependencies) + +### `.render` + +```js +transformer.render(str, options, locals); +=> {body: String, dependencies: Array.} +``` + +_requires the underlying transform to implement `.render` or `.compile`_ + +Transform a string and return an object. + +### `.renderAsync` + +```js +transformer.renderAsync(str[, options], locals, callback); +``` + +```js +transformer.renderAsync(str[, options], locals); +=> Promise({body: String, dependencies: Array.}) +``` + +_requires the underlying transform to implement `.renderAsync` or `.render`_ + +Transform a string asynchronously. If a callback is provided, it is called as `callback(err, data)`, otherwise a Promise is returned. + +### `.renderFile` + +```js +transformer.renderFile(filename, options, locals) +=> {body: String, dependencies: Array.} +``` + +_requires the underlying transform to implement `.renderFile`, `.render`, `.compileFile`, or `.compile`_ + +Transform a file and return an object. + +### `.renderFileAsync` + +```js +transformer.renderFileAsync(filename[, options], locals, callback); +``` + +```js +transformer.renderFileAsync(filename[, options], locals); +=> Promise({body: String, dependencies: Array.}) +``` + +_requires the underlying transform to implement `.renderFileAsync`, `.renderFile`, `.renderAsync`, `.render`, `.compileFileAsync`, `.compileFile`, `.compileAsync`, or `.compileFile`_ + +Transform a file asynchronously. If a callback is provided, it is called as `callback(err, data)`, otherwise a Promise is returned. + +### `.inputFormats` + +```js +var formats = transformer.inputFormats; +=> ['md', 'markdown'] +``` + +Returns an array of strings representing potential input formats for the transform. If not provided directly by the transform, results in an array containing the name of the transform. + +### `.outputFormat` + +```js +var md = require('jstransformer')(require('jstransformer-markdown')) +var outputFormat = md.outputFormat +=> 'html' +``` + +Returns a string representing the default output format the transform would be expected to return when calling `.render()`. + +## License + +MIT diff --git a/node_modules/jstransformer/index.js b/node_modules/jstransformer/index.js new file mode 100644 index 0000000..c12d7f9 --- /dev/null +++ b/node_modules/jstransformer/index.js @@ -0,0 +1,359 @@ +'use strict'; + +var fs = require('fs'); +var assert = require('assert'); +var Promise = require('promise'); +var isPromise = require('is-promise'); + +var tr = (module.exports = function (transformer) { + return new Transformer(transformer); +}); +tr.Transformer = Transformer; +tr.normalizeFn = normalizeFn; +tr.normalizeFnAsync = normalizeFnAsync; +tr.normalize = normalize; +tr.normalizeAsync = normalizeAsync; +if (fs.readFile) { + tr.readFile = Promise.denodeify(fs.readFile); + tr.readFileSync = fs.readFileSync; +} else { + tr.readFile = function () { throw new Error('fs.readFile unsupported'); }; + tr.readFileSync = function () { throw new Error('fs.readFileSync unsupported'); }; +} + +function normalizeFn(result) { + if (typeof result === 'function') { + return {fn: result, dependencies: []}; + } else if (result && typeof result === 'object' && typeof result.fn === 'function') { + if ('dependencies' in result) { + if (!Array.isArray(result.dependencies)) { + throw new Error('Result should have a dependencies property that is an array'); + } + } else { + result.dependencies = []; + } + return result; + } else { + throw new Error('Invalid result object from transform.'); + } +} +function normalizeFnAsync(result, cb) { + return Promise.resolve(result).then(function (result) { + if (result && isPromise(result.fn)) { + return result.fn.then(function (fn) { + result.fn = fn; + return result; + }); + } + return result; + }).then(tr.normalizeFn).nodeify(cb); +} +function normalize(result) { + if (typeof result === 'string') { + return {body: result, dependencies: []}; + } else if (result && typeof result === 'object' && typeof result.body === 'string') { + if ('dependencies' in result) { + if (!Array.isArray(result.dependencies)) { + throw new Error('Result should have a dependencies property that is an array'); + } + } else { + result.dependencies = []; + } + return result; + } else { + throw new Error('Invalid result object from transform.'); + } +} +function normalizeAsync(result, cb) { + return Promise.resolve(result).then(function (result) { + if (result && isPromise(result.body)) { + return result.body.then(function (body) { + result.body = body; + return result; + }); + } + return result; + }).then(tr.normalize).nodeify(cb); +} + +function Transformer(tr) { + assert(tr, 'Transformer must be an object'); + assert(typeof tr.name === 'string', 'Transformer must have a name'); + assert(typeof tr.outputFormat === 'string', 'Transformer must have an output format'); + assert([ + 'compile', + 'compileAsync', + 'compileFile', + 'compileFileAsync', + 'compileClient', + 'compileClientAsync', + 'compileFileClient', + 'compileFileClientAsync', + 'render', + 'renderAsync', + 'renderFile', + 'renderFileAsync' + ].some(function (method) { + return typeof tr[method] === 'function'; + }), 'Transformer must implement at least one of the potential methods.'); + this._tr = tr; + this.name = this._tr.name; + this.outputFormat = this._tr.outputFormat; + this.inputFormats = this._tr.inputFormats || [this.name]; +} + +var fallbacks = { + compile: ['compile', 'render'], + compileAsync: ['compileAsync', 'compile', 'render'], + compileFile: ['compileFile', 'compile', 'renderFile', 'render'], + compileFileAsync: [ + 'compileFileAsync', 'compileFile', 'compileAsync', 'compile', + 'renderFile', 'render' + ], + compileClient: ['compileClient'], + compileClientAsync: ['compileClientAsync', 'compileClient'], + compileFileClient: ['compileFileClient', 'compileClient'], + compileFileClientAsync: [ + 'compileFileClientAsync', 'compileFileClient', 'compileClientAsync', 'compileClient' + ], + render: ['render', 'compile'], + renderAsync: ['renderAsync', 'render', 'compileAsync', 'compile'], + renderFile: ['renderFile', 'render', 'compileFile', 'compile'], + renderFileAsync: [ + 'renderFileAsync', 'renderFile', 'renderAsync', 'render', + 'compileFileAsync', 'compileFile', 'compileAsync', 'compile' + ] +}; + +Transformer.prototype._hasMethod = function (method) { + return typeof this._tr[method] === 'function'; +}; +Transformer.prototype.can = function (method) { + return fallbacks[method].some(function (method) { + return this._hasMethod(method); + }.bind(this)); +}; + +/* COMPILE */ + +Transformer.prototype.compile = function (str, options) { + if (!this._hasMethod('compile')) { + if (this.can('render')) { + var _this = this; + return { + fn: function (locals) { + return tr.normalize(_this._tr.render(str, options, locals)).body; + }, + dependencies: [] + }; + } + if (this.can('compileAsync')) { + throw new Error('The Transform "' + this.name + '" does not support synchronous compilation'); + } else if (this.can('compileFileAsync')) { + throw new Error('The Transform "' + this.name + '" does not support compiling plain strings'); + } else { + throw new Error('The Transform "' + this.name + '" does not support compilation'); + } + } + return tr.normalizeFn(this._tr.compile(str, options)); +}; +Transformer.prototype.compileAsync = function (str, options, cb) { + if (!this.can('compileAsync')) { // compileFile* || renderFile* || renderAsync || compile*Client* + return Promise.reject(new Error('The Transform "' + this.name + '" does not support compiling plain strings')).nodeify(cb); + } + if (this._hasMethod('compileAsync')) { + return tr.normalizeFnAsync(this._tr.compileAsync(str, options), cb); + } else { // render || compile + return tr.normalizeFnAsync(this.compile(str, options), cb); + } +}; +Transformer.prototype.compileFile = function (filename, options) { + if (!this.can('compileFile')) { // compile*Client* || compile*Async || render*Async + throw new Error('The Transform "' + this.name + '" does not support synchronous compilation'); + } + if (this._hasMethod('compileFile')) { + return tr.normalizeFn(this._tr.compileFile(filename, options)); + } else if (this._hasMethod('renderFile')) { + return tr.normalizeFn(function (locals) { + return tr.normalize(this._tr.renderFile(filename, options, locals)).body; + }.bind(this)); + } else { // render || compile + if (!options) options = {}; + if (options.filename === undefined) options.filename = filename; + return this.compile(tr.readFileSync(filename, 'utf8'), options); + } +}; +Transformer.prototype.compileFileAsync = function (filename, options, cb) { + if (!this.can('compileFileAsync')) { + return Promise.reject(new Error('The Transform "' + this.name + '" does not support compilation')); + } + if (this._hasMethod('compileFileAsync')) { + return tr.normalizeFnAsync(this._tr.compileFileAsync(filename, options), cb); + } else if (this._hasMethod('compileFile') || this._hasMethod('renderFile')) { + return tr.normalizeFnAsync(this.compileFile(filename, options), cb); + } else { // compileAsync || compile || render + if (!options) options = {}; + if (options.filename === undefined) options.filename = filename; + return tr.normalizeFnAsync(tr.readFile(filename, 'utf8').then(function (str) { + if (this._hasMethod('compileAsync')) { + return this._tr.compileAsync(str, options); + } else { // compile || render + return this.compile(str, options); + } + }.bind(this)), cb); + } +}; + +/* COMPILE CLIENT */ + + +Transformer.prototype.compileClient = function (str, options) { + if (!this.can('compileClient')) { + if (this.can('compileClientAsync')) { + throw new Error('The Transform "' + this.name + '" does not support compiling for the client synchronously.'); + } else if (this.can('compileFileClientAsync')) { + throw new Error('The Transform "' + this.name + '" does not support compiling for the client from a string.'); + } else { + throw new Error('The Transform "' + this.name + '" does not support compiling for the client'); + } + } + return tr.normalize(this._tr.compileClient(str, options)); +}; +Transformer.prototype.compileClientAsync = function (str, options, cb) { + if (!this.can('compileClientAsync')) { + if (this.can('compileFileClientAsync')) { + return Promise.reject(new Error('The Transform "' + this.name + '" does not support compiling for the client from a string.')).nodeify(cb); + } else { + return Promise.reject(new Error('The Transform "' + this.name + '" does not support compiling for the client')).nodeify(cb); + } + } + if (this._hasMethod('compileClientAsync')) { + return tr.normalizeAsync(this._tr.compileClientAsync(str, options), cb); + } else { + return tr.normalizeAsync(this._tr.compileClient(str, options), cb); + } +}; +Transformer.prototype.compileFileClient = function (filename, options) { + if (!this.can('compileFileClient')) { + if (this.can('compileFileClientAsync')) { + throw new Error('The Transform "' + this.name + '" does not support compiling for the client synchronously.'); + } else { + throw new Error('The Transform "' + this.name + '" does not support compiling for the client'); + } + } + if (this._hasMethod('compileFileClient')) { + return tr.normalize(this._tr.compileFileClient(filename, options)); + } else { + if (!options) options = {}; + if (options.filename === undefined) options.filename = filename; + return tr.normalize(this._tr.compileClient(tr.readFileSync(filename, 'utf8'), options)); + } +}; +Transformer.prototype.compileFileClientAsync = function (filename, options, cb) { + if (!this.can('compileFileClientAsync')) { + return Promise.reject(new Error('The Transform "' + this.name + '" does not support compiling for the client')).nodeify(cb) + } + if (this._hasMethod('compileFileClientAsync')) { + return tr.normalizeAsync(this._tr.compileFileClientAsync(filename, options), cb); + } else if (this._hasMethod('compileFileClient')) { + return tr.normalizeAsync(this._tr.compileFileClient(filename, options), cb); + } else { + if (!options) options = {}; + if (options.filename === undefined) options.filename = filename; + return tr.normalizeAsync(tr.readFile(filename, 'utf8').then(function (str) { + if (this._hasMethod('compileClientAsync')) { + return this._tr.compileClientAsync(str, options); + } else { + return this._tr.compileClient(str, options); + } + }.bind(this)), cb); + } +}; + +/* RENDER */ + +Transformer.prototype.render = function (str, options, locals) { + if (!this.can('render')) { + if (this.can('renderAsync')) { + throw new Error('The Transform "' + this.name + '" does not support rendering synchronously.'); + } else if (this.can('renderFileAsync')) { + throw new Error('The Transform "' + this.name + '" does not support rendering from a string.'); + } else { + throw new Error('The Transform "' + this.name + '" does not support rendering'); + } + } + if (this._hasMethod('render')) { + return tr.normalize(this._tr.render(str, options, locals)); + } else { + var compiled = tr.normalizeFn(this._tr.compile(str, options)); + var body = compiled.fn(locals || options); + if (typeof body !== 'string') { + throw new Error('The Transform "' + this.name + '" does not support rendering synchronously.'); + } + return tr.normalize({body: body, dependencies: compiled.dependencies}); + } +}; +Transformer.prototype.renderAsync = function (str, options, locals, cb) { + if (typeof locals === 'function') { + cb = locals; + locals = options; + } + if (!this.can('renderAsync')) { + if (this.can('renderFileAsync')) { + return Promise.reject(new Error('The Transform "' + this.name + '" does not support rendering from a string.')).nodeify(cb); + } else { + return Promise.reject(new Error('The Transform "' + this.name + '" does not support rendering')).nodeify(cb); + } + } + if (this._hasMethod('renderAsync')) { + return tr.normalizeAsync(this._tr.renderAsync(str, options, locals), cb); + } else if (this._hasMethod('render')) { + return tr.normalizeAsync(this._tr.render(str, options, locals), cb); + } else { + return tr.normalizeAsync(this.compileAsync(str, options).then(function (compiled) { + return {body: compiled.fn(locals || options), dependencies: compiled.dependencies}; + }), cb); + } +}; +Transformer.prototype.renderFile = function (filename, options, locals) { + if (!this.can('renderFile')) { // *Async, *Client + throw new Error('The Transform "' + this.name + '" does not support rendering synchronously.'); + } + + if (this._hasMethod('renderFile')) { + return tr.normalize(this._tr.renderFile(filename, options, locals)); + } else if (this._hasMethod('render')) { + if (!options) options = {}; + if (options.filename === undefined) options.filename = filename; + return tr.normalize(this._tr.render(tr.readFileSync(filename, 'utf8'), options, locals)); + } else { // compile || compileFile + var compiled = this.compileFile(filename, options); + return tr.normalize({body: compiled.fn(locals || options), dependencies: compiled.dependencies}); + } +}; +Transformer.prototype.renderFileAsync = function (filename, options, locals, cb) { + if (!this.can('renderFileAsync')) { // *Client + throw new Error('The Transform "' + this.name + '" does not support rendering.'); + } + + if (typeof locals === 'function') { + cb = locals; + locals = options; + } + if (this._hasMethod('renderFileAsync')) { + return tr.normalizeAsync(this._tr.renderFileAsync(filename, options, locals), cb); + } else if (this._hasMethod('renderFile')) { + return tr.normalizeAsync(this._tr.renderFile(filename, options, locals), cb); + } else if (this._hasMethod('compile') || this._hasMethod('compileAsync') + || this._hasMethod('compileFile') || this._hasMethod('compileFileAsync')) { + return tr.normalizeAsync(this.compileFileAsync(filename, options).then(function (compiled) { + return {body: compiled.fn(locals || options), dependencies: compiled.dependencies}; + }), cb); + } else { // render || renderAsync + if (!options) options = {}; + if (options.filename === undefined) options.filename = filename; + return tr.normalizeAsync(tr.readFile(filename, 'utf8').then(function (str) { + return this.renderAsync(str, options, locals); + }.bind(this)), cb); + } +}; diff --git a/node_modules/jstransformer/package.json b/node_modules/jstransformer/package.json new file mode 100644 index 0000000..3dce89a --- /dev/null +++ b/node_modules/jstransformer/package.json @@ -0,0 +1,31 @@ +{ + "name": "jstransformer", + "version": "1.0.0", + "description": "Normalize the API of any jstransformer", + "keywords": [ + "jstransformer" + ], + "dependencies": { + "is-promise": "^2.0.0", + "promise": "^7.0.1" + }, + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.4.0", + "testit": "^2.0.2" + }, + "scripts": { + "test": "node test", + "coverage": "istanbul cover test", + "coveralls": "npm run coverage && cat ./coverage/lcov.info | coveralls" + }, + "files": [ + "index.js" + ], + "repository": { + "type": "git", + "url": "https://github.com/jstransformers/jstransformer.git" + }, + "author": "ForbesLindesay", + "license": "MIT" +} diff --git a/node_modules/junk/index.js b/node_modules/junk/index.js new file mode 100644 index 0000000..5de54b6 --- /dev/null +++ b/node_modules/junk/index.js @@ -0,0 +1,30 @@ +'use strict'; + +// // All +// /^npm-debug\.log$/, // npm error log +// /^\..*\.swp$/, // vim state +// // macOS +// /^\.DS_Store$/, // stores custom folder attributes +// /^\.AppleDouble$/, // stores additional file resources +// /^\.LSOverride$/, // contains the absolute path to the app to be used +// /^Icon\r$/, // custom Finder icon: http://superuser.com/questions/298785/icon-file-on-os-x-desktop +// /^\._.*/, // thumbnail +// /^\.Spotlight-V100$/, // file that might appear on external disk +// /\.Trashes/, // file that might appear on external disk +// /^__MACOSX$/, // resource fork +// // Linux +// /~$/, // backup file +// // Windows +// /^Thumbs\.db$/, // image file cache +// /^ehthumbs\.db$/, // folder config file +// /^Desktop\.ini$/ // stores custom folder attributes + +exports.re = /^npm-debug\.log$|^\..*\.swp$|^\.DS_Store$|^\.AppleDouble$|^\.LSOverride$|^Icon\r$|^\._.*|^\.Spotlight-V100$|\.Trashes|^__MACOSX$|~$|^Thumbs\.db$|^ehthumbs\.db$|^Desktop\.ini$/; + +exports.is = function (filename) { + return exports.re.test(filename); +}; + +exports.not = exports.isnt = function (filename) { + return !exports.is(filename); +}; diff --git a/node_modules/junk/license b/node_modules/junk/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/junk/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/node_modules/junk/package.json b/node_modules/junk/package.json new file mode 100644 index 0000000..dd52254 --- /dev/null +++ b/node_modules/junk/package.json @@ -0,0 +1,37 @@ +{ + "name": "junk", + "version": "1.0.3", + "description": "Filter out OS junk files like .DS_Store and Thumbs.db", + "license": "MIT", + "repository": "sindresorhus/junk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "junk", + "trash", + "garbage", + "files", + "os", + "ignore", + "exclude", + "filter", + "temp", + "tmp" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/node_modules/junk/readme.md b/node_modules/junk/readme.md new file mode 100644 index 0000000..bce6fc5 --- /dev/null +++ b/node_modules/junk/readme.md @@ -0,0 +1,46 @@ +# junk [![Build Status](https://travis-ci.org/sindresorhus/junk.svg?branch=master)](https://travis-ci.org/sindresorhus/junk) + +> Filter out [OS junk files](test.js) like `.DS_Store` and `Thumbs.db` + + +## Install + +```sh +$ npm install --save junk +``` + + +## Usage + +```js +var fs = require('fs'); +var junk = require('junk'); + +fs.readdir('path', function (err, files) { + console.log(files); + //=> ['.DS_Store', 'test.jpg'] + + console.log(files.filter(junk.not)); + //=> ['test.jpg'] +}); +``` + + +## API + +### junk.is(filename) + +Returns true if `filename` matches a junk file. + +### junk.not(filename) + +Returns true if `filename` doesn't match a junk file. + +### junk.re + +The regex used for matching. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/kind-of/CHANGELOG.md b/node_modules/kind-of/CHANGELOG.md new file mode 100644 index 0000000..01687d5 --- /dev/null +++ b/node_modules/kind-of/CHANGELOG.md @@ -0,0 +1,160 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
    + Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
    + +
    + Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
    + +## [6.0.3] - 2020-01-16 + +- Merge pull request #31 for issue #30 + +## [6.0.0] - 2017-10-13 + +- refactor code to be more performant +- refactor benchmarks + +## [5.1.0] - 2017-10-13 + +**Added** + +- Merge pull request #15 from aretecode/patch-1 +- adds support and tests for string & array iterators + +**Changed** + +- updates benchmarks + +## [5.0.2] - 2017-08-02 + +- Merge pull request #14 from struct78/master +- Added `undefined` check + +## [5.0.0] - 2017-06-21 + +- Merge pull request #12 from aretecode/iterator +- Set Iterator + Map Iterator +- streamline `isbuffer`, minor edits + +## [4.0.0] - 2017-05-19 + +- Merge pull request #8 from tunnckoCore/master +- update deps + +## [3.2.2] - 2017-05-16 + +- fix version + +## [3.2.1] - 2017-05-16 + +- add browserify + +## [3.2.0] - 2017-04-25 + +- Merge pull request #10 from ksheedlo/unrequire-buffer +- add `promise` support and tests +- Remove unnecessary `Buffer` check + +## [3.1.0] - 2016-12-07 + +- Merge pull request #7 from laggingreflex/err +- add support for `error` and tests +- run update + +## [3.0.4] - 2016-07-29 + +- move tests +- run update + +## [3.0.3] - 2016-05-03 + +- fix prepublish script +- remove unused dep + +## [3.0.0] - 2015-11-17 + +- add typed array support +- Merge pull request #5 from miguelmota/typed-arrays +- adds new tests + +## [2.0.1] - 2015-08-21 + +- use `is-buffer` module + +## [2.0.0] - 2015-05-31 + +- Create fallback for `Array.isArray` if used as a browser package +- Merge pull request #2 from dtothefp/patch-1 +- Merge pull request #3 from pdehaan/patch-1 +- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master +- optimizations, mostly date and regex + +## [1.1.0] - 2015-02-09 + +- adds `buffer` support +- adds tests for `buffer` + +## [1.0.0] - 2015-01-19 + +- update benchmarks +- optimizations based on benchmarks + +## [0.1.2] - 2014-10-26 + +- return `typeof` value if it's not an object. very slight speed improvement +- use `.slice` +- adds benchmarks + +## [0.1.0] - 2014-9-26 + +- first commit + +[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 +[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 +[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 +[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 +[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 +[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 +[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 +[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 +[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 +[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 +[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 + +[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog \ No newline at end of file diff --git a/node_modules/kind-of/LICENSE b/node_modules/kind-of/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. diff --git a/node_modules/kind-of/README.md b/node_modules/kind-of/README.md new file mode 100644 index 0000000..0411dc5 --- /dev/null +++ b/node_modules/kind-of/README.md @@ -0,0 +1,367 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, es6, and browser ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(new Error('error')); +//=> 'error' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'generatorfunction' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). + +```bash +# arguments (32 bytes) + kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) + lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) + lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) + + fastest is kind-of (by 161% avg) + +# array (22 bytes) + kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) + lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) + lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) + + fastest is kind-of (by 196% avg) + +# boolean (24 bytes) + kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) + lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) + lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) + + fastest is kind-of (by 204% avg) + +# buffer (38 bytes) + kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) + lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) + lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) + + fastest is kind-of (by 247% avg) + +# date (30 bytes) + kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) + lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) + lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) + + fastest is kind-of (by 184% avg) + +# error (36 bytes) + kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) + lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) + lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) + + fastest is kind-of (by 127% avg) + +# function (34 bytes) + kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) + lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) + lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) + + fastest is kind-of (by 113% avg) + +# null (24 bytes) + kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) + lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) + lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) + + fastest is kind-of (by 174% avg) + +# number (22 bytes) + kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) + lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) + lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) + + fastest is kind-of (by 632% avg) + +# object-plain (47 bytes) + kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) + lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) + lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) + + fastest is lib-type-of (by 112% avg) + +# regex (25 bytes) + kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) + lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) + lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) + + fastest is kind-of (by 158% avg) + +# string (33 bytes) + kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) + lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) + lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) + + fastest is kind-of (by 220% avg) + +# symbol (34 bytes) + kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) + lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) + lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) + + fastest is kind-of (by 310% avg) + +# template-strings (36 bytes) + kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) + lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) + lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) + + fastest is kind-of (by 210% avg) + +# undefined (29 bytes) + kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) + lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) + lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) + + fastest is lib-typeof,kind-of + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly identifies instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/micromatch/is-glob) | [homepage](https://github.com/micromatch/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if a number or string value is a finite number. Useful for regex… [more](https://github.com/jonschlinkert/is-number) | [homepage](https://github.com/jonschlinkert/is-number "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 102 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [tunnckoCore](https://github.com/tunnckoCore) | +| 1 | [xiaofen9](https://github.com/xiaofen9) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2020, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on January 16, 2020._ \ No newline at end of file diff --git a/node_modules/kind-of/index.js b/node_modules/kind-of/index.js new file mode 100644 index 0000000..dfa799b --- /dev/null +++ b/node_modules/kind-of/index.js @@ -0,0 +1,129 @@ +var toString = Object.prototype.toString; + +module.exports = function kindOf(val) { + if (val === void 0) return 'undefined'; + if (val === null) return 'null'; + + var type = typeof val; + if (type === 'boolean') return 'boolean'; + if (type === 'string') return 'string'; + if (type === 'number') return 'number'; + if (type === 'symbol') return 'symbol'; + if (type === 'function') { + return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + } + + if (isArray(val)) return 'array'; + if (isBuffer(val)) return 'buffer'; + if (isArguments(val)) return 'arguments'; + if (isDate(val)) return 'date'; + if (isError(val)) return 'error'; + if (isRegexp(val)) return 'regexp'; + + switch (ctorName(val)) { + case 'Symbol': return 'symbol'; + case 'Promise': return 'promise'; + + // Set, Map, WeakSet, WeakMap + case 'WeakMap': return 'weakmap'; + case 'WeakSet': return 'weakset'; + case 'Map': return 'map'; + case 'Set': return 'set'; + + // 8-bit typed arrays + case 'Int8Array': return 'int8array'; + case 'Uint8Array': return 'uint8array'; + case 'Uint8ClampedArray': return 'uint8clampedarray'; + + // 16-bit typed arrays + case 'Int16Array': return 'int16array'; + case 'Uint16Array': return 'uint16array'; + + // 32-bit typed arrays + case 'Int32Array': return 'int32array'; + case 'Uint32Array': return 'uint32array'; + case 'Float32Array': return 'float32array'; + case 'Float64Array': return 'float64array'; + } + + if (isGeneratorObj(val)) { + return 'generator'; + } + + // Non-plain objects + type = toString.call(val); + switch (type) { + case '[object Object]': return 'object'; + // iterators + case '[object Map Iterator]': return 'mapiterator'; + case '[object Set Iterator]': return 'setiterator'; + case '[object String Iterator]': return 'stringiterator'; + case '[object Array Iterator]': return 'arrayiterator'; + } + + // other + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; + +function ctorName(val) { + return typeof val.constructor === 'function' ? val.constructor.name : null; +} + +function isArray(val) { + if (Array.isArray) return Array.isArray(val); + return val instanceof Array; +} + +function isError(val) { + return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); +} + +function isDate(val) { + if (val instanceof Date) return true; + return typeof val.toDateString === 'function' + && typeof val.getDate === 'function' + && typeof val.setDate === 'function'; +} + +function isRegexp(val) { + if (val instanceof RegExp) return true; + return typeof val.flags === 'string' + && typeof val.ignoreCase === 'boolean' + && typeof val.multiline === 'boolean' + && typeof val.global === 'boolean'; +} + +function isGeneratorFn(name, val) { + return ctorName(name) === 'GeneratorFunction'; +} + +function isGeneratorObj(val) { + return typeof val.throw === 'function' + && typeof val.return === 'function' + && typeof val.next === 'function'; +} + +function isArguments(val) { + try { + if (typeof val.length === 'number' && typeof val.callee === 'function') { + return true; + } + } catch (err) { + if (err.message.indexOf('callee') !== -1) { + return true; + } + } + return false; +} + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + if (val.constructor && typeof val.constructor.isBuffer === 'function') { + return val.constructor.isBuffer(val); + } + return false; +} diff --git a/node_modules/kind-of/package.json b/node_modules/kind-of/package.json new file mode 100644 index 0000000..5820cad --- /dev/null +++ b/node_modules/kind-of/package.json @@ -0,0 +1,88 @@ +{ + "name": "kind-of", + "description": "Get the native type of a value.", + "version": "6.0.3", + "homepage": "https://github.com/jonschlinkert/kind-of", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "David Fox-Powell (https://dtothefp.github.io/me)", + "James (https://twitter.com/aretecode)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Ken Sheedlo (kensheedlo.com)", + "laggingreflex (https://github.com/laggingreflex)", + "Miguel Mota (https://miguelmota.com)", + "Peter deHaan (http://about.me/peterdehaan)", + "tunnckoCore (https://i.am.charlike.online)" + ], + "repository": "jonschlinkert/kind-of", + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha", + "prepublish": "browserify -o browser.js -e index.js -s index --bare" + }, + "devDependencies": { + "benchmarked": "^2.0.0", + "browserify": "^14.4.0", + "gulp-format-md": "^1.0.0", + "mocha": "^4.0.1", + "write": "^1.0.3" + }, + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + } +} diff --git a/node_modules/kleur/colors.d.ts b/node_modules/kleur/colors.d.ts new file mode 100644 index 0000000..cab25c6 --- /dev/null +++ b/node_modules/kleur/colors.d.ts @@ -0,0 +1,38 @@ +declare function print(input: string | boolean | number): string; +declare function print(input: undefined | void): undefined; +declare function print(input: null): null; +type Colorize = typeof print; + +export declare const $: { enabled: boolean }; + +// Colors +export declare const black: Colorize; +export declare const red: Colorize; +export declare const green: Colorize; +export declare const yellow: Colorize; +export declare const blue: Colorize; +export declare const magenta: Colorize; +export declare const cyan: Colorize; +export declare const white: Colorize; +export declare const gray: Colorize; +export declare const grey: Colorize; + +// Backgrounds +export declare const bgBlack: Colorize; +export declare const bgRed: Colorize; +export declare const bgGreen: Colorize; +export declare const bgYellow: Colorize; +export declare const bgBlue: Colorize; +export declare const bgMagenta: Colorize; +export declare const bgCyan: Colorize; +export declare const bgWhite: Colorize; + +// Modifiers +export declare const reset: Colorize; +export declare const bold: Colorize; +export declare const dim: Colorize; +export declare const italic: Colorize; +export declare const underline: Colorize; +export declare const inverse: Colorize; +export declare const hidden: Colorize; +export declare const strikethrough: Colorize; diff --git a/node_modules/kleur/colors.js b/node_modules/kleur/colors.js new file mode 100644 index 0000000..89fb012 --- /dev/null +++ b/node_modules/kleur/colors.js @@ -0,0 +1,53 @@ +let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; +if (typeof process !== 'undefined') { + ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); + isTTY = process.stdout && process.stdout.isTTY; +} + +const $ = exports.$ = { + enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( + FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY + ) +} + +function init(x, y) { + let rgx = new RegExp(`\\x1b\\[${y}m`, 'g'); + let open = `\x1b[${x}m`, close = `\x1b[${y}m`; + + return function (txt) { + if (!$.enabled || txt == null) return txt; + return open + (!!~(''+txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close; + }; +} + +// modifiers +exports.reset = init(0, 0); +exports.bold = init(1, 22); +exports.dim = init(2, 22); +exports.italic = init(3, 23); +exports.underline = init(4, 24); +exports.inverse = init(7, 27); +exports.hidden = init(8, 28); +exports.strikethrough = init(9, 29); + +// colors +exports.black = init(30, 39); +exports.red = init(31, 39); +exports.green = init(32, 39); +exports.yellow = init(33, 39); +exports.blue = init(34, 39); +exports.magenta = init(35, 39); +exports.cyan = init(36, 39); +exports.white = init(37, 39); +exports.gray = init(90, 39); +exports.grey = init(90, 39); + +// background colors +exports.bgBlack = init(40, 49); +exports.bgRed = init(41, 49); +exports.bgGreen = init(42, 49); +exports.bgYellow = init(43, 49); +exports.bgBlue = init(44, 49); +exports.bgMagenta = init(45, 49); +exports.bgCyan = init(46, 49); +exports.bgWhite = init(47, 49); diff --git a/node_modules/kleur/colors.mjs b/node_modules/kleur/colors.mjs new file mode 100644 index 0000000..e9feb83 --- /dev/null +++ b/node_modules/kleur/colors.mjs @@ -0,0 +1,53 @@ +let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; +if (typeof process !== 'undefined') { + ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); + isTTY = process.stdout && process.stdout.isTTY; +} + +export const $ = { + enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( + FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY + ) +} + +function init(x, y) { + let rgx = new RegExp(`\\x1b\\[${y}m`, 'g'); + let open = `\x1b[${x}m`, close = `\x1b[${y}m`; + + return function (txt) { + if (!$.enabled || txt == null) return txt; + return open + (!!~(''+txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close; + }; +} + +// modifiers +export const reset = init(0, 0); +export const bold = init(1, 22); +export const dim = init(2, 22); +export const italic = init(3, 23); +export const underline = init(4, 24); +export const inverse = init(7, 27); +export const hidden = init(8, 28); +export const strikethrough = init(9, 29); + +// colors +export const black = init(30, 39); +export const red = init(31, 39); +export const green = init(32, 39); +export const yellow = init(33, 39); +export const blue = init(34, 39); +export const magenta = init(35, 39); +export const cyan = init(36, 39); +export const white = init(37, 39); +export const gray = init(90, 39); +export const grey = init(90, 39); + +// background colors +export const bgBlack = init(40, 49); +export const bgRed = init(41, 49); +export const bgGreen = init(42, 49); +export const bgYellow = init(43, 49); +export const bgBlue = init(44, 49); +export const bgMagenta = init(45, 49); +export const bgCyan = init(46, 49); +export const bgWhite = init(47, 49); diff --git a/node_modules/kleur/index.d.ts b/node_modules/kleur/index.d.ts new file mode 100644 index 0000000..fdc26ca --- /dev/null +++ b/node_modules/kleur/index.d.ts @@ -0,0 +1,45 @@ +// Originally by: Rogier Schouten +// Adapted by: Madhav Varshney +declare namespace kleur { + interface Color { + (x: string | number): string; + (): Kleur; + } + + interface Kleur { + // Colors + black: Color; + red: Color; + green: Color; + yellow: Color; + blue: Color; + magenta: Color; + cyan: Color; + white: Color; + gray: Color; + grey: Color; + + // Backgrounds + bgBlack: Color; + bgRed: Color; + bgGreen: Color; + bgYellow: Color; + bgBlue: Color; + bgMagenta: Color; + bgCyan: Color; + bgWhite: Color; + + // Modifiers + reset: Color; + bold: Color; + dim: Color; + italic: Color; + underline: Color; + inverse: Color; + hidden: Color; + strikethrough: Color; + } +} + +declare let kleur: kleur.Kleur & { enabled: boolean }; +export = kleur; diff --git a/node_modules/kleur/index.js b/node_modules/kleur/index.js new file mode 100644 index 0000000..5800b98 --- /dev/null +++ b/node_modules/kleur/index.js @@ -0,0 +1,110 @@ +'use strict'; + +let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; +if (typeof process !== 'undefined') { + ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); + isTTY = process.stdout && process.stdout.isTTY; +} + +const $ = { + enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( + FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY + ), + + // modifiers + reset: init(0, 0), + bold: init(1, 22), + dim: init(2, 22), + italic: init(3, 23), + underline: init(4, 24), + inverse: init(7, 27), + hidden: init(8, 28), + strikethrough: init(9, 29), + + // colors + black: init(30, 39), + red: init(31, 39), + green: init(32, 39), + yellow: init(33, 39), + blue: init(34, 39), + magenta: init(35, 39), + cyan: init(36, 39), + white: init(37, 39), + gray: init(90, 39), + grey: init(90, 39), + + // background colors + bgBlack: init(40, 49), + bgRed: init(41, 49), + bgGreen: init(42, 49), + bgYellow: init(43, 49), + bgBlue: init(44, 49), + bgMagenta: init(45, 49), + bgCyan: init(46, 49), + bgWhite: init(47, 49) +}; + +function run(arr, str) { + let i=0, tmp, beg='', end=''; + for (; i < arr.length; i++) { + tmp = arr[i]; + beg += tmp.open; + end += tmp.close; + if (!!~str.indexOf(tmp.close)) { + str = str.replace(tmp.rgx, tmp.close + tmp.open); + } + } + return beg + str + end; +} + +function chain(has, keys) { + let ctx = { has, keys }; + + ctx.reset = $.reset.bind(ctx); + ctx.bold = $.bold.bind(ctx); + ctx.dim = $.dim.bind(ctx); + ctx.italic = $.italic.bind(ctx); + ctx.underline = $.underline.bind(ctx); + ctx.inverse = $.inverse.bind(ctx); + ctx.hidden = $.hidden.bind(ctx); + ctx.strikethrough = $.strikethrough.bind(ctx); + + ctx.black = $.black.bind(ctx); + ctx.red = $.red.bind(ctx); + ctx.green = $.green.bind(ctx); + ctx.yellow = $.yellow.bind(ctx); + ctx.blue = $.blue.bind(ctx); + ctx.magenta = $.magenta.bind(ctx); + ctx.cyan = $.cyan.bind(ctx); + ctx.white = $.white.bind(ctx); + ctx.gray = $.gray.bind(ctx); + ctx.grey = $.grey.bind(ctx); + + ctx.bgBlack = $.bgBlack.bind(ctx); + ctx.bgRed = $.bgRed.bind(ctx); + ctx.bgGreen = $.bgGreen.bind(ctx); + ctx.bgYellow = $.bgYellow.bind(ctx); + ctx.bgBlue = $.bgBlue.bind(ctx); + ctx.bgMagenta = $.bgMagenta.bind(ctx); + ctx.bgCyan = $.bgCyan.bind(ctx); + ctx.bgWhite = $.bgWhite.bind(ctx); + + return ctx; +} + +function init(open, close) { + let blk = { + open: `\x1b[${open}m`, + close: `\x1b[${close}m`, + rgx: new RegExp(`\\x1b\\[${close}m`, 'g') + }; + return function (txt) { + if (this !== void 0 && this.has !== void 0) { + !!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk)); + return txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+''; + } + return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+''; + }; +} + +module.exports = $; diff --git a/node_modules/kleur/index.mjs b/node_modules/kleur/index.mjs new file mode 100644 index 0000000..96dadad --- /dev/null +++ b/node_modules/kleur/index.mjs @@ -0,0 +1,110 @@ +'use strict'; + +let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; +if (typeof process !== 'undefined') { + ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); + isTTY = process.stdout && process.stdout.isTTY; +} + +const $ = { + enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( + FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY + ), + + // modifiers + reset: init(0, 0), + bold: init(1, 22), + dim: init(2, 22), + italic: init(3, 23), + underline: init(4, 24), + inverse: init(7, 27), + hidden: init(8, 28), + strikethrough: init(9, 29), + + // colors + black: init(30, 39), + red: init(31, 39), + green: init(32, 39), + yellow: init(33, 39), + blue: init(34, 39), + magenta: init(35, 39), + cyan: init(36, 39), + white: init(37, 39), + gray: init(90, 39), + grey: init(90, 39), + + // background colors + bgBlack: init(40, 49), + bgRed: init(41, 49), + bgGreen: init(42, 49), + bgYellow: init(43, 49), + bgBlue: init(44, 49), + bgMagenta: init(45, 49), + bgCyan: init(46, 49), + bgWhite: init(47, 49) +}; + +function run(arr, str) { + let i=0, tmp, beg='', end=''; + for (; i < arr.length; i++) { + tmp = arr[i]; + beg += tmp.open; + end += tmp.close; + if (!!~str.indexOf(tmp.close)) { + str = str.replace(tmp.rgx, tmp.close + tmp.open); + } + } + return beg + str + end; +} + +function chain(has, keys) { + let ctx = { has, keys }; + + ctx.reset = $.reset.bind(ctx); + ctx.bold = $.bold.bind(ctx); + ctx.dim = $.dim.bind(ctx); + ctx.italic = $.italic.bind(ctx); + ctx.underline = $.underline.bind(ctx); + ctx.inverse = $.inverse.bind(ctx); + ctx.hidden = $.hidden.bind(ctx); + ctx.strikethrough = $.strikethrough.bind(ctx); + + ctx.black = $.black.bind(ctx); + ctx.red = $.red.bind(ctx); + ctx.green = $.green.bind(ctx); + ctx.yellow = $.yellow.bind(ctx); + ctx.blue = $.blue.bind(ctx); + ctx.magenta = $.magenta.bind(ctx); + ctx.cyan = $.cyan.bind(ctx); + ctx.white = $.white.bind(ctx); + ctx.gray = $.gray.bind(ctx); + ctx.grey = $.grey.bind(ctx); + + ctx.bgBlack = $.bgBlack.bind(ctx); + ctx.bgRed = $.bgRed.bind(ctx); + ctx.bgGreen = $.bgGreen.bind(ctx); + ctx.bgYellow = $.bgYellow.bind(ctx); + ctx.bgBlue = $.bgBlue.bind(ctx); + ctx.bgMagenta = $.bgMagenta.bind(ctx); + ctx.bgCyan = $.bgCyan.bind(ctx); + ctx.bgWhite = $.bgWhite.bind(ctx); + + return ctx; +} + +function init(open, close) { + let blk = { + open: `\x1b[${open}m`, + close: `\x1b[${close}m`, + rgx: new RegExp(`\\x1b\\[${close}m`, 'g') + }; + return function (txt) { + if (this !== void 0 && this.has !== void 0) { + !!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk)); + return txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+''; + } + return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+''; + }; +} + +export default $; diff --git a/node_modules/kleur/license b/node_modules/kleur/license new file mode 100644 index 0000000..a3f96f8 --- /dev/null +++ b/node_modules/kleur/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Luke Edwards (lukeed.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. diff --git a/node_modules/kleur/package.json b/node_modules/kleur/package.json new file mode 100644 index 0000000..5007c05 --- /dev/null +++ b/node_modules/kleur/package.json @@ -0,0 +1,51 @@ +{ + "name": "kleur", + "version": "4.1.5", + "repository": "lukeed/kleur", + "description": "The fastest Node.js library for formatting terminal text with ANSI colors~!", + "module": "index.mjs", + "types": "index.d.ts", + "main": "index.js", + "license": "MIT", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.mjs", + "require": "./index.js" + }, + "./colors": { + "types": "./colors.d.ts", + "import": "./colors.mjs", + "require": "./colors.js" + } + }, + "files": [ + "*.d.ts", + "colors.*", + "index.*" + ], + "author": { + "name": "Luke Edwards", + "email": "luke.edwards05@gmail.com", + "url": "https://lukeed.com" + }, + "scripts": { + "build": "node build", + "test": "uvu -r esm -i utils -i xyz" + }, + "engines": { + "node": ">=6" + }, + "keywords": [ + "ansi", + "cli", + "color", + "colors", + "console", + "terminal" + ], + "devDependencies": { + "esm": "3.2.25", + "uvu": "0.3.3" + } +} diff --git a/node_modules/kleur/readme.md b/node_modules/kleur/readme.md new file mode 100644 index 0000000..de7f5aa --- /dev/null +++ b/node_modules/kleur/readme.md @@ -0,0 +1,232 @@ +
    + kleur +
    + + + +
    The fastest Node.js library for formatting terminal text with ANSI colors~!
    + +## Features + +* No dependencies +* Super [lightweight](#load-time) & [performant](#performance) +* Supports [nested](#nested-methods) & [chained](#chained-methods) colors +* No `String.prototype` modifications +* Conditional [color support](#conditional-support) +* [Fully treeshakable](#individual-colors) +* Familiar [API](#api) + +--- + +As of `v3.0` the Chalk-style syntax (magical getter) is no longer used.
    Please visit [History](#history) for migration paths supporting that syntax. + +--- + + +## Install + +``` +$ npm install --save kleur +``` + + +## Usage + +```js +import kleur from 'kleur'; + +// basic usage +kleur.red('red text'); + +// chained methods +kleur.blue().bold().underline('howdy partner'); + +// nested methods +kleur.bold(`${ white().bgRed('[ERROR]') } ${ kleur.red().italic('Something happened')}`); +``` + +### Chained Methods + +```js +const { bold, green } = require('kleur'); + +console.log(bold().red('this is a bold red message')); +console.log(bold().italic('this is a bold italicized message')); +console.log(bold().yellow().bgRed().italic('this is a bold yellow italicized message')); +console.log(green().bold().underline('this is a bold green underlined message')); +``` + + + +### Nested Methods + +```js +const { yellow, red, cyan } = require('kleur'); + +console.log(yellow(`foo ${red().bold('red')} bar ${cyan('cyan')} baz`)); +console.log(yellow('foo ' + red().bold('red') + ' bar ' + cyan('cyan') + ' baz')); +``` + + + + +### Conditional Support + +Toggle color support as needed; `kleur` includes simple auto-detection which may not cover all cases. + +> **Note:** Both `kleur` and `kleur/colors` share the same detection logic. + +```js +import kleur from 'kleur'; + +// manually disable +kleur.enabled = false; + +// or use another library to detect support +kleur.enabled = require('color-support').level > 0; + +console.log(kleur.red('I will only be colored red if the terminal supports colors')); +``` + +> **Important:**
    Colors will be disabled automatically in non [TTY contexts](https://nodejs.org/api/process.html#process_a_note_on_process_i_o). For example, spawning another process or piping output into another process will disable colorization automatically. To force colors in your piped output, you may do so with the `FORCE_COLOR=1` environment variable: + +```sh +$ node app.js #=> COLORS +$ node app.js > log.txt #=> NO COLORS +$ FORCE_COLOR=1 node app.js > log.txt #=> COLORS +$ FORCE_COLOR=0 node app.js > log.txt #=> NO COLORS +``` + +## API + +Any `kleur` method returns a `String` when invoked with input; otherwise chaining is expected. + +> It's up to the developer to pass the output to destinations like `console.log`, `process.stdout.write`, etc. + +The methods below are grouped by type for legibility purposes only. They each can be [chained](#chained-methods) or [nested](#nested-methods) with one another. + +***Colors:*** +> black — red — green — yellow — blue — magenta — cyan — white — gray — grey + +***Backgrounds:*** +> bgBlack — bgRed — bgGreen — bgYellow — bgBlue — bgMagenta — bgCyan — bgWhite + +***Modifiers:*** +> reset — bold — dim — italic* — underline — inverse — hidden — strikethrough* + +* Not widely supported + + +## Individual Colors + +When you only need a few colors, it doesn't make sense to import _all_ of `kleur` because, as small as it is, `kleur` is not treeshakeable, and so most of its code will be doing nothing. In order to fix this, you can import from the `kleur/colors` submodule which _fully_ supports tree-shaking. + +The caveat with this approach is that color functions **are not** chainable~!
    Each function receives and colorizes its input. You may combine colors, backgrounds, and modifiers by nesting function calls within other functions. + +```js +// or: import * as kleur from 'kleur/colors'; +import { red, underline, bgWhite } from 'kleur/colors'; + +red('red text'); +//~> kleur.red('red text'); + +underline(red('red underlined text')); +//~> kleur.underline().red('red underlined text'); + +bgWhite(underline(red('red underlined text w/ white background'))); +//~> kleur.bgWhite().underline().red('red underlined text w/ white background'); +``` + +> **Note:** All the same [colors, backgrounds, and modifiers](#api) are available. + +***Conditional Support*** + +The `kleur/colors` submodule also allows you to toggle color support, as needed.
    +It includes the same initial assumptions as `kleur`, in an attempt to have colors enabled by default. + +Unlike `kleur`, this setting exists as `kleur.$.enabled` instead of `kleur.enabled`: + +```js +import * as kleur from 'kleur/colors'; +// or: import { $, red } from 'kleur/colors'; + +// manually disabled +kleur.$.enabled = false; + +// or use another library to detect support +kleur.$.enabled = require('color-support').level > 0; + +console.log(red('I will only be colored red if the terminal supports colors')); +``` + + +## Benchmarks + +> Using Node v10.13.0 + +### Load time + +``` +chalk :: 5.303ms +kleur :: 0.488ms +kleur/colors :: 0.369ms +ansi-colors :: 1.504ms +``` + +### Performance + +``` +# All Colors + ansi-colors x 177,625 ops/sec ±1.47% (92 runs sampled) + chalk x 611,907 ops/sec ±0.20% (92 runs sampled) + kleur x 742,509 ops/sec ±1.47% (93 runs sampled) + kleur/colors x 881,742 ops/sec ±0.19% (98 runs sampled) + +# Stacked colors + ansi-colors x 23,331 ops/sec ±1.81% (94 runs sampled) + chalk x 337,178 ops/sec ±0.20% (98 runs sampled) + kleur x 78,299 ops/sec ±1.01% (97 runs sampled) + kleur/colors x 104,431 ops/sec ±0.22% (97 runs sampled) + +# Nested colors + ansi-colors x 67,181 ops/sec ±1.15% (92 runs sampled) + chalk x 116,361 ops/sec ±0.63% (94 runs sampled) + kleur x 139,514 ops/sec ±0.76% (95 runs sampled) + kleur/colors x 145,716 ops/sec ±0.97% (97 runs sampled) +``` + + +## History + +This project originally forked [`ansi-colors`](https://github.com/doowb/ansi-colors). + +Beginning with `kleur@3.0`, the Chalk-style syntax (magical getter) has been replaced with function calls per key: + +```js +// Old: +c.red.bold.underline('old'); + +// New: +c.red().bold().underline('new'); +``` +> As I work more with Rust, the newer syntax feels so much better & more natural! + +If you prefer the old syntax, you may migrate to `ansi-colors` or newer `chalk` releases.
    Versions below `kleur@3.0` have been officially deprecated. + + +## License + +MIT © [Luke Edwards](https://lukeed.com) diff --git a/node_modules/lilconfig/LICENSE b/node_modules/lilconfig/LICENSE new file mode 100644 index 0000000..fd866f4 --- /dev/null +++ b/node_modules/lilconfig/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Anton Kastritskiy + +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. diff --git a/node_modules/lilconfig/dist/index.d.ts b/node_modules/lilconfig/dist/index.d.ts new file mode 100644 index 0000000..766c58c --- /dev/null +++ b/node_modules/lilconfig/dist/index.d.ts @@ -0,0 +1,38 @@ +export declare type LilconfigResult = null | { + filepath: string; + config: any; + isEmpty?: boolean; +}; +interface OptionsBase { + stopDir?: string; + searchPlaces?: string[]; + ignoreEmptySearchPlaces?: boolean; + packageProp?: string | string[]; +} +export declare type Transform = TransformSync | ((result: LilconfigResult) => Promise); +export declare type TransformSync = (result: LilconfigResult) => LilconfigResult; +declare type LoaderResult = any; +export declare type LoaderSync = (filepath: string, content: string) => LoaderResult; +export declare type Loader = LoaderSync | ((filepath: string, content: string) => Promise); +export declare type Loaders = Record; +export declare type LoadersSync = Record; +export interface Options extends OptionsBase { + loaders?: Loaders; + transform?: Transform; +} +export interface OptionsSync extends OptionsBase { + loaders?: LoadersSync; + transform?: TransformSync; +} +export declare const defaultLoaders: LoadersSync; +declare type AsyncSearcher = { + search(searchFrom?: string): Promise; + load(filepath: string): Promise; +}; +export declare function lilconfig(name: string, options?: Partial): AsyncSearcher; +declare type SyncSearcher = { + search(searchFrom?: string): LilconfigResult; + load(filepath: string): LilconfigResult; +}; +export declare function lilconfigSync(name: string, options?: OptionsSync): SyncSearcher; +export {}; diff --git a/node_modules/lilconfig/dist/index.js b/node_modules/lilconfig/dist/index.js new file mode 100644 index 0000000..13cca57 --- /dev/null +++ b/node_modules/lilconfig/dist/index.js @@ -0,0 +1,251 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lilconfigSync = exports.lilconfig = exports.defaultLoaders = void 0; +const path = require("path"); +const fs = require("fs"); +const os = require("os"); +const fsReadFileAsync = fs.promises.readFile; +function getDefaultSearchPlaces(name) { + return [ + 'package.json', + `.${name}rc.json`, + `.${name}rc.js`, + `.${name}rc.cjs`, + `.config/${name}rc`, + `.config/${name}rc.json`, + `.config/${name}rc.js`, + `.config/${name}rc.cjs`, + `${name}.config.js`, + `${name}.config.cjs`, + ]; +} +function getSearchPaths(startDir, stopDir) { + return startDir + .split(path.sep) + .reduceRight((acc, _, ind, arr) => { + const currentPath = arr.slice(0, ind + 1).join(path.sep); + if (!acc.passedStopDir) + acc.searchPlaces.push(currentPath || path.sep); + if (currentPath === stopDir) + acc.passedStopDir = true; + return acc; + }, { searchPlaces: [], passedStopDir: false }).searchPlaces; +} +exports.defaultLoaders = Object.freeze({ + '.js': require, + '.json': require, + '.cjs': require, + noExt(_, content) { + return JSON.parse(content); + }, +}); +function getExtDesc(ext) { + return ext === 'noExt' ? 'files without extensions' : `extension "${ext}"`; +} +function getOptions(name, options = {}) { + const conf = { + stopDir: os.homedir(), + searchPlaces: getDefaultSearchPlaces(name), + ignoreEmptySearchPlaces: true, + transform: (x) => x, + packageProp: [name], + ...options, + loaders: { ...exports.defaultLoaders, ...options.loaders }, + }; + conf.searchPlaces.forEach(place => { + const key = path.extname(place) || 'noExt'; + const loader = conf.loaders[key]; + if (!loader) { + throw new Error(`No loader specified for ${getExtDesc(key)}, so searchPlaces item "${place}" is invalid`); + } + if (typeof loader !== 'function') { + throw new Error(`loader for ${getExtDesc(key)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`); + } + }); + return conf; +} +function getPackageProp(props, obj) { + if (typeof props === 'string' && props in obj) + return obj[props]; + return ((Array.isArray(props) ? props : props.split('.')).reduce((acc, prop) => (acc === undefined ? acc : acc[prop]), obj) || null); +} +function getSearchItems(searchPlaces, searchPaths) { + return searchPaths.reduce((acc, searchPath) => { + searchPlaces.forEach(sp => acc.push({ + searchPlace: sp, + filepath: path.join(searchPath, sp), + loaderKey: path.extname(sp) || 'noExt', + })); + return acc; + }, []); +} +function validateFilePath(filepath) { + if (!filepath) + throw new Error('load must pass a non-empty string'); +} +function validateLoader(loader, ext) { + if (!loader) + throw new Error(`No loader specified for extension "${ext}"`); + if (typeof loader !== 'function') + throw new Error('loader is not a function'); +} +function lilconfig(name, options) { + const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, } = getOptions(name, options); + return { + async search(searchFrom = process.cwd()) { + const searchPaths = getSearchPaths(searchFrom, stopDir); + const result = { + config: null, + filepath: '', + }; + const searchItems = getSearchItems(searchPlaces, searchPaths); + for (const { searchPlace, filepath, loaderKey } of searchItems) { + try { + await fs.promises.access(filepath); + } + catch (_a) { + continue; + } + const content = String(await fsReadFileAsync(filepath)); + const loader = loaders[loaderKey]; + if (searchPlace === 'package.json') { + const pkg = await loader(filepath, content); + const maybeConfig = getPackageProp(packageProp, pkg); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break; + } + continue; + } + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + continue; + if (isEmpty) { + result.isEmpty = true; + result.config = undefined; + } + else { + validateLoader(loader, loaderKey); + result.config = await loader(filepath, content); + } + result.filepath = filepath; + break; + } + if (result.filepath === '' && result.config === null) + return transform(null); + return transform(result); + }, + async load(filepath) { + validateFilePath(filepath); + const absPath = path.resolve(process.cwd(), filepath); + const { base, ext } = path.parse(absPath); + const loaderKey = ext || 'noExt'; + const loader = loaders[loaderKey]; + validateLoader(loader, loaderKey); + const content = String(await fsReadFileAsync(absPath)); + if (base === 'package.json') { + const pkg = await loader(absPath, content); + return transform({ + config: getPackageProp(packageProp, pkg), + filepath: absPath, + }); + } + const result = { + config: null, + filepath: absPath, + }; + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + return transform({ + config: undefined, + filepath: absPath, + isEmpty: true, + }); + result.config = isEmpty + ? undefined + : await loader(absPath, content); + return transform(isEmpty ? { ...result, isEmpty, config: undefined } : result); + }, + }; +} +exports.lilconfig = lilconfig; +function lilconfigSync(name, options) { + const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, } = getOptions(name, options); + return { + search(searchFrom = process.cwd()) { + const searchPaths = getSearchPaths(searchFrom, stopDir); + const result = { + config: null, + filepath: '', + }; + const searchItems = getSearchItems(searchPlaces, searchPaths); + for (const { searchPlace, filepath, loaderKey } of searchItems) { + try { + fs.accessSync(filepath); + } + catch (_a) { + continue; + } + const loader = loaders[loaderKey]; + const content = String(fs.readFileSync(filepath)); + if (searchPlace === 'package.json') { + const pkg = loader(filepath, content); + const maybeConfig = getPackageProp(packageProp, pkg); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break; + } + continue; + } + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + continue; + if (isEmpty) { + result.isEmpty = true; + result.config = undefined; + } + else { + validateLoader(loader, loaderKey); + result.config = loader(filepath, content); + } + result.filepath = filepath; + break; + } + if (result.filepath === '' && result.config === null) + return transform(null); + return transform(result); + }, + load(filepath) { + validateFilePath(filepath); + const absPath = path.resolve(process.cwd(), filepath); + const { base, ext } = path.parse(absPath); + const loaderKey = ext || 'noExt'; + const loader = loaders[loaderKey]; + validateLoader(loader, loaderKey); + const content = String(fs.readFileSync(absPath)); + if (base === 'package.json') { + const pkg = loader(absPath, content); + return transform({ + config: getPackageProp(packageProp, pkg), + filepath: absPath, + }); + } + const result = { + config: null, + filepath: absPath, + }; + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + return transform({ + filepath: absPath, + config: undefined, + isEmpty: true, + }); + result.config = isEmpty ? undefined : loader(absPath, content); + return transform(isEmpty ? { ...result, isEmpty, config: undefined } : result); + }, + }; +} +exports.lilconfigSync = lilconfigSync; diff --git a/node_modules/lilconfig/package.json b/node_modules/lilconfig/package.json new file mode 100644 index 0000000..8e06d1f --- /dev/null +++ b/node_modules/lilconfig/package.json @@ -0,0 +1,48 @@ +{ + "name": "lilconfig", + "version": "2.1.0", + "description": "A zero-dependency alternative to cosmiconfig", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "prebuild": "npm run clean", + "build": "tsc --declaration", + "postbuild": "du -h ./dist/*", + "clean": "rm -rf ./dist", + "test": "jest --coverage", + "lint": "eslint ./src/*.ts" + }, + "keywords": [ + "cosmiconfig", + "config", + "configuration", + "search" + ], + "files": [ + "dist/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/antonk52/lilconfig" + }, + "bugs": "https://github.com/antonk52/lilconfig/issues", + "author": "antonk52", + "license": "MIT", + "devDependencies": { + "@types/jest": "^27.0.2", + "@types/node": "^14.18.36", + "@typescript-eslint/eslint-plugin": "^5.54.0", + "@typescript-eslint/parser": "^5.54.0", + "cosmiconfig": "^7.1.0", + "eslint": "^8.35.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-prettier": "^4.2.1", + "jest": "^27.3.1", + "prettier": "^2.8.4", + "ts-jest": "27.0.7", + "typescript": "4.4.4" + }, + "engines": { + "node": ">=10" + } +} diff --git a/node_modules/lilconfig/readme.md b/node_modules/lilconfig/readme.md new file mode 100644 index 0000000..7b6610d --- /dev/null +++ b/node_modules/lilconfig/readme.md @@ -0,0 +1,118 @@ +# Lilconfig ⚙️ +[![npm version](https://badge.fury.io/js/lilconfig.svg)](https://badge.fury.io/js/lilconfig) +[![install size](https://packagephobia.now.sh/badge?p=lilconfig)](https://packagephobia.now.sh/result?p=lilconfig) +[![Coverage Status](https://coveralls.io/repos/github/antonk52/lilconfig/badge.svg)](https://coveralls.io/github/antonk52/lilconfig) + +A zero-dependency alternative to [cosmiconfig](https://www.npmjs.com/package/cosmiconfig) with the same API. + +## Installation + +```sh +npm install lilconfig +``` + +## Usage + +```js +import {lilconfig, lilconfigSync} from 'lilconfig'; + +// all keys are optional +const options = { + stopDir: '/Users/you/some/dir', + searchPlaces: ['package.json', 'myapp.conf.js'], + ignoreEmptySearchPlaces: false +} + +lilconfig( + 'myapp', + options // optional +).search() // Promise + +lilconfigSync( + 'myapp', + options // optional +).load(pathToConfig) // LilconfigResult + +/** + * LilconfigResult + * { + * config: any; // your config + * filepath: string; + * } + */ +``` + +## Difference to `cosmiconfig` +Lilconfig does not intend to be 100% compatible with `cosmiconfig` but tries to mimic it where possible. The key differences are: +- **no** support for yaml files out of the box(`lilconfig` attempts to parse files with no extension as JSON instead of YAML). You can still add the support for YAML files by providing a loader, see an [example](#yaml-loader) below. +- **no** cache + +### Options difference between the two. + +|cosmiconfig option | lilconfig | +|------------------------|-----------| +|cache | ❌ | +|loaders | ✅ | +|ignoreEmptySearchPlaces | ✅ | +|packageProp | ✅ | +|searchPlaces | ✅ | +|stopDir | ✅ | +|transform | ✅ | + +## Loaders examples + +### Yaml loader + +If you need the YAML support you can provide your own loader + +```js +import {lilconfig} from 'lilconfig'; +import yaml from 'yaml'; + +function loadYaml(filepath, content) { + return yaml.parse(content); +} + +const options = { + loaders: { + '.yaml': loadYaml, + '.yml': loadYaml, + // loader for files with no extension + noExt: loadYaml + } +}; + +lilconfig('myapp', options) + .search() + .then(result => { + result // {config, filepath} + }); +``` + +### ESM loader + +Lilconfig v2 does not support ESM modules out of the box. However, you can support it with a custom a loader. Note that this will only work with the async `lilconfig` function and won't work with the sync `lilconfigSync`. + +```js +import {lilconfig} from 'lilconfig'; + +const loadEsm = filepath => import(filepath); + +lilconfig('myapp', { + loaders: { + '.js': loadEsm, + '.mjs': loadEsm, + } +}) + .search() + .then(result => { + result // {config, filepath} + + result.config.default // if config uses `export default` + }); +``` + +## Version correlation + +- lilconig v1 → cosmiconfig v6 +- lilconig v2 → cosmiconfig v7 diff --git a/node_modules/lines-and-columns/LICENSE b/node_modules/lines-and-columns/LICENSE new file mode 100644 index 0000000..12978ec --- /dev/null +++ b/node_modules/lines-and-columns/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Brian Donovan + +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. diff --git a/node_modules/lines-and-columns/README.md b/node_modules/lines-and-columns/README.md new file mode 100644 index 0000000..fa90223 --- /dev/null +++ b/node_modules/lines-and-columns/README.md @@ -0,0 +1,33 @@ +# lines-and-columns + +Maps lines and columns to character offsets and back. This is useful for parsers +and other text processors that deal in character ranges but process text with +meaningful lines and columns. + +## Install + +``` +$ npm install [--save] lines-and-columns +``` + +## Usage + +```js +import { LinesAndColumns } from 'lines-and-columns' + +const lines = new LinesAndColumns( + `table { + border: 0 +}` +) + +lines.locationForIndex(9) +// { line: 1, column: 1 } + +lines.indexForLocation({ line: 1, column: 2 }) +// 10 +``` + +## License + +MIT diff --git a/node_modules/lines-and-columns/build/index.d.ts b/node_modules/lines-and-columns/build/index.d.ts new file mode 100644 index 0000000..459bc1f --- /dev/null +++ b/node_modules/lines-and-columns/build/index.d.ts @@ -0,0 +1,13 @@ +export declare type SourceLocation = { + line: number; + column: number; +}; +export declare class LinesAndColumns { + private string; + private offsets; + constructor(string: string); + locationForIndex(index: number): SourceLocation | null; + indexForLocation(location: SourceLocation): number | null; + private lengthOfLine; +} +export default LinesAndColumns; diff --git a/node_modules/lines-and-columns/build/index.js b/node_modules/lines-and-columns/build/index.js new file mode 100644 index 0000000..5117cad --- /dev/null +++ b/node_modules/lines-and-columns/build/index.js @@ -0,0 +1,62 @@ +"use strict"; +exports.__esModule = true; +exports.LinesAndColumns = void 0; +var LF = '\n'; +var CR = '\r'; +var LinesAndColumns = /** @class */ (function () { + function LinesAndColumns(string) { + this.string = string; + var offsets = [0]; + for (var offset = 0; offset < string.length;) { + switch (string[offset]) { + case LF: + offset += LF.length; + offsets.push(offset); + break; + case CR: + offset += CR.length; + if (string[offset] === LF) { + offset += LF.length; + } + offsets.push(offset); + break; + default: + offset++; + break; + } + } + this.offsets = offsets; + } + LinesAndColumns.prototype.locationForIndex = function (index) { + if (index < 0 || index > this.string.length) { + return null; + } + var line = 0; + var offsets = this.offsets; + while (offsets[line + 1] <= index) { + line++; + } + var column = index - offsets[line]; + return { line: line, column: column }; + }; + LinesAndColumns.prototype.indexForLocation = function (location) { + var line = location.line, column = location.column; + if (line < 0 || line >= this.offsets.length) { + return null; + } + if (column < 0 || column > this.lengthOfLine(line)) { + return null; + } + return this.offsets[line] + column; + }; + LinesAndColumns.prototype.lengthOfLine = function (line) { + var offset = this.offsets[line]; + var nextOffset = line === this.offsets.length - 1 + ? this.string.length + : this.offsets[line + 1]; + return nextOffset - offset; + }; + return LinesAndColumns; +}()); +exports.LinesAndColumns = LinesAndColumns; +exports["default"] = LinesAndColumns; diff --git a/node_modules/lines-and-columns/package.json b/node_modules/lines-and-columns/package.json new file mode 100644 index 0000000..a12eb6b --- /dev/null +++ b/node_modules/lines-and-columns/package.json @@ -0,0 +1,49 @@ +{ + "name": "lines-and-columns", + "version": "1.2.4", + "description": "Maps lines and columns to character offsets and back.", + "keywords": [ + "lines", + "columns", + "parser" + ], + "homepage": "https://github.com/eventualbuddha/lines-and-columns#readme", + "bugs": { + "url": "https://github.com/eventualbuddha/lines-and-columns/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/eventualbuddha/lines-and-columns.git" + }, + "license": "MIT", + "author": "Brian Donovan ", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "files": [ + "build" + ], + "scripts": { + "build:watch": "tsc --build tsconfig.build.json --watch", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "test": "is-ci test:coverage test:watch", + "test:coverage": "jest --coverage", + "test:watch": "jest --watch" + }, + "devDependencies": { + "@types/jest": "^27.0.3", + "@types/node": "^16.11.9", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "@typescript-eslint/parser": "^5.4.0", + "esbuild": "^0.13.15", + "esbuild-runner": "^2.2.1", + "eslint": "^8.2.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "is-ci-cli": "^2.2.0", + "jest": "^27.3.1", + "prettier": "^2.4.1", + "semantic-release": "^18.0.0", + "typescript": "^4.5.2" + } +} diff --git a/node_modules/linkify-it/LICENSE b/node_modules/linkify-it/LICENSE new file mode 100644 index 0000000..67596f5 --- /dev/null +++ b/node_modules/linkify-it/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2015 Vitaly Puzrin. + +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. diff --git a/node_modules/linkify-it/README.md b/node_modules/linkify-it/README.md new file mode 100644 index 0000000..2de5556 --- /dev/null +++ b/node_modules/linkify-it/README.md @@ -0,0 +1,195 @@ +linkify-it +========== + +[![CI](https://github.com/markdown-it/linkify-it/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/linkify-it/actions/workflows/ci.yml) +[![NPM version](https://img.shields.io/npm/v/linkify-it.svg?style=flat)](https://www.npmjs.org/package/linkify-it) +[![Coverage Status](https://img.shields.io/coveralls/markdown-it/linkify-it/master.svg?style=flat)](https://coveralls.io/r/markdown-it/linkify-it?branch=master) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markdown-it/linkify-it) + +> Links recognition library with FULL unicode support. +> Focused on high quality link patterns detection in plain text. + +__[Demo](http://markdown-it.github.io/linkify-it/)__ + +Why it's awesome: + +- Full unicode support, _with astral characters_! +- International domains support. +- Allows rules extension & custom normalizers. + + +Install +------- + +```bash +npm install linkify-it --save +``` + +Browserification is also supported. + + +Usage examples +-------------- + +##### Example 1 + +```js +var linkify = require('linkify-it')(); + +// Reload full tlds list & add unofficial `.onion` domain. +linkify + .tlds(require('tlds')) // Reload with full tlds list + .tlds('onion', true) // Add unofficial `.onion` domain + .add('git:', 'http:') // Add `git:` protocol as "alias" + .add('ftp:', null) // Disable `ftp:` protocol + .set({ fuzzyIP: true }); // Enable IPs in fuzzy links (without schema) + +console.log(linkify.test('Site github.com!')); // true + +console.log(linkify.match('Site github.com!')); // [ { + // schema: "", + // index: 5, + // lastIndex: 15, + // raw: "github.com", + // text: "github.com", + // url: "http://github.com", + // } ] +``` + +##### Example 2. Add twitter mentions handler + +```js +linkify.add('@', { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.twitter) { + self.re.twitter = new RegExp( + '^([a-zA-Z0-9_]){1,15}(?!_)(?=$|' + self.re.src_ZPCc + ')' + ); + } + if (self.re.twitter.test(tail)) { + // Linkifier allows punctuation chars before prefix, + // but we additionally disable `@` ("@@mention" is invalid) + if (pos >= 2 && tail[pos - 2] === '@') { + return false; + } + return tail.match(self.re.twitter)[0].length; + } + return 0; + }, + normalize: function (match) { + match.url = 'https://twitter.com/' + match.url.replace(/^@/, ''); + } +}); +``` + + +API +--- + +__[API documentation](http://markdown-it.github.io/linkify-it/doc)__ + +### new LinkifyIt(schemas, options) + +Creates new linkifier instance with optional additional schemas. +Can be called without `new` keyword for convenience. + +By default understands: + +- `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links +- "fuzzy" links and emails (google.com, foo@bar.com). + +`schemas` is an object, where each key/value describes protocol/rule: + +- __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` + for example). `linkify-it` makes sure that prefix is not preceded with + alphanumeric char. +- __value__ - rule to check tail after link prefix + - _String_ - just alias to existing rule + - _Object_ + - _validate_ - either a `RegExp` (start with `^`, and don't include the + link prefix itself), or a validator function which, given arguments + _text_, _pos_, and _self_, returns the length of a match in _text_ + starting at index _pos_. _pos_ is the index right after the link prefix. + _self_ can be used to access the linkify object to cache data. + - _normalize_ - optional function to normalize text & url of matched result + (for example, for twitter mentions). + +`options`: + +- __fuzzyLink__ - recognize URL-s without `http(s)://` head. Default `true`. +- __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts + like version numbers. Default `false`. +- __fuzzyEmail__ - recognize emails without `mailto:` prefix. Default `true`. +- __---__ - set `true` to terminate link with `---` (if it's considered as long dash). + + +### .test(text) + +Searches linkifiable pattern and returns `true` on success or `false` on fail. + + +### .pretest(text) + +Quick check if link MAY BE can exist. Can be used to optimize more expensive +`.test()` calls. Return `false` if link can not be found, `true` - if `.test()` +call needed to know exactly. + + +### .testSchemaAt(text, name, offset) + +Similar to `.test()` but checks only specific protocol tail exactly at given +position. Returns length of found pattern (0 on fail). + + +### .match(text) + +Returns `Array` of found link matches or null if nothing found. + +Each match has: + +- __schema__ - link schema, can be empty for fuzzy links, or `//` for + protocol-neutral links. +- __index__ - offset of matched text +- __lastIndex__ - index of next char after mathch end +- __raw__ - matched text +- __text__ - normalized text +- __url__ - link, generated from matched text + + +### .matchAtStart(text) + +Checks if a match exists at the start of the string. Returns `Match` +(see docs for `match(text)`) or null if no URL is at the start. +Doesn't work with fuzzy links. + + +### .tlds(list[, keepOld]) + +Load (or merge) new tlds list. Those are needed for fuzzy links (without schema) +to avoid false positives. By default: + +- 2-letter root zones are ok. +- biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф are ok. +- encoded (`xn--...`) root zones are ok. + +If that's not enough, you can reload defaults with more detailed zones list. + +### .add(key, value) + +Add a new schema to the schemas object. As described in the constructor +definition, `key` is a link prefix (`skype:`, for example), and `value` +is a String to alias to another schema, or an Object with `validate` and +optionally `normalize` definitions. To disable an existing rule, use +`.add(key, null)`. + + +### .set(options) + +Override default options. Missed properties will not be changed. + + +## License + +[MIT](https://github.com/markdown-it/linkify-it/blob/master/LICENSE) diff --git a/node_modules/linkify-it/index.js b/node_modules/linkify-it/index.js new file mode 100644 index 0000000..cc9b96d --- /dev/null +++ b/node_modules/linkify-it/index.js @@ -0,0 +1,664 @@ +'use strict'; + + +//////////////////////////////////////////////////////////////////////////////// +// Helpers + +// Merge objects +// +function assign(obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + + sources.forEach(function (source) { + if (!source) { return; } + + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + + return obj; +} + +function _class(obj) { return Object.prototype.toString.call(obj); } +function isString(obj) { return _class(obj) === '[object String]'; } +function isObject(obj) { return _class(obj) === '[object Object]'; } +function isRegExp(obj) { return _class(obj) === '[object RegExp]'; } +function isFunction(obj) { return _class(obj) === '[object Function]'; } + + +function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); } + +//////////////////////////////////////////////////////////////////////////////// + + +var defaultOptions = { + fuzzyLink: true, + fuzzyEmail: true, + fuzzyIP: false +}; + + +function isOptionsObj(obj) { + return Object.keys(obj || {}).reduce(function (acc, k) { + return acc || defaultOptions.hasOwnProperty(k); + }, false); +} + + +var defaultSchemas = { + 'http:': { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.http) { + // compile lazily, because "host"-containing variables can change on tlds update. + self.re.http = new RegExp( + '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i' + ); + } + if (self.re.http.test(tail)) { + return tail.match(self.re.http)[0].length; + } + return 0; + } + }, + 'https:': 'http:', + 'ftp:': 'http:', + '//': { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.no_http) { + // compile lazily, because "host"-containing variables can change on tlds update. + self.re.no_http = new RegExp( + '^' + + self.re.src_auth + + // Don't allow single-level domains, because of false positives like '//test' + // with code comments + '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + + self.re.src_port + + self.re.src_host_terminator + + self.re.src_path, + + 'i' + ); + } + + if (self.re.no_http.test(tail)) { + // should not be `://` & `///`, that protects from errors in protocol name + if (pos >= 3 && text[pos - 3] === ':') { return 0; } + if (pos >= 3 && text[pos - 3] === '/') { return 0; } + return tail.match(self.re.no_http)[0].length; + } + return 0; + } + }, + 'mailto:': { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.mailto) { + self.re.mailto = new RegExp( + '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i' + ); + } + if (self.re.mailto.test(tail)) { + return tail.match(self.re.mailto)[0].length; + } + return 0; + } + } +}; + +/*eslint-disable max-len*/ + +// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) +var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; + +// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead +var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); + +/*eslint-enable max-len*/ + +//////////////////////////////////////////////////////////////////////////////// + +function resetScanCache(self) { + self.__index__ = -1; + self.__text_cache__ = ''; +} + +function createValidator(re) { + return function (text, pos) { + var tail = text.slice(pos); + + if (re.test(tail)) { + return tail.match(re)[0].length; + } + return 0; + }; +} + +function createNormalizer() { + return function (match, self) { + self.normalize(match); + }; +} + +// Schemas compiler. Build regexps. +// +function compile(self) { + + // Load & clone RE patterns. + var re = self.re = require('./lib/re')(self.__opts__); + + // Define dynamic patterns + var tlds = self.__tlds__.slice(); + + self.onCompile(); + + if (!self.__tlds_replaced__) { + tlds.push(tlds_2ch_src_re); + } + tlds.push(re.src_xn); + + re.src_tlds = tlds.join('|'); + + function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); } + + re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); + re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); + re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); + re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); + + // + // Compile each schema + // + + var aliases = []; + + self.__compiled__ = {}; // Reset compiled data + + function schemaError(name, val) { + throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); + } + + Object.keys(self.__schemas__).forEach(function (name) { + var val = self.__schemas__[name]; + + // skip disabled methods + if (val === null) { return; } + + var compiled = { validate: null, link: null }; + + self.__compiled__[name] = compiled; + + if (isObject(val)) { + if (isRegExp(val.validate)) { + compiled.validate = createValidator(val.validate); + } else if (isFunction(val.validate)) { + compiled.validate = val.validate; + } else { + schemaError(name, val); + } + + if (isFunction(val.normalize)) { + compiled.normalize = val.normalize; + } else if (!val.normalize) { + compiled.normalize = createNormalizer(); + } else { + schemaError(name, val); + } + + return; + } + + if (isString(val)) { + aliases.push(name); + return; + } + + schemaError(name, val); + }); + + // + // Compile postponed aliases + // + + aliases.forEach(function (alias) { + if (!self.__compiled__[self.__schemas__[alias]]) { + // Silently fail on missed schemas to avoid errons on disable. + // schemaError(alias, self.__schemas__[alias]); + return; + } + + self.__compiled__[alias].validate = + self.__compiled__[self.__schemas__[alias]].validate; + self.__compiled__[alias].normalize = + self.__compiled__[self.__schemas__[alias]].normalize; + }); + + // + // Fake record for guessed links + // + self.__compiled__[''] = { validate: null, normalize: createNormalizer() }; + + // + // Build schema condition + // + var slist = Object.keys(self.__compiled__) + .filter(function (name) { + // Filter disabled & fake schemas + return name.length > 0 && self.__compiled__[name]; + }) + .map(escapeRE) + .join('|'); + // (?!_) cause 1.5x slowdown + self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); + self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); + self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i'); + + self.re.pretest = RegExp( + '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', + 'i' + ); + + // + // Cleanup + // + + resetScanCache(self); +} + +/** + * class Match + * + * Match result. Single element of array, returned by [[LinkifyIt#match]] + **/ +function Match(self, shift) { + var start = self.__index__, + end = self.__last_index__, + text = self.__text_cache__.slice(start, end); + + /** + * Match#schema -> String + * + * Prefix (protocol) for matched string. + **/ + this.schema = self.__schema__.toLowerCase(); + /** + * Match#index -> Number + * + * First position of matched string. + **/ + this.index = start + shift; + /** + * Match#lastIndex -> Number + * + * Next position after matched string. + **/ + this.lastIndex = end + shift; + /** + * Match#raw -> String + * + * Matched string. + **/ + this.raw = text; + /** + * Match#text -> String + * + * Notmalized text of matched string. + **/ + this.text = text; + /** + * Match#url -> String + * + * Normalized url of matched string. + **/ + this.url = text; +} + +function createMatch(self, shift) { + var match = new Match(self, shift); + + self.__compiled__[match.schema].normalize(match, self); + + return match; +} + + +/** + * class LinkifyIt + **/ + +/** + * new LinkifyIt(schemas, options) + * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) + * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } + * + * Creates new linkifier instance with optional additional schemas. + * Can be called without `new` keyword for convenience. + * + * By default understands: + * + * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links + * - "fuzzy" links and emails (example.com, foo@bar.com). + * + * `schemas` is an object, where each key/value describes protocol/rule: + * + * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` + * for example). `linkify-it` makes shure that prefix is not preceeded with + * alphanumeric char and symbols. Only whitespaces and punctuation allowed. + * - __value__ - rule to check tail after link prefix + * - _String_ - just alias to existing rule + * - _Object_ + * - _validate_ - validator function (should return matched length on success), + * or `RegExp`. + * - _normalize_ - optional function to normalize text & url of matched result + * (for example, for @twitter mentions). + * + * `options`: + * + * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. + * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts + * like version numbers. Default `false`. + * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. + * + **/ +function LinkifyIt(schemas, options) { + if (!(this instanceof LinkifyIt)) { + return new LinkifyIt(schemas, options); + } + + if (!options) { + if (isOptionsObj(schemas)) { + options = schemas; + schemas = {}; + } + } + + this.__opts__ = assign({}, defaultOptions, options); + + // Cache last tested result. Used to skip repeating steps on next `match` call. + this.__index__ = -1; + this.__last_index__ = -1; // Next scan position + this.__schema__ = ''; + this.__text_cache__ = ''; + + this.__schemas__ = assign({}, defaultSchemas, schemas); + this.__compiled__ = {}; + + this.__tlds__ = tlds_default; + this.__tlds_replaced__ = false; + + this.re = {}; + + compile(this); +} + + +/** chainable + * LinkifyIt#add(schema, definition) + * - schema (String): rule name (fixed pattern prefix) + * - definition (String|RegExp|Object): schema definition + * + * Add new rule definition. See constructor description for details. + **/ +LinkifyIt.prototype.add = function add(schema, definition) { + this.__schemas__[schema] = definition; + compile(this); + return this; +}; + + +/** chainable + * LinkifyIt#set(options) + * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } + * + * Set recognition options for links without schema. + **/ +LinkifyIt.prototype.set = function set(options) { + this.__opts__ = assign(this.__opts__, options); + return this; +}; + + +/** + * LinkifyIt#test(text) -> Boolean + * + * Searches linkifiable pattern and returns `true` on success or `false` on fail. + **/ +LinkifyIt.prototype.test = function test(text) { + // Reset scan cache + this.__text_cache__ = text; + this.__index__ = -1; + + if (!text.length) { return false; } + + var m, ml, me, len, shift, next, re, tld_pos, at_pos; + + // try to scan for link with schema - that's the most simple rule + if (this.re.schema_test.test(text)) { + re = this.re.schema_search; + re.lastIndex = 0; + while ((m = re.exec(text)) !== null) { + len = this.testSchemaAt(text, m[2], re.lastIndex); + if (len) { + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + break; + } + } + } + + if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { + // guess schemaless links + tld_pos = text.search(this.re.host_fuzzy_test); + if (tld_pos >= 0) { + // if tld is located after found link - no need to check fuzzy pattern + if (this.__index__ < 0 || tld_pos < this.__index__) { + if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { + + shift = ml.index + ml[1].length; + + if (this.__index__ < 0 || shift < this.__index__) { + this.__schema__ = ''; + this.__index__ = shift; + this.__last_index__ = ml.index + ml[0].length; + } + } + } + } + } + + if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { + // guess schemaless emails + at_pos = text.indexOf('@'); + if (at_pos >= 0) { + // We can't skip this check, because this cases are possible: + // 192.168.1.1@gmail.com, my.in@example.com + if ((me = text.match(this.re.email_fuzzy)) !== null) { + + shift = me.index + me[1].length; + next = me.index + me[0].length; + + if (this.__index__ < 0 || shift < this.__index__ || + (shift === this.__index__ && next > this.__last_index__)) { + this.__schema__ = 'mailto:'; + this.__index__ = shift; + this.__last_index__ = next; + } + } + } + } + + return this.__index__ >= 0; +}; + + +/** + * LinkifyIt#pretest(text) -> Boolean + * + * Very quick check, that can give false positives. Returns true if link MAY BE + * can exists. Can be used for speed optimization, when you need to check that + * link NOT exists. + **/ +LinkifyIt.prototype.pretest = function pretest(text) { + return this.re.pretest.test(text); +}; + + +/** + * LinkifyIt#testSchemaAt(text, name, position) -> Number + * - text (String): text to scan + * - name (String): rule (schema) name + * - position (Number): text offset to check from + * + * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly + * at given position. Returns length of found pattern (0 on fail). + **/ +LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { + // If not supported schema check requested - terminate + if (!this.__compiled__[schema.toLowerCase()]) { + return 0; + } + return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); +}; + + +/** + * LinkifyIt#match(text) -> Array|null + * + * Returns array of found link descriptions or `null` on fail. We strongly + * recommend to use [[LinkifyIt#test]] first, for best speed. + * + * ##### Result match description + * + * - __schema__ - link schema, can be empty for fuzzy links, or `//` for + * protocol-neutral links. + * - __index__ - offset of matched text + * - __lastIndex__ - index of next char after mathch end + * - __raw__ - matched text + * - __text__ - normalized text + * - __url__ - link, generated from matched text + **/ +LinkifyIt.prototype.match = function match(text) { + var shift = 0, result = []; + + // Try to take previous element from cache, if .test() called before + if (this.__index__ >= 0 && this.__text_cache__ === text) { + result.push(createMatch(this, shift)); + shift = this.__last_index__; + } + + // Cut head if cache was used + var tail = shift ? text.slice(shift) : text; + + // Scan string until end reached + while (this.test(tail)) { + result.push(createMatch(this, shift)); + + tail = tail.slice(this.__last_index__); + shift += this.__last_index__; + } + + if (result.length) { + return result; + } + + return null; +}; + + +/** + * LinkifyIt#matchAtStart(text) -> Match|null + * + * Returns fully-formed (not fuzzy) link if it starts at the beginning + * of the string, and null otherwise. + **/ +LinkifyIt.prototype.matchAtStart = function matchAtStart(text) { + // Reset scan cache + this.__text_cache__ = text; + this.__index__ = -1; + + if (!text.length) return null; + + var m = this.re.schema_at_start.exec(text); + if (!m) return null; + + var len = this.testSchemaAt(text, m[2], m[0].length); + if (!len) return null; + + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + + return createMatch(this, 0); +}; + + +/** chainable + * LinkifyIt#tlds(list [, keepOld]) -> this + * - list (Array): list of tlds + * - keepOld (Boolean): merge with current list if `true` (`false` by default) + * + * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) + * to avoid false positives. By default this algorythm used: + * + * - hostname with any 2-letter root zones are ok. + * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф + * are ok. + * - encoded (`xn--...`) root zones are ok. + * + * If list is replaced, then exact match for 2-chars root zones will be checked. + **/ +LinkifyIt.prototype.tlds = function tlds(list, keepOld) { + list = Array.isArray(list) ? list : [ list ]; + + if (!keepOld) { + this.__tlds__ = list.slice(); + this.__tlds_replaced__ = true; + compile(this); + return this; + } + + this.__tlds__ = this.__tlds__.concat(list) + .sort() + .filter(function (el, idx, arr) { + return el !== arr[idx - 1]; + }) + .reverse(); + + compile(this); + return this; +}; + +/** + * LinkifyIt#normalize(match) + * + * Default normalizer (if schema does not define it's own). + **/ +LinkifyIt.prototype.normalize = function normalize(match) { + + // Do minimal possible changes by default. Need to collect feedback prior + // to move forward https://github.com/markdown-it/linkify-it/issues/1 + + if (!match.schema) { match.url = 'http://' + match.url; } + + if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { + match.url = 'mailto:' + match.url; + } +}; + + +/** + * LinkifyIt#onCompile() + * + * Override to modify basic RegExp-s. + **/ +LinkifyIt.prototype.onCompile = function onCompile() { +}; + + +module.exports = LinkifyIt; diff --git a/node_modules/linkify-it/lib/re.js b/node_modules/linkify-it/lib/re.js new file mode 100644 index 0000000..35d88b6 --- /dev/null +++ b/node_modules/linkify-it/lib/re.js @@ -0,0 +1,183 @@ +'use strict'; + + +module.exports = function (opts) { + var re = {}; + opts = opts || {}; + + // Use direct extract instead of `regenerate` to reduse browserified size + re.src_Any = require('uc.micro/properties/Any/regex').source; + re.src_Cc = require('uc.micro/categories/Cc/regex').source; + re.src_Z = require('uc.micro/categories/Z/regex').source; + re.src_P = require('uc.micro/categories/P/regex').source; + + // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) + re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|'); + + // \p{\Z\Cc} (white spaces + control) + re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|'); + + // Experimental. List of chars, completely prohibited in links + // because can separate it from other part of text + var text_separators = '[><\uff5c]'; + + // All possible word characters (everything without punctuation, spaces & controls) + // Defined via punctuation & spaces to save space + // Should be something like \p{\L\N\S\M} (\w but without `_`) + re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; + // The same as abothe but without [0-9] + // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; + + //////////////////////////////////////////////////////////////////////////////// + + re.src_ip4 = + + '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; + + // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. + re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; + + re.src_port = + + '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; + + re.src_host_terminator = + + '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' + + '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; + + re.src_path = + + '(?:' + + '[/?#]' + + '(?:' + + '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + + '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + + '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + + '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + + '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + + "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + + "\\'(?=" + re.src_pseudo_letter + '|[-])|' + // allow `I'm_king` if no pair found + '\\.{2,}[a-zA-Z0-9%/&]|' + // google has many dots in "google search" links (#66, #81). + // github has ... in commit range links, + // Restrict to + // - english + // - percent-encoded + // - parts of file path + // - params separator + // until more examples found. + '\\.(?!' + re.src_ZCc + '|[.]|$)|' + + (opts['---'] ? + '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate + : + '\\-+|' + ) + + ',(?!' + re.src_ZCc + '|$)|' + // allow `,,,` in paths + ';(?!' + re.src_ZCc + '|$)|' + // allow `;` if not followed by space-like char + '\\!+(?!' + re.src_ZCc + '|[!]|$)|' + // allow `!!!` in paths, but not at the end + '\\?(?!' + re.src_ZCc + '|[?]|$)' + + ')+' + + '|\\/' + + ')?'; + + // Allow anything in markdown spec, forbid quote (") at the first position + // because emails enclosed in quotes are far more common + re.src_email_name = + + '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; + + re.src_xn = + + 'xn--[a-z0-9\\-]{1,59}'; + + // More to read about domain names + // http://serverfault.com/questions/638260/ + + re.src_domain_root = + + // Allow letters & digits (http://test1) + '(?:' + + re.src_xn + + '|' + + re.src_pseudo_letter + '{1,63}' + + ')'; + + re.src_domain = + + '(?:' + + re.src_xn + + '|' + + '(?:' + re.src_pseudo_letter + ')' + + '|' + + '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + + ')'; + + re.src_host = + + '(?:' + + // Don't need IP check, because digits are already allowed in normal domain names + // src_ip4 + + // '|' + + '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' + + ')'; + + re.tpl_host_fuzzy = + + '(?:' + + re.src_ip4 + + '|' + + '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + + ')'; + + re.tpl_host_no_ip_fuzzy = + + '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; + + re.src_host_strict = + + re.src_host + re.src_host_terminator; + + re.tpl_host_fuzzy_strict = + + re.tpl_host_fuzzy + re.src_host_terminator; + + re.src_host_port_strict = + + re.src_host + re.src_port + re.src_host_terminator; + + re.tpl_host_port_fuzzy_strict = + + re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; + + re.tpl_host_port_no_ip_fuzzy_strict = + + re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; + + + //////////////////////////////////////////////////////////////////////////////// + // Main rules + + // Rude test fuzzy links by host, for quick deny + re.tpl_host_fuzzy_test = + + 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; + + re.tpl_email_fuzzy = + + '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + + '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; + + re.tpl_link_fuzzy = + // Fuzzy link can't be prepended with .:/\- and non punctuation. + // but can start with > (markdown blockquote) + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; + + re.tpl_link_no_ip_fuzzy = + // Fuzzy link can't be prepended with .:/\- and non punctuation. + // but can start with > (markdown blockquote) + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; + + return re; +}; diff --git a/node_modules/linkify-it/package.json b/node_modules/linkify-it/package.json new file mode 100644 index 0000000..cf015b1 --- /dev/null +++ b/node_modules/linkify-it/package.json @@ -0,0 +1,47 @@ +{ + "name": "linkify-it", + "version": "4.0.1", + "description": "Links recognition library with FULL unicode support", + "keywords": [ + "linkify", + "linkifier", + "autolink", + "autolinker" + ], + "repository": "markdown-it/linkify-it", + "files": [ + "index.js", + "lib/" + ], + "license": "MIT", + "scripts": { + "lint": "eslint .", + "test": "npm run lint && nyc mocha", + "coverage": "npm run test && nyc report --reporter html", + "report-coveralls": "nyc --reporter=lcov mocha", + "demo": "npm run lint && node support/build_demo.js", + "doc": "node support/build_doc.js", + "gh-pages": "npm run demo && npm run doc && shx cp -R doc/ demo/ && gh-pages -d demo -f", + "prepublishOnly": "npm run gh-pages" + }, + "dependencies": { + "uc.micro": "^1.0.1" + }, + "devDependencies": { + "ansi": "^0.3.0", + "autoprefixer-stylus": "^1.0.0", + "benchmark": "^2.1.0", + "browserify": "^17.0.0", + "eslint": "^7.0.0", + "gh-pages": "^3.2.3", + "mdurl": "^1.0.0", + "mocha": "^9.1.2", + "ndoc": "^6.0.0", + "nyc": "^15.0.1", + "pug-cli": "^1.0.0-alpha6", + "shelljs": "^0.8.4", + "shx": "^0.3.2", + "stylus": "~0.55.0", + "tlds": "^1.166.0" + } +} diff --git a/node_modules/liquidjs/LICENSE b/node_modules/liquidjs/LICENSE new file mode 100644 index 0000000..62a9eeb --- /dev/null +++ b/node_modules/liquidjs/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Jun Yang + +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. diff --git a/node_modules/liquidjs/README.md b/node_modules/liquidjs/README.md new file mode 100644 index 0000000..64832cb --- /dev/null +++ b/node_modules/liquidjs/README.md @@ -0,0 +1,220 @@ +# liquidjs +[![npm version](https://img.shields.io/npm/v/liquidjs.svg?logo=npm&style=flat-square)](https://www.npmjs.org/package/liquidjs) +[![npm downloads](https://img.shields.io/npm/dm/liquidjs.svg?style=flat-square)](https://www.npmjs.org/package/liquidjs) +[![Coverage](https://img.shields.io/coveralls/harttle/liquidjs.svg?style=flat-square)](https://coveralls.io/github/harttle/liquidjs?branch=master) +[![Build Status](https://img.shields.io/github/actions/workflow/status/harttle/liquidjs/ci-build.yml?branch=master&style=flat-square)](https://github.com/harttle/liquidjs/actions/workflows/ci-build.yml?query=branch%3Amaster) +[![DUB license](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](https://github.com/harttle/liquidjs/blob/master/LICENSE) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/harttle/liquidjs) + +A simple, expressive and safe [Shopify][shopify/liquid] / GitHub Pages compatible template engine in pure JavaScript. +**The purpose of this repo** is to provide a standard Liquid implementation for the JavaScript community so that [Jekyll sites](https://jekyllrb.com), [GitHub Pages](https://pages.github.com/) and [Shopify templates](https://themes.shopify.com/) can be ported to Node.js without pain. + +* [Documentation][doc] +* Please star [LiquidJS on GitHub][github]! +* Financial support via [GitHub Sponsors](https://github.com/sponsors/harttle), or [LiquidJS on Open Collective][oc] + +

    logo

    + +## What's it like? + +Basically there're two types of Liquid syntax: tags enclosed by `{% %}` and outputs enclosed by `{{ }}`. A Liquid template looks like: + +```liquid +{% if username %} + {{ username | append: ", welcome to LiquidJS!" | capitalize }} +{% endif %} +``` + +[A live demo](https://liquidjs.com/playground.html) is also available and here's a [quick tutorial](https://liquidjs.com/tutorials/intro-to-liquid.html) for Liquid syntax. + + +## Installation + +Install from npm in Node.js: + +```bash +npm install liquidjs +``` + +Or use the UMD bundle from jsDelivr: + +```html + +``` + +Or render directly from CLI using npx: + +```bash +npx liquidjs --template 'Hello, {{ name }}!' --context '{"name": "Snake"}' +``` + +For more details, refer to the [Setup Guide][setup]. + +## Who's Using LiquidJS? + +- [Eleventy](https://www.11ty.dev/): Eleventy, a simpler static site generator. +- [Opensense](https://www.opensense.com/): The smarter way to send email. +- [Directus](https://docs.directus.io/): an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database. +- [Semgrep](https://github.com/returntocorp/semgrep): Lightweight static analysis for many languages. +- [Rock](https://www.rockrms.com/): An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one. +- [Mitosis](https://github.com/BuilderIO/mitosis): Write components once, run everywhere. Compiles to React, Vue, Qwik, Solid, Angular, Svelte, and more. +- [Pattern Lab](https://patternlab.io/): a frontend workshop environment that helps you build, view, test, and showcase your design system's UI components. +- [Builder.io](https://www.builder.io/m/developers): the first and only headless CMS with a visual editor that lets you drag and drop with your components, directly within your current site or app. Completely API-driven, for cleaner code and simpler workflows. +- [Microsoft Power Pages](https://learn.microsoft.com/en-us/power-pages/introduction): a secure, enterprise-grade, low-code software as a service (SaaS) platform for creating, hosting, and administering modern external-facing business websites. +- [Azure API Management developer portal](https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-developer-portal): an automatically generated, fully customizable website with the documentation of your APIs. + +Feel free to create a PR or contact me to add your use case into this list! + +## Financial Support + +If you personally love LiquidJS or it's benefiting your business, please consider financially support us: + +- via [GitHub Sponsors](https://github.com/sponsors/harttle), or +- via [LiquidJS on Open Collective][oc] + +Special thanks to the following sponsors! + + + + + + + + + + + + + + + + + + + + + +
    Opensense Inc.
    Opensense
    Eleventy
    Eleventy
    Peter deHaan
    Peter deHaan
    Touchless
    Touchless
    Adam Darrah
    Dropkiq
    Dailycontributors
    Dailycontributors
    coni2k
    Serkan Holat
    amit777
    amit777
    Khaled Salem
    Khaled Salem
    Sentry
    Sentry
    Checkout Blocks
    Checkout Blocks
    Customer IO
    Customer IO
    + + +## Contributors ✨ + +Want to contribute? see [Contribution Guidelines][contribution]. Thanks goes to these wonderful people: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Jun Yang
    Jun Yang

    🚧 💻
    chenos
    chenos

    💻
    Zach Leatherman
    Zach Leatherman

    🐛
    Tim Hardy
    Tim Hardy

    💻
    Paul Robert Lloyd
    Paul Robert Lloyd

    💻 🐛
    Alec Larson
    Alec Larson

    💻
    Patrick Malouin
    Patrick Malouin

    💻 📖
    jaswrks
    jaswrks

    💻
    三三
    三三

    💻 🤔
    ssendev
    ssendev

    💻 📖
    wojtask9
    wojtask9

    💻
    Andrew Barclay
    Andrew Barclay

    💻
    Cory Mawhorter
    Cory Mawhorter

    💻
    Mehdi Jaffery
    Mehdi Jaffery

    💻
    Robin Bijlani
    Robin Bijlani

    💻 🐛
    Ryan Kennedy
    Ryan Kennedy

    💻
    Sami Kukkonen
    Sami Kukkonen

    💻
    Scott Santucci
    Scott Santucci

    💻
    Steven
    Steven

    💡 💻
    azu
    azu

    📖
    Joonas
    Joonas

    💻
    Jamel A.
    Jamel A.

    💻
    Brandon Pittman
    Brandon Pittman

    💻
    tgrandgent
    tgrandgent

    💻
    Martin Schuster
    Martin Schuster

    💻
    Ray
    Ray

    ⚠️ 💻
    Cristofer Gonzales
    Cristofer Gonzales

    💻
    Raymond Camden
    Raymond Camden

    📖
    Steve Stedman
    Steve Stedman

    📖
    Anthony Ciccarello
    Anthony Ciccarello

    📖
    Bogdan Chadkin
    Bogdan Chadkin

    💻
    Tejas Manohar
    Tejas Manohar

    💻
    Peter deHaan
    Peter deHaan

    📖
    amit777
    amit777

    💻
    Steffen Schuldenzucker
    Steffen Schuldenzucker

    💻
    Pixcell
    Pixcell

    💻
    Jason Etcovitch
    Jason Etcovitch

    💻
    ZC
    ZC

    📖
    Memmie Lenglet
    Memmie Lenglet

    💻
    ilhamdev0
    ilhamdev0

    📖
    一饮一啄皆是人生
    一饮一啄皆是人生

    📖
    Amit Agarwal
    Amit Agarwal

    📖
    Laurin Quast
    Laurin Quast

    💻
    Matt Vague
    Matt Vague

    💻
    Liam Bigelow
    Liam Bigelow

    💻
    Jason Kurian
    Jason Kurian

    📖
    d pham (they/them)
    d pham (they/them)

    📖
    Aleksandr Hovhannisyan
    Aleksandr Hovhannisyan

    💻
    jg-rp
    jg-rp

    💻
    Ameya Apte
    Ameya Apte

    💻
    tbdrz
    tbdrz

    📖
    Santi Albo
    Santi Albo

    📖
    Yahang Wu
    Yahang Wu

    📖
    hongl
    hongl

    📖
    zxx-457
    zxx-457

    📖
    prassie
    prassie

    📖
    Slav Ivanov
    Slav Ivanov

    💻
    Daniel Rosenberg
    Daniel Rosenberg

    💻
    bobgubko
    bobgubko

    💻
    BaNgan
    BaNgan

    📖
    Mahyar Pasarzangene
    Mahyar Pasarzangene

    📖
    Tomáš Hübelbauer
    Tomáš Hübelbauer

    💻 📖
    Jason Garber
    Jason Garber

    💻
    Nick Reilingh
    Nick Reilingh

    📖
    Francisco Soto
    Francisco Soto

    💻
    David LJ
    David LJ

    📖
    Rasmus Wriedt Larsen
    Rasmus Wriedt Larsen

    📖
    Bruno Carvalho
    Bruno Carvalho

    💻
    傅鹏
    傅鹏

    💻
    Joel Hamilton
    Joel Hamilton

    💻
    Max Medve
    Max Medve

    💻
    Cosmin Popovici
    Cosmin Popovici

    📖
    Adam Tanner
    Adam Tanner

    💻
    Guillermo Casal Caro
    Guillermo Casal Caro

    💻
    Josh Soref
    Josh Soref

    📖
    + + + + + + +[shopify/liquid]: https://shopify.github.io/liquid/ +[plugins]: https://liquidjs.com/tutorials/plugins.html#Plugin-List +[setup]: https://liquidjs.com/tutorials/setup.html +[doc]: https://liquidjs.com +[github]: https://github.com/harttle/liquidjs +[oc]: https://opencollective.com/liquidjs/ +[contribution]: https://liquidjs.com/tutorials/contribution-guidelines.html diff --git a/node_modules/liquidjs/bin/liquid.js b/node_modules/liquidjs/bin/liquid.js new file mode 100755 index 0000000..9d54b86 --- /dev/null +++ b/node_modules/liquidjs/bin/liquid.js @@ -0,0 +1,139 @@ +#!/usr/bin/env node + +const fs = require('fs/promises') +const Liquid = require('..').Liquid + +// Preserve compatibility by falling back to legacy CLI behavior if: +// - stdin is redirected (i.e. not connected to a terminal) AND +// - there are either no arguments, or only a single argument which does not start with a dash +// TODO: Remove this fallback for 11.0 + +let renderPromise = null +if (!process.stdin.isTTY && (process.argv.length === 2 || (process.argv.length === 3 && !process.argv[2].startsWith('-')))) { + renderPromise = renderLegacy() +} else { + renderPromise = render() +} + +renderPromise.catch(err => { + process.stderr.write(`${err.message}\n`) + process.exitCode = 1 +}) + +async function render () { + const { program } = require('commander') + + program + .name('liquidjs') + .description('Render a Liquid template') + .requiredOption('-t, --template ', 'liquid template to render (@- to read from stdin)') // TODO: Change to argument in 11.0 + .option('-c, --context ', 'input context in JSON format (@- to read from stdin)') + .option('-o, --output ', 'write rendered output to file (omit to write to stdout)') + .option('--cache [size]', 'cache previously parsed template structures (default cache size: 1024)') + .option('--extname ', 'use a default filename extension when resolving partials and layouts') + .option('--jekyll-include', 'use jekyll-style include (pass parameters to include variable of current scope)') + .option('--js-truthy', 'use JavaScript-style truthiness') + .option('--layouts ', 'directories from where to resolve layouts (defaults to --root)') + .option('--lenient-if', 'do not throw on undefined variables in conditional expressions (when using --strict-variables)') + .option('--no-dynamic-partials', 'always treat file paths for partials and layouts as a literal value') + .option('--no-greedy', 'disable greedy matching for --trim* options') + .option('--no-relative-reference', 'require absolute file paths for partials and layouts') + .option('--ordered-filter-parameters', 'respect parameter order when using filters') + .option('--output-delimiter-left ', 'left delimiter to use for liquid outputs') + .option('--output-delimiter-right ', 'right delimiter to use for liquid outputs') + .option('--partials ', 'directories from where to resolve partials (defaults to --root)') + .option('--preserve-timezones', 'preserve input timezone in date filter') + .option('--root ', 'directories from where to resolve partials and layouts (defaults to ".")') + .option('--strict-filters', 'throw on undefined filters instead of skipping them') + .option('--strict-variables', 'throw on undefined variables instead of rendering them as empty string') + .option('--tag-delimiter-left', 'left delimiter to use for liquid tags') + .option('--tag-delimiter-right', 'right delimiter to use for liquid tags') + .option('--timezone-offset ', 'JavaScript timezone name or timezoneOffset value to use in date filter (defaults to local timezone)') + .option('--trim-output-left', 'trim whitespace from left of liquid outputs') + .option('--trim-output-right', 'trim whitespace from right of liquid outputs') + .option('--trim-tag-left', 'trim whitespace from left of liquid tags') + .option('--trim-tag-right', 'trim whitespace from right of liquid tags') + .showHelpAfterError('Use -h or --help for additional information.') + .parse() + + const options = program.opts() + + if (Object.values(options).filter((value) => value === '@-').length > 1) { + throw new Error(`The stdin input specifier '@-' must only be used once.`) + } + + const template = await resolveInputOption(options.template) + const context = await resolveContext(options.context) + const liquid = new Liquid(options) + const output = liquid.parseAndRenderSync(template, context) + if (options.output) { + await fs.writeFile(options.output, output) + } else { + process.stdout.write(output) + } +} + +async function resolveContext (contextOption) { + let contextJson = '{}' + if (contextOption) { + contextJson = await resolveInputOption(contextOption) + } + const context = JSON.parse(contextJson) + return context +} + +async function resolveInputOption (option) { + let content = null + if (option) { + if (option === '@-') { + content = await readStream(process.stdin) + } else if (option.startsWith('@')) { + const filePath = option.slice(1) + const stat = await fs.stat(filePath, { throwIfNoEntry: false }) + if (!stat || !stat.isFile) { + throw new Error(`'${filePath}' does not exist or is not a file`) + } + content = await fs.readFile(filePath, 'utf8') + } else { + content = option + } + } + return content +} + +async function readStream (stream) { + const chunks = [] + for await (const chunk of stream) { + chunks.push(chunk) + } + return Buffer.concat(chunks).toString('utf8') +} + +// TODO: Remove for 11.0 +async function renderLegacy () { + process.stderr.write('Reading template from stdin. This mode will be removed in next major version, use --template option instead.\n') + const contextArg = process.argv.slice(2)[0] + let context = {} + if (contextArg) { + const contextJson = await resolveInputOptionLegacy(contextArg) + context = JSON.parse(contextJson) + } + const template = await readStream(process.stdin) + const liquid = new Liquid() + const output = liquid.parseAndRenderSync(template, context) + process.stdout.write(output) +} + +// TODO: Remove for 11.0 +async function resolveInputOptionLegacy (option) { + let content = null + if (option) { + const stat = await fs.stat(option).catch(e => null) + if (stat && stat.isFile) { + content = await fs.readFile(option, 'utf8') + } else { + content = option + } + } + return content +} diff --git a/node_modules/liquidjs/dist/build/fs-impl-browser.d.ts b/node_modules/liquidjs/dist/build/fs-impl-browser.d.ts new file mode 100644 index 0000000..094df8d --- /dev/null +++ b/node_modules/liquidjs/dist/build/fs-impl-browser.d.ts @@ -0,0 +1,7 @@ +export declare function resolve(root: string, filepath: string, ext: string): string; +export declare function readFile(url: string): Promise; +export declare function readFileSync(url: string): string; +export declare function exists(filepath: string): Promise; +export declare function existsSync(filepath: string): boolean; +export declare function dirname(filepath: string): string; +export declare const sep = "/"; diff --git a/node_modules/liquidjs/dist/build/fs-impl-browser.spec.d.ts b/node_modules/liquidjs/dist/build/fs-impl-browser.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/build/fs-impl-browser.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/build/streamed-emitter-browser.d.ts b/node_modules/liquidjs/dist/build/streamed-emitter-browser.d.ts new file mode 100644 index 0000000..19883ca --- /dev/null +++ b/node_modules/liquidjs/dist/build/streamed-emitter-browser.d.ts @@ -0,0 +1,10 @@ +/// +import { Emitter } from '../emitters'; +export declare class StreamedEmitter implements Emitter { + buffer: string; + stream: NodeJS.ReadableStream; + constructor(); + write: (html: any) => void; + error: (err: Error) => void; + end: () => void; +} diff --git a/node_modules/liquidjs/dist/build/streamed-emitter-browser.spec.d.ts b/node_modules/liquidjs/dist/build/streamed-emitter-browser.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/build/streamed-emitter-browser.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/cache/cache.d.ts b/node_modules/liquidjs/dist/cache/cache.d.ts new file mode 100644 index 0000000..57debad --- /dev/null +++ b/node_modules/liquidjs/dist/cache/cache.d.ts @@ -0,0 +1,7 @@ +import type { Template } from '../template/template'; +export interface Cache { + write(key: string, value: T): void | Promise; + read(key: string): T | undefined | Promise; + remove(key: string): void | Promise; +} +export type LiquidCache = Cache>; diff --git a/node_modules/liquidjs/dist/cache/index.d.ts b/node_modules/liquidjs/dist/cache/index.d.ts new file mode 100644 index 0000000..66fd9cb --- /dev/null +++ b/node_modules/liquidjs/dist/cache/index.d.ts @@ -0,0 +1,2 @@ +export * from './cache'; +export * from './lru'; diff --git a/node_modules/liquidjs/dist/cache/lru.d.ts b/node_modules/liquidjs/dist/cache/lru.d.ts new file mode 100644 index 0000000..9532ed1 --- /dev/null +++ b/node_modules/liquidjs/dist/cache/lru.d.ts @@ -0,0 +1,14 @@ +import { Cache } from './cache'; +export declare class LRU implements Cache { + limit: number; + size: number; + private cache; + private head; + private tail; + constructor(limit: number, size?: number); + write(key: string, value: T): void; + read(key: string): T | undefined; + remove(key: string): void; + clear(): void; + private ensureLimit; +} diff --git a/node_modules/liquidjs/dist/cache/lru.spec.d.ts b/node_modules/liquidjs/dist/cache/lru.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/cache/lru.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/context/block-mode.d.ts b/node_modules/liquidjs/dist/context/block-mode.d.ts new file mode 100644 index 0000000..428746e --- /dev/null +++ b/node_modules/liquidjs/dist/context/block-mode.d.ts @@ -0,0 +1,4 @@ +export declare enum BlockMode { + OUTPUT = 0, + STORE = 1 +} diff --git a/node_modules/liquidjs/dist/context/context.d.ts b/node_modules/liquidjs/dist/context/context.d.ts new file mode 100644 index 0000000..848f7a2 --- /dev/null +++ b/node_modules/liquidjs/dist/context/context.d.ts @@ -0,0 +1,55 @@ +import { NormalizedFullOptions, RenderOptions } from '../liquid-options'; +import { Scope } from './scope'; +type PropertyKey = string | number; +export declare class Context { + /** + * insert a Context-level empty scope, + * for tags like `{% capture %}` `{% assign %}` to operate + */ + private scopes; + private registers; + /** + * user passed in scope + * `{% increment %}`, `{% decrement %}` changes this scope, + * whereas `{% capture %}`, `{% assign %}` only hide this scope + */ + environments: Scope; + /** + * global scope used as fallback for missing variables + */ + globals: Scope; + sync: boolean; + /** + * The normalized liquid options object + */ + opts: NormalizedFullOptions; + /** + * Throw when accessing undefined variable? + */ + strictVariables: boolean; + ownPropertyOnly: boolean; + constructor(env?: object, opts?: NormalizedFullOptions, renderOptions?: RenderOptions); + getRegister(key: string): any; + setRegister(key: string, value: any): any; + saveRegister(...keys: string[]): [string, any][]; + restoreRegister(keyValues: [string, any][]): void; + getAll(): Scope; + /** + * @deprecated use `_get()` or `getSync()` instead + */ + get(paths: PropertyKey[]): unknown; + getSync(paths: PropertyKey[]): unknown; + _get(paths: PropertyKey[]): IterableIterator; + /** + * @deprecated use `_get()` instead + */ + getFromScope(scope: unknown, paths: PropertyKey[] | string): IterableIterator; + _getFromScope(scope: unknown, paths: PropertyKey[] | string, strictVariables?: boolean): IterableIterator; + push(ctx: object): number; + pop(): Scope | undefined; + bottom(): Scope; + private findScope; +} +export declare function readProperty(obj: Scope, key: PropertyKey, ownPropertyOnly: boolean): any; +export declare function readJSProperty(obj: Scope, key: PropertyKey, ownPropertyOnly: boolean): any; +export {}; diff --git a/node_modules/liquidjs/dist/context/context.spec.d.ts b/node_modules/liquidjs/dist/context/context.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/context/context.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/context/index.d.ts b/node_modules/liquidjs/dist/context/index.d.ts new file mode 100644 index 0000000..2a8b56f --- /dev/null +++ b/node_modules/liquidjs/dist/context/index.d.ts @@ -0,0 +1,3 @@ +export * from './context'; +export * from './scope'; +export * from './block-mode'; diff --git a/node_modules/liquidjs/dist/context/scope.d.ts b/node_modules/liquidjs/dist/context/scope.d.ts new file mode 100644 index 0000000..4257c6b --- /dev/null +++ b/node_modules/liquidjs/dist/context/scope.d.ts @@ -0,0 +1,6 @@ +import { Drop } from '../drop/drop'; +interface ScopeObject extends Record { + toLiquid?: () => any; +} +export type Scope = ScopeObject | Drop; +export {}; diff --git a/node_modules/liquidjs/dist/drop/blank-drop.d.ts b/node_modules/liquidjs/dist/drop/blank-drop.d.ts new file mode 100644 index 0000000..378d0a9 --- /dev/null +++ b/node_modules/liquidjs/dist/drop/blank-drop.d.ts @@ -0,0 +1,4 @@ +import { EmptyDrop } from '../drop'; +export declare class BlankDrop extends EmptyDrop { + equals(value: any): boolean; +} diff --git a/node_modules/liquidjs/dist/drop/block-drop.d.ts b/node_modules/liquidjs/dist/drop/block-drop.d.ts new file mode 100644 index 0000000..d46eb6f --- /dev/null +++ b/node_modules/liquidjs/dist/drop/block-drop.d.ts @@ -0,0 +1,10 @@ +import { Drop } from './drop'; +export declare class BlockDrop extends Drop { + private superBlockRender; + constructor(superBlockRender?: () => Iterable); + /** + * Provide parent access in child block by + * {{ block.super }} + */ + super(): Iterable; +} diff --git a/node_modules/liquidjs/dist/drop/comparable.d.ts b/node_modules/liquidjs/dist/drop/comparable.d.ts new file mode 100644 index 0000000..fc0e1e0 --- /dev/null +++ b/node_modules/liquidjs/dist/drop/comparable.d.ts @@ -0,0 +1,8 @@ +export interface Comparable { + equals: (rhs: any) => boolean; + gt: (rhs: any) => boolean; + geq: (rhs: any) => boolean; + lt: (rhs: any) => boolean; + leq: (rhs: any) => boolean; +} +export declare function isComparable(arg: any): arg is Comparable; diff --git a/node_modules/liquidjs/dist/drop/drop.d.ts b/node_modules/liquidjs/dist/drop/drop.d.ts new file mode 100644 index 0000000..b011eb9 --- /dev/null +++ b/node_modules/liquidjs/dist/drop/drop.d.ts @@ -0,0 +1,3 @@ +export declare abstract class Drop { + liquidMethodMissing(key: string | number): Promise | any; +} diff --git a/node_modules/liquidjs/dist/drop/empty-drop.d.ts b/node_modules/liquidjs/dist/drop/empty-drop.d.ts new file mode 100644 index 0000000..08e8622 --- /dev/null +++ b/node_modules/liquidjs/dist/drop/empty-drop.d.ts @@ -0,0 +1,10 @@ +import { Drop } from './drop'; +import { Comparable } from './comparable'; +export declare class EmptyDrop extends Drop implements Comparable { + equals(value: any): boolean; + gt(): boolean; + geq(): boolean; + lt(): boolean; + leq(): boolean; + valueOf(): string; +} diff --git a/node_modules/liquidjs/dist/drop/forloop-drop.d.ts b/node_modules/liquidjs/dist/drop/forloop-drop.d.ts new file mode 100644 index 0000000..517c014 --- /dev/null +++ b/node_modules/liquidjs/dist/drop/forloop-drop.d.ts @@ -0,0 +1,15 @@ +import { Drop } from './drop'; +export declare class ForloopDrop extends Drop { + protected i: number; + name: string; + length: number; + constructor(length: number, collection: string, variable: string); + next(): void; + index0(): number; + index(): number; + first(): boolean; + last(): boolean; + rindex(): number; + rindex0(): number; + valueOf(): string; +} diff --git a/node_modules/liquidjs/dist/drop/index.d.ts b/node_modules/liquidjs/dist/drop/index.d.ts new file mode 100644 index 0000000..411b24d --- /dev/null +++ b/node_modules/liquidjs/dist/drop/index.d.ts @@ -0,0 +1,7 @@ +export * from './drop'; +export * from './null-drop'; +export * from './empty-drop'; +export * from './blank-drop'; +export * from './forloop-drop'; +export * from './block-drop'; +export * from './comparable'; diff --git a/node_modules/liquidjs/dist/drop/null-drop.d.ts b/node_modules/liquidjs/dist/drop/null-drop.d.ts new file mode 100644 index 0000000..e4af427 --- /dev/null +++ b/node_modules/liquidjs/dist/drop/null-drop.d.ts @@ -0,0 +1,10 @@ +import { Drop } from './drop'; +import { Comparable } from './comparable'; +export declare class NullDrop extends Drop implements Comparable { + equals(value: any): boolean; + gt(): boolean; + geq(): boolean; + lt(): boolean; + leq(): boolean; + valueOf(): null; +} diff --git a/node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts b/node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts new file mode 100644 index 0000000..e04c807 --- /dev/null +++ b/node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts @@ -0,0 +1,10 @@ +import { ForloopDrop } from './forloop-drop'; +export declare class TablerowloopDrop extends ForloopDrop { + private cols; + constructor(length: number, cols: number, collection: string, variable: string); + row(): number; + col0(): number; + col(): number; + col_first(): boolean; + col_last(): boolean; +} diff --git a/node_modules/liquidjs/dist/emitters/emitter.d.ts b/node_modules/liquidjs/dist/emitters/emitter.d.ts new file mode 100644 index 0000000..6f6fd00 --- /dev/null +++ b/node_modules/liquidjs/dist/emitters/emitter.d.ts @@ -0,0 +1,11 @@ +export interface Emitter { + /** + * Write a html value into emitter + * @param html string, Drop or other primitive value + */ + write(html: any): void; + /** + * Buffered string + */ + buffer: string; +} diff --git a/node_modules/liquidjs/dist/emitters/index.d.ts b/node_modules/liquidjs/dist/emitters/index.d.ts new file mode 100644 index 0000000..37a5506 --- /dev/null +++ b/node_modules/liquidjs/dist/emitters/index.d.ts @@ -0,0 +1,4 @@ +export * from './emitter'; +export * from './simple-emitter'; +export * from '../build/streamed-emitter-browser'; +export * from './keeping-type-emitter'; diff --git a/node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts b/node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts new file mode 100644 index 0000000..86ced10 --- /dev/null +++ b/node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts @@ -0,0 +1,5 @@ +import { Emitter } from './emitter'; +export declare class KeepingTypeEmitter implements Emitter { + buffer: any; + write(html: any): void; +} diff --git a/node_modules/liquidjs/dist/emitters/simple-emitter.d.ts b/node_modules/liquidjs/dist/emitters/simple-emitter.d.ts new file mode 100644 index 0000000..c1c0788 --- /dev/null +++ b/node_modules/liquidjs/dist/emitters/simple-emitter.d.ts @@ -0,0 +1,5 @@ +import { Emitter } from './emitter'; +export declare class SimpleEmitter implements Emitter { + buffer: string; + write(html: any): void; +} diff --git a/node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts b/node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts new file mode 100644 index 0000000..31ab2ce --- /dev/null +++ b/node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts @@ -0,0 +1,9 @@ +/// +import { Emitter } from './emitter'; +export declare class StreamedEmitter implements Emitter { + buffer: string; + stream: NodeJS.ReadWriteStream; + write(html: any): void; + error(err: Error): void; + end(): void; +} diff --git a/node_modules/liquidjs/dist/filters/array.d.ts b/node_modules/liquidjs/dist/filters/array.d.ts new file mode 100644 index 0000000..86ada53 --- /dev/null +++ b/node_modules/liquidjs/dist/filters/array.d.ts @@ -0,0 +1,26 @@ +import { FilterImpl } from '../template'; +import { Scope } from '../context'; +export declare const join: (v: any[], arg: string) => any; +export declare const last: (v: any) => any; +export declare const first: (v: any) => any; +export declare const reverse: (v: any[]) => any; +export declare function sort(this: FilterImpl, arr: T[], property?: string): IterableIterator; +export declare function sort_natural(input: T[], property?: string): any[]; +export declare const size: (v: string | any[]) => number; +export declare function map(this: FilterImpl, arr: Scope[], property: string): IterableIterator; +export declare function sum(this: FilterImpl, arr: Scope[], property?: string): IterableIterator; +export declare function compact(this: FilterImpl, arr: T[]): any[]; +export declare function concat(v: T1[], arg?: T2[]): (T1 | T2)[]; +export declare function push(v: T[], arg: T): T[]; +export declare function unshift(v: T[], arg: T): T[]; +export declare function pop(v: T[]): T[]; +export declare function shift(v: T[]): T[]; +export declare function slice(v: T[] | string, begin: number, length?: number): T[] | string; +export declare function where(this: FilterImpl, arr: T[], property: string, expected?: any): IterableIterator; +export declare function where_exp(this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator; +export declare function group_by(arr: T[], property: string): IterableIterator; +export declare function group_by_exp(this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator; +export declare function find(this: FilterImpl, arr: T[], property: string, expected: string): IterableIterator; +export declare function find_exp(this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator; +export declare function uniq(arr: T[]): T[]; +export declare function sample(v: T[] | string, count?: number): T | string | (T | string)[]; diff --git a/node_modules/liquidjs/dist/filters/date.d.ts b/node_modules/liquidjs/dist/filters/date.d.ts new file mode 100644 index 0000000..56357a7 --- /dev/null +++ b/node_modules/liquidjs/dist/filters/date.d.ts @@ -0,0 +1,6 @@ +import { FilterImpl } from '../template'; +export declare function date(this: FilterImpl, v: string | Date, format?: string, timezoneOffset?: number | string): string | Date; +export declare function date_to_xmlschema(this: FilterImpl, v: string | Date): string | Date; +export declare function date_to_rfc822(this: FilterImpl, v: string | Date): string | Date; +export declare function date_to_string(this: FilterImpl, v: string | Date, type?: string, style?: string): string | Date; +export declare function date_to_long_string(this: FilterImpl, v: string | Date, type?: string, style?: string): string | Date; diff --git a/node_modules/liquidjs/dist/filters/html.d.ts b/node_modules/liquidjs/dist/filters/html.d.ts new file mode 100644 index 0000000..1ec657c --- /dev/null +++ b/node_modules/liquidjs/dist/filters/html.d.ts @@ -0,0 +1,5 @@ +export declare function escape(str: string): string; +export declare function xml_escape(str: string): string; +export declare function escape_once(str: string): string; +export declare function newline_to_br(v: string): string; +export declare function strip_html(v: string): string; diff --git a/node_modules/liquidjs/dist/filters/index.d.ts b/node_modules/liquidjs/dist/filters/index.d.ts new file mode 100644 index 0000000..95cf6a2 --- /dev/null +++ b/node_modules/liquidjs/dist/filters/index.d.ts @@ -0,0 +1,2 @@ +import { FilterImplOptions } from '../template'; +export declare const filters: Record; diff --git a/node_modules/liquidjs/dist/filters/math.d.ts b/node_modules/liquidjs/dist/filters/math.d.ts new file mode 100644 index 0000000..a2dcbf9 --- /dev/null +++ b/node_modules/liquidjs/dist/filters/math.d.ts @@ -0,0 +1,11 @@ +export declare const abs: (x: number) => any; +export declare const at_least: (...args: number[]) => any; +export declare const at_most: (...args: number[]) => any; +export declare const ceil: (x: number) => any; +export declare const divided_by: (dividend: number, divisor: number, integerArithmetic?: any) => any; +export declare const floor: (x: number) => any; +export declare const minus: (v: number, arg: number) => any; +export declare const modulo: (v: number, arg: number) => any; +export declare const times: (v: number, arg: number) => any; +export declare function round(v: number, arg?: number): number; +export declare function plus(v: number, arg: number): number; diff --git a/node_modules/liquidjs/dist/filters/misc.d.ts b/node_modules/liquidjs/dist/filters/misc.d.ts new file mode 100644 index 0000000..237dc21 --- /dev/null +++ b/node_modules/liquidjs/dist/filters/misc.d.ts @@ -0,0 +1,18 @@ +import { identify } from '../util/underscore'; +import { FilterImpl } from '../template'; +declare function defaultFilter(this: FilterImpl, value: T1, defaultValue: T2, ...args: Array<[string, any]>): T1 | T2; +declare function json(value: any, space?: number): string; +declare function inspect(value: any, space?: number): string; +declare function to_integer(value: any): number; +declare const _default: { + default: typeof defaultFilter; + raw: { + raw: boolean; + handler: typeof identify; + }; + jsonify: typeof json; + to_integer: typeof to_integer; + json: typeof json; + inspect: typeof inspect; +}; +export default _default; diff --git a/node_modules/liquidjs/dist/filters/string.d.ts b/node_modules/liquidjs/dist/filters/string.d.ts new file mode 100644 index 0000000..b1e89f9 --- /dev/null +++ b/node_modules/liquidjs/dist/filters/string.d.ts @@ -0,0 +1,26 @@ +/** + * String related filters + * + * * prefer stringify() to String() since `undefined`, `null` should eval '' + */ +export declare function append(v: string, arg: string): string; +export declare function prepend(v: string, arg: string): string; +export declare function lstrip(v: string, chars?: string): string; +export declare function downcase(v: string): string; +export declare function upcase(str: string): string; +export declare function remove(v: string, arg: string): string; +export declare function remove_first(v: string, l: string): string; +export declare function remove_last(v: string, l: string): string; +export declare function rstrip(str: string, chars?: string): string; +export declare function split(v: string, arg: string): string[]; +export declare function strip(v: string, chars?: string): string; +export declare function strip_newlines(v: string): string; +export declare function capitalize(str: string): string; +export declare function replace(v: string, pattern: string, replacement: string): string; +export declare function replace_first(v: string, arg1: string, arg2: string): string; +export declare function replace_last(v: string, arg1: string, arg2: string): string; +export declare function truncate(v: string, l?: number, o?: string): string; +export declare function truncatewords(v: string, words?: number, o?: string): string; +export declare function normalize_whitespace(v: string): string; +export declare function number_of_words(input: string, mode?: 'cjk' | 'auto'): number; +export declare function array_to_sentence_string(array: unknown[], connector?: string): unknown; diff --git a/node_modules/liquidjs/dist/filters/url.d.ts b/node_modules/liquidjs/dist/filters/url.d.ts new file mode 100644 index 0000000..da45394 --- /dev/null +++ b/node_modules/liquidjs/dist/filters/url.d.ts @@ -0,0 +1,14 @@ +export declare const url_decode: (x: string) => string; +export declare const url_encode: (x: string) => string; +export declare const cgi_escape: (x: string) => string; +export declare const uri_escape: (x: string) => string; +declare const rSlugifyReplacers: { + raw: RegExp; + default: RegExp; + pretty: RegExp; + ascii: RegExp; + latin: RegExp; + none: null; +}; +export declare function slugify(str: string, mode?: keyof typeof rSlugifyReplacers, cased?: boolean): string; +export {}; diff --git a/node_modules/liquidjs/dist/fs/fs-impl.d.ts b/node_modules/liquidjs/dist/fs/fs-impl.d.ts new file mode 100644 index 0000000..0d82dad --- /dev/null +++ b/node_modules/liquidjs/dist/fs/fs-impl.d.ts @@ -0,0 +1,9 @@ +export declare function exists(filepath: string): Promise; +export declare function readFile(filepath: string): Promise; +export declare function existsSync(filepath: string): boolean; +export declare function readFileSync(filepath: string): string; +export declare function resolve(root: string, file: string, ext: string): string; +export declare function fallback(file: string): string | undefined; +export declare function dirname(filepath: string): string; +export declare function contains(root: string, file: string): boolean; +export { sep } from 'path'; diff --git a/node_modules/liquidjs/dist/fs/fs-impl.spec.d.ts b/node_modules/liquidjs/dist/fs/fs-impl.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/fs/fs-impl.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/fs/fs.d.ts b/node_modules/liquidjs/dist/fs/fs.d.ts new file mode 100644 index 0000000..86cf1e1 --- /dev/null +++ b/node_modules/liquidjs/dist/fs/fs.d.ts @@ -0,0 +1,20 @@ +export interface FS { + /** check if a file exists asynchronously */ + exists: (filepath: string) => Promise; + /** check if a file exists synchronously */ + existsSync: (filepath: string) => boolean; + /** read a file asynchronously */ + readFile: (filepath: string) => Promise; + /** read a file synchronously */ + readFileSync: (filepath: string) => string; + /** resolve a file against directory, for given `ext` option */ + resolve: (dir: string, file: string, ext: string) => string; + /** check if file is contained in `root`, always return `true` by default. Warning: not setting this could expose path traversal vulnerabilities. */ + contains?: (root: string, file: string) => boolean; + /** defaults to "/" */ + sep?: string; + /** required for relative path resolving */ + dirname?: (file: string) => string; + /** fallback file for lookup failure */ + fallback?: (file: string) => string | undefined; +} diff --git a/node_modules/liquidjs/dist/fs/index.d.ts b/node_modules/liquidjs/dist/fs/index.d.ts new file mode 100644 index 0000000..b40725f --- /dev/null +++ b/node_modules/liquidjs/dist/fs/index.d.ts @@ -0,0 +1,2 @@ +export * from './loader'; +export * from './fs'; diff --git a/node_modules/liquidjs/dist/fs/loader.d.ts b/node_modules/liquidjs/dist/fs/loader.d.ts new file mode 100644 index 0000000..6d590b7 --- /dev/null +++ b/node_modules/liquidjs/dist/fs/loader.d.ts @@ -0,0 +1,24 @@ +import { FS } from './fs'; +export interface LoaderOptions { + fs: FS; + extname: string; + root: string[]; + partials: string[]; + layouts: string[]; + relativeReference: boolean; +} +export declare enum LookupType { + Partials = "partials", + Layouts = "layouts", + Root = "root" +} +export declare class Loader { + shouldLoadRelative: (referencedFile: string) => boolean; + private options; + private contains; + constructor(options: LoaderOptions); + lookup(file: string, type: LookupType, sync?: boolean, currentFile?: string): Generator; + candidates(file: string, dirs: string[], currentFile?: string, enforceRoot?: boolean): Generator; + private dirname; + private lookupError; +} diff --git a/node_modules/liquidjs/dist/fs/loader.spec.d.ts b/node_modules/liquidjs/dist/fs/loader.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/fs/loader.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/fs/node-require.d.ts b/node_modules/liquidjs/dist/fs/node-require.d.ts new file mode 100644 index 0000000..76b9399 --- /dev/null +++ b/node_modules/liquidjs/dist/fs/node-require.d.ts @@ -0,0 +1,2 @@ +/// +export declare const requireResolve: NodeJS.RequireResolve; diff --git a/node_modules/liquidjs/dist/index.d.ts b/node_modules/liquidjs/dist/index.d.ts new file mode 100644 index 0000000..b3e7705 --- /dev/null +++ b/node_modules/liquidjs/dist/index.d.ts @@ -0,0 +1,15 @@ +export declare const version = "[VI]{version}[/VI]"; +export * as TypeGuards from './util/type-guards'; +export { toValue, TimezoneDate, createTrie, Trie, toPromise, toValueSync, assert, LiquidError, ParseError, RenderError, UndefinedVariableError, TokenizationError, AssertionError } from './util'; +export { Drop } from './drop'; +export { Emitter } from './emitters'; +export { defaultOperators, Operators, evalToken, evalQuotedToken, Expression, isFalsy, isTruthy } from './render'; +export { Context, Scope } from './context'; +export { Value, Hash, Template, FilterImplOptions, Tag, Filter, Output } from './template'; +export { Token, TopLevelToken, TagToken, ValueToken } from './tokens'; +export { TokenKind, Tokenizer, ParseStream } from './parser'; +export { filters } from './filters'; +export * from './tags'; +export { defaultOptions, LiquidOptions } from './liquid-options'; +export { FS } from './fs'; +export { Liquid } from './liquid'; diff --git a/node_modules/liquidjs/dist/liquid-options.d.ts b/node_modules/liquidjs/dist/liquid-options.d.ts new file mode 100644 index 0000000..92e6db3 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid-options.d.ts @@ -0,0 +1,133 @@ +import { LiquidCache } from './cache'; +import { FS, LookupType } from './fs'; +import { Operators } from './render'; +type OutputEscape = (value: any) => string; +type OutputEscapeOption = 'escape' | 'json' | OutputEscape; +export interface LiquidOptions { + /** A directory or an array of directories from where to resolve layout and include templates, and the filename passed to `.renderFile()`. If it's an array, the files are looked up in the order they occur in the array. Defaults to `["."]` */ + root?: string | string[]; + /** A directory or an array of directories from where to resolve included templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */ + partials?: string | string[]; + /** A directory or an array of directories from where to resolve layout templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */ + layouts?: string | string[]; + /** Allow refer to layouts/partials by relative pathname. To avoid arbitrary filesystem read, paths been referenced also need to be within corresponding root, partials, layouts. Defaults to `true`. */ + relativeReference?: boolean; + /** Use jekyll style include, pass parameters to `include` variable of current scope. Defaults to `false`. */ + jekyllInclude?: boolean; + /** Add a extname (if filepath doesn't include one) before template file lookup. Eg: setting to `".html"` will allow including file by basename. Defaults to `""`. */ + extname?: string; + /** Whether or not to cache resolved templates. Defaults to `false`. */ + cache?: boolean | number | LiquidCache; + /** Use JavaScript Truthiness. Defaults to `false`. */ + jsTruthy?: boolean; + /** If set, treat the `filepath` parameter in `{%include filepath %}` and `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`. */ + dynamicPartials?: boolean; + /** Whether or not to assert filter existence. If set to `false`, undefined filters will be skipped. Otherwise, undefined filters will cause an exception. Defaults to `false`. */ + strictFilters?: boolean; + /** Whether or not to assert variable existence. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */ + strictVariables?: boolean; + /** Catch all errors instead of exit upon one. Please note that render errors won't be reached when parse fails. */ + catchAllErrors?: boolean; + /** Hide scope variables from prototypes, useful when you're passing a not sanitized object into LiquidJS or need to hide prototypes from templates. */ + ownPropertyOnly?: boolean; + /** Modifies the behavior of `strictVariables`. If set, a single undefined variable will *not* cause an exception in the context of the `if`/`elsif`/`unless` tag and the `default` filter. Instead, it will evaluate to `false` and `null`, respectively. Irrelevant if `strictVariables` is not set. Defaults to `false`. **/ + lenientIf?: boolean; + /** JavaScript timezone name or timezoneOffset for `date` filter, default to local time. That means if you're in Australia (UTC+10), it'll default to `-600` or `Australia/Lindeman` */ + timezoneOffset?: number | string; + /** Default date format to use if the date filter doesn't include a format. Defaults to `%A, %B %-e, %Y at %-l:%M %P %z`. */ + dateFormat?: string; + /** Strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`. */ + trimTagRight?: boolean; + /** Similar to `trimTagRight`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */ + trimTagLeft?: boolean; + /** Strip blank characters (including ` `, `\t`, and `\r`) from the right of values (`{{ }}`) until `\n` (inclusive). Defaults to `false`. */ + trimOutputRight?: boolean; + /** Similar to `trimOutputRight`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */ + trimOutputLeft?: boolean; + /** The left delimiter for liquid tags. **/ + tagDelimiterLeft?: string; + /** The right delimiter for liquid tags. **/ + tagDelimiterRight?: string; + /** The left delimiter for liquid outputs. **/ + outputDelimiterLeft?: string; + /** The right delimiter for liquid outputs. **/ + outputDelimiterRight?: string; + /** Whether input strings to date filter preserve the given timezone **/ + preserveTimezones?: boolean; + /** Whether `trim*Left`/`trim*Right` is greedy. When set to `true`, all consecutive blank characters including `\n` will be trimmed regardless of line breaks. Defaults to `true`. */ + greedy?: boolean; + /** `fs` is used to override the default file-system module with a custom implementation. */ + fs?: FS; + /** the global scope passed down to all partial and layout templates, i.e. templates included by `include`, `layout` and `render` tags. */ + globals?: object; + /** Whether or not to keep value type when writing the Output, not working for streamed rendering. Defaults to `false`. */ + keepOutputType?: boolean; + /** Default escape filter applied to output values, when set, you'll have to add `| raw` for values don't need to be escaped. Defaults to `undefined`. */ + outputEscape?: OutputEscapeOption; + /** An object of operators for conditional statements. Defaults to the regular Liquid operators. */ + operators?: Operators; + /** Respect parameter order when using filters like "for ... reversed limit", Defaults to `false`. */ + orderedFilterParameters?: boolean; +} +export interface RenderOptions { + /** + * This call is sync or async? It's used by Liquid internal methods, you'll not need this. + */ + sync?: boolean; + /** + * Same as `globals` on LiquidOptions, but only for current render() call + */ + globals?: object; + /** + * Same as `strictVariables` on LiquidOptions, but only for current render() call + */ + strictVariables?: boolean; + /** + * Same as `ownPropertyOnly` on LiquidOptions, but only for current render() call + */ + ownPropertyOnly?: boolean; +} +export interface RenderFileOptions extends RenderOptions { + lookupType?: LookupType; +} +interface NormalizedOptions extends LiquidOptions { + root?: string[]; + partials?: string[]; + layouts?: string[]; + cache?: LiquidCache; + outputEscape?: OutputEscape; +} +export interface NormalizedFullOptions extends NormalizedOptions { + root: string[]; + partials: string[]; + layouts: string[]; + relativeReference: boolean; + jekyllInclude: boolean; + extname: string; + cache?: LiquidCache; + jsTruthy: boolean; + dynamicPartials: boolean; + fs: FS; + strictFilters: boolean; + strictVariables: boolean; + ownPropertyOnly: boolean; + lenientIf: boolean; + dateFormat: string; + trimTagRight: boolean; + trimTagLeft: boolean; + trimOutputRight: boolean; + trimOutputLeft: boolean; + tagDelimiterLeft: string; + tagDelimiterRight: string; + outputDelimiterLeft: string; + outputDelimiterRight: string; + preserveTimezones: boolean; + greedy: boolean; + globals: object; + keepOutputType: boolean; + operators: Operators; +} +export declare const defaultOptions: NormalizedFullOptions; +export declare function normalize(options: LiquidOptions): NormalizedFullOptions; +export declare function normalizeDirectoryList(value: any): string[]; +export {}; diff --git a/node_modules/liquidjs/dist/liquid-options.spec.d.ts b/node_modules/liquidjs/dist/liquid-options.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid-options.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/liquid.browser.esm.js b/node_modules/liquidjs/dist/liquid.browser.esm.js new file mode 100644 index 0000000..bc0f5c6 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid.browser.esm.js @@ -0,0 +1,4037 @@ +/* + * liquidjs@10.14.0, https://github.com/harttle/liquidjs + * (c) 2016-2024 harttle + * Released under the MIT License. + */ +class Token { + constructor(kind, input, begin, end, file) { + this.kind = kind; + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + } + getText() { + return this.input.slice(this.begin, this.end); + } + getPosition() { + let [row, col] = [1, 1]; + for (let i = 0; i < this.begin; i++) { + if (this.input[i] === '\n') { + row++; + col = 1; + } + else + col++; + } + return [row, col]; + } + size() { + return this.end - this.begin; + } +} + +class Drop { + liquidMethodMissing(key) { + return undefined; + } +} + +const toString$1 = Object.prototype.toString; +const toLowerCase = String.prototype.toLowerCase; +const hasOwnProperty = Object.hasOwnProperty; +function isString(value) { + return typeof value === 'string'; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function isFunction(value) { + return typeof value === 'function'; +} +function isPromise(val) { + return val && isFunction(val.then); +} +function isIterator(val) { + return val && isFunction(val.next) && isFunction(val.throw) && isFunction(val.return); +} +function escapeRegex(str) { + return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); +} +function stringify(value) { + value = toValue(value); + if (isString(value)) + return value; + if (isNil(value)) + return ''; + if (isArray(value)) + return value.map(x => stringify(x)).join(''); + return String(value); +} +function toEnumerable(val) { + val = toValue(val); + if (isArray(val)) + return val; + if (isString(val) && val.length > 0) + return [val]; + if (isIterable(val)) + return Array.from(val); + if (isObject(val)) + return Object.keys(val).map((key) => [key, val[key]]); + return []; +} +function toArray(val) { + val = toValue(val); + if (isNil(val)) + return []; + if (isArray(val)) + return val; + return [val]; +} +function toValue(value) { + return (value instanceof Drop && isFunction(value.valueOf)) ? value.valueOf() : value; +} +function isNumber(value) { + return typeof value === 'number'; +} +function toLiquid(value) { + if (value && isFunction(value.toLiquid)) + return toLiquid(value.toLiquid()); + return value; +} +function isNil(value) { + return value == null; +} +function isUndefined(value) { + return value === undefined; +} +function isArray(value) { + // be compatible with IE 8 + return toString$1.call(value) === '[object Array]'; +} +function isIterable(value) { + return isObject(value) && Symbol.iterator in value; +} +/* + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * The iteratee is invoked with three arguments: (value, key, object). + * Iteratee functions may exit iteration early by explicitly returning false. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @return {Object} Returns object. + */ +function forOwn(obj, iteratee) { + obj = obj || {}; + for (const k in obj) { + if (hasOwnProperty.call(obj, k)) { + if (iteratee(obj[k], k, obj) === false) + break; + } + } + return obj; +} +function last(arr) { + return arr[arr.length - 1]; +} +/* + * Checks if value is the language type of Object. + * (e.g. arrays, functions, objects, regexes, new Number(0), and new String('')) + * @param {any} value The value to check. + * @return {Boolean} Returns true if value is an object, else false. + */ +function isObject(value) { + const type = typeof value; + return value !== null && (type === 'object' || type === 'function'); +} +function range(start, stop, step = 1) { + const arr = []; + for (let i = start; i < stop; i += step) { + arr.push(i); + } + return arr; +} +function padStart(str, length, ch = ' ') { + return pad(str, length, ch, (str, ch) => ch + str); +} +function padEnd(str, length, ch = ' ') { + return pad(str, length, ch, (str, ch) => str + ch); +} +function pad(str, length, ch, add) { + str = String(str); + let n = length - str.length; + while (n-- > 0) + str = add(str, ch); + return str; +} +function identify(val) { + return val; +} +function changeCase(str) { + const hasLowerCase = [...str].some(ch => ch >= 'a' && ch <= 'z'); + return hasLowerCase ? str.toUpperCase() : str.toLowerCase(); +} +function ellipsis(str, N) { + return str.length > N ? str.slice(0, N - 3) + '...' : str; +} +// compare string in case-insensitive way, undefined values to the tail +function caseInsensitiveCompare(a, b) { + if (a == null && b == null) + return 0; + if (a == null) + return 1; + if (b == null) + return -1; + a = toLowerCase.call(a); + b = toLowerCase.call(b); + if (a < b) + return -1; + if (a > b) + return 1; + return 0; +} +function argumentsToValue(fn) { + return (...args) => fn(...args.map(toValue)); +} +function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +} + +/** + * targeting ES5, extends Error won't create a proper prototype chain, need a trait to keep track of classes + */ +const TRAIT = '__liquidClass__'; +class LiquidError extends Error { + constructor(err, token) { + /** + * note: for ES5 targeting, `this` will be replaced by return value of Error(), + * thus everything on `this` will be lost, avoid calling `LiquidError` methods here + */ + super(typeof err === 'string' ? err : err.message); + this.context = ''; + if (typeof err !== 'string') + Object.defineProperty(this, 'originalError', { value: err, enumerable: false }); + Object.defineProperty(this, 'token', { value: token, enumerable: false }); + Object.defineProperty(this, TRAIT, { value: 'LiquidError', enumerable: false }); + } + update() { + Object.defineProperty(this, 'context', { value: mkContext(this.token), enumerable: false }); + this.message = mkMessage(this.message, this.token); + this.stack = this.message + '\n' + this.context + + '\n' + this.stack; + if (this.originalError) + this.stack += '\nFrom ' + this.originalError.stack; + } + static is(obj) { + return (obj === null || obj === void 0 ? void 0 : obj[TRAIT]) === 'LiquidError'; + } +} +class TokenizationError extends LiquidError { + constructor(message, token) { + super(message, token); + this.name = 'TokenizationError'; + super.update(); + } +} +class ParseError extends LiquidError { + constructor(err, token) { + super(err, token); + this.name = 'ParseError'; + this.message = err.message; + super.update(); + } +} +class RenderError extends LiquidError { + constructor(err, tpl) { + super(err, tpl.token); + this.name = 'RenderError'; + this.message = err.message; + super.update(); + } + static is(obj) { + return obj.name === 'RenderError'; + } +} +class LiquidErrors extends LiquidError { + constructor(errors) { + super(errors[0], errors[0].token); + this.errors = errors; + this.name = 'LiquidErrors'; + const s = errors.length > 1 ? 's' : ''; + this.message = `${errors.length} error${s} found`; + super.update(); + } + static is(obj) { + return obj.name === 'LiquidErrors'; + } +} +class UndefinedVariableError extends LiquidError { + constructor(err, token) { + super(err, token); + this.name = 'UndefinedVariableError'; + this.message = err.message; + super.update(); + } +} +// only used internally; raised where we don't have token information, +// so it can't be an UndefinedVariableError. +class InternalUndefinedVariableError extends Error { + constructor(variableName) { + super(`undefined variable: ${variableName}`); + this.name = 'InternalUndefinedVariableError'; + this.variableName = variableName; + } +} +class AssertionError extends Error { + constructor(message) { + super(message); + this.name = 'AssertionError'; + this.message = message + ''; + } +} +function mkContext(token) { + const [line, col] = token.getPosition(); + const lines = token.input.split('\n'); + const begin = Math.max(line - 2, 1); + const end = Math.min(line + 3, lines.length); + const context = range(begin, end + 1) + .map(lineNumber => { + const rowIndicator = (lineNumber === line) ? '>> ' : ' '; + const num = padStart(String(lineNumber), String(end).length); + let text = `${rowIndicator}${num}| `; + const colIndicator = lineNumber === line + ? '\n' + padStart('^', col + text.length) + : ''; + text += lines[lineNumber - 1]; + text += colIndicator; + return text; + }) + .join('\n'); + return context; +} +function mkMessage(msg, token) { + if (token.file) + msg += `, file:${token.file}`; + const [line, col] = token.getPosition(); + msg += `, line:${line}, col:${col}`; + return msg; +} + +// **DO NOT CHANGE THIS FILE** +// +// This file is generated by bin/character-gen.js +// bitmask character types to boost performance +const TYPES = [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 4, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 8, 0, 0, 0, 0, 8, 0, 0, 0, 64, 0, 65, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]; +const WORD = 1; +const BLANK = 4; +const QUOTE = 8; +const INLINE_BLANK = 16; +const NUMBER = 32; +const SIGN = 64; +const PUNCTUATION = 128; +function isWord(char) { + const code = char.charCodeAt(0); + return code >= 128 ? !TYPES[code] : !!(TYPES[code] & WORD); +} +TYPES[160] = TYPES[5760] = TYPES[6158] = TYPES[8192] = TYPES[8193] = TYPES[8194] = TYPES[8195] = TYPES[8196] = TYPES[8197] = TYPES[8198] = TYPES[8199] = TYPES[8200] = TYPES[8201] = TYPES[8202] = TYPES[8232] = TYPES[8233] = TYPES[8239] = TYPES[8287] = TYPES[12288] = BLANK; +TYPES[8220] = TYPES[8221] = PUNCTUATION; + +function assert(predicate, message) { + if (!predicate) { + const msg = typeof message === 'function' + ? message() + : (message || `expect ${predicate} to be true`); + throw new AssertionError(msg); + } +} + +class NullDrop extends Drop { + equals(value) { + return isNil(toValue(value)); + } + gt() { + return false; + } + geq() { + return false; + } + lt() { + return false; + } + leq() { + return false; + } + valueOf() { + return null; + } +} + +class EmptyDrop extends Drop { + equals(value) { + if (value instanceof EmptyDrop) + return false; + value = toValue(value); + if (isString(value) || isArray(value)) + return value.length === 0; + if (isObject(value)) + return Object.keys(value).length === 0; + return false; + } + gt() { + return false; + } + geq() { + return false; + } + lt() { + return false; + } + leq() { + return false; + } + valueOf() { + return ''; + } +} + +class BlankDrop extends EmptyDrop { + equals(value) { + if (value === false) + return true; + if (isNil(toValue(value))) + return true; + if (isString(value)) + return /^\s*$/.test(value); + return super.equals(value); + } +} + +class ForloopDrop extends Drop { + constructor(length, collection, variable) { + super(); + this.i = 0; + this.length = length; + this.name = `${variable}-${collection}`; + } + next() { + this.i++; + } + index0() { + return this.i; + } + index() { + return this.i + 1; + } + first() { + return this.i === 0; + } + last() { + return this.i === this.length - 1; + } + rindex() { + return this.length - this.i; + } + rindex0() { + return this.length - this.i - 1; + } + valueOf() { + return JSON.stringify(this); + } +} + +class BlockDrop extends Drop { + constructor( + // the block render from layout template + superBlockRender = () => '') { + super(); + this.superBlockRender = superBlockRender; + } + /** + * Provide parent access in child block by + * {{ block.super }} + */ + super() { + return this.superBlockRender(); + } +} + +function isComparable(arg) { + return (arg && + isFunction(arg.equals) && + isFunction(arg.gt) && + isFunction(arg.geq) && + isFunction(arg.lt) && + isFunction(arg.leq)); +} + +const nil = new NullDrop(); +const literalValues = { + 'true': true, + 'false': false, + 'nil': nil, + 'null': nil, + 'empty': new EmptyDrop(), + 'blank': new BlankDrop() +}; + +function createTrie(input) { + const trie = {}; + for (const [name, data] of Object.entries(input)) { + let node = trie; + for (let i = 0; i < name.length; i++) { + const c = name[i]; + node[c] = node[c] || {}; + if (i === name.length - 1 && isWord(name[i])) { + node[c].needBoundary = true; + } + node = node[c]; + } + node.data = data; + node.end = true; + } + return trie; +} + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +// convert an async iterator to a Promise +function toPromise(val) { + return __awaiter(this, void 0, void 0, function* () { + if (!isIterator(val)) + return val; + let value; + let done = false; + let next = 'next'; + do { + const state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + try { + if (isIterator(value)) + value = toPromise(value); + if (isPromise(value)) + value = yield value; + } + catch (err) { + next = 'throw'; + value = err; + } + } while (!done); + return value; + }); +} +// convert an async iterator to a value in a synchronous manner +function toValueSync(val) { + if (!isIterator(val)) + return val; + let value; + let done = false; + let next = 'next'; + do { + const state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + if (isIterator(value)) { + try { + value = toValueSync(value); + } + catch (err) { + next = 'throw'; + value = err; + } + } + } while (!done); + return value; +} + +const rFormat = /%([-_0^#:]+)?(\d+)?([EO])?(.)/; +const monthNames = [ + 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', + 'September', 'October', 'November', 'December' +]; +const dayNames = [ + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' +]; +const monthNamesShort = monthNames.map(abbr); +const dayNamesShort = dayNames.map(abbr); +function abbr(str) { + return str.slice(0, 3); +} +// prototype extensions +function daysInMonth(d) { + const feb = isLeapYear(d) ? 29 : 28; + return [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +} +function getDayOfYear(d) { + let num = 0; + for (let i = 0; i < d.getMonth(); ++i) { + num += daysInMonth(d)[i]; + } + return num + d.getDate(); +} +function getWeekOfYear(d, startDay) { + // Skip to startDay of this week + const now = getDayOfYear(d) + (startDay - d.getDay()); + // Find the first startDay of the year + const jan1 = new Date(d.getFullYear(), 0, 1); + const then = (7 - jan1.getDay() + startDay); + return String(Math.floor((now - then) / 7) + 1); +} +function isLeapYear(d) { + const year = d.getFullYear(); + return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year))); +} +function ordinal(d) { + const date = d.getDate(); + if ([11, 12, 13].includes(date)) + return 'th'; + switch (date % 10) { + case 1: return 'st'; + case 2: return 'nd'; + case 3: return 'rd'; + default: return 'th'; + } +} +function century(d) { + return parseInt(d.getFullYear().toString().substring(0, 2), 10); +} +// default to 0 +const padWidths = { + d: 2, + e: 2, + H: 2, + I: 2, + j: 3, + k: 2, + l: 2, + L: 3, + m: 2, + M: 2, + S: 2, + U: 2, + W: 2 +}; +// default to '0' +const padChars = { + a: ' ', + A: ' ', + b: ' ', + B: ' ', + c: ' ', + e: ' ', + k: ' ', + l: ' ', + p: ' ', + P: ' ' +}; +function getTimezoneOffset(d, opts) { + const nOffset = Math.abs(d.getTimezoneOffset()); + const h = Math.floor(nOffset / 60); + const m = nOffset % 60; + return (d.getTimezoneOffset() > 0 ? '-' : '+') + + padStart(h, 2, '0') + + (opts.flags[':'] ? ':' : '') + + padStart(m, 2, '0'); +} +const formatCodes = { + a: (d) => dayNamesShort[d.getDay()], + A: (d) => dayNames[d.getDay()], + b: (d) => monthNamesShort[d.getMonth()], + B: (d) => monthNames[d.getMonth()], + c: (d) => d.toLocaleString(), + C: (d) => century(d), + d: (d) => d.getDate(), + e: (d) => d.getDate(), + H: (d) => d.getHours(), + I: (d) => String(d.getHours() % 12 || 12), + j: (d) => getDayOfYear(d), + k: (d) => d.getHours(), + l: (d) => String(d.getHours() % 12 || 12), + L: (d) => d.getMilliseconds(), + m: (d) => d.getMonth() + 1, + M: (d) => d.getMinutes(), + N: (d, opts) => { + const width = Number(opts.width) || 9; + const str = String(d.getMilliseconds()).slice(0, width); + return padEnd(str, width, '0'); + }, + p: (d) => (d.getHours() < 12 ? 'AM' : 'PM'), + P: (d) => (d.getHours() < 12 ? 'am' : 'pm'), + q: (d) => ordinal(d), + s: (d) => Math.round(d.getTime() / 1000), + S: (d) => d.getSeconds(), + u: (d) => d.getDay() || 7, + U: (d) => getWeekOfYear(d, 0), + w: (d) => d.getDay(), + W: (d) => getWeekOfYear(d, 1), + x: (d) => d.toLocaleDateString(), + X: (d) => d.toLocaleTimeString(), + y: (d) => d.getFullYear().toString().slice(2, 4), + Y: (d) => d.getFullYear(), + z: getTimezoneOffset, + Z: (d, opts) => { + if (d.getTimezoneName) { + return d.getTimezoneName() || getTimezoneOffset(d, opts); + } + return (typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : ''); + }, + 't': () => '\t', + 'n': () => '\n', + '%': () => '%' +}; +formatCodes.h = formatCodes.b; +function strftime(d, formatStr) { + let output = ''; + let remaining = formatStr; + let match; + while ((match = rFormat.exec(remaining))) { + output += remaining.slice(0, match.index); + remaining = remaining.slice(match.index + match[0].length); + output += format(d, match); + } + return output + remaining; +} +function format(d, match) { + const [input, flagStr = '', width, modifier, conversion] = match; + const convert = formatCodes[conversion]; + if (!convert) + return input; + const flags = {}; + for (const flag of flagStr) + flags[flag] = true; + let ret = String(convert(d, { flags, width, modifier })); + let padChar = padChars[conversion] || '0'; + let padWidth = width || padWidths[conversion] || 0; + if (flags['^']) + ret = ret.toUpperCase(); + else if (flags['#']) + ret = changeCase(ret); + if (flags['_']) + padChar = ' '; + else if (flags['0']) + padChar = '0'; + if (flags['-']) + padWidth = 0; + return padStart(ret, padWidth, padChar); +} + +// one minute in milliseconds +const OneMinute = 60000; +const ISO8601_TIMEZONE_PATTERN = /([zZ]|([+-])(\d{2}):(\d{2}))$/; +/** + * A date implementation with timezone info, just like Ruby date + * + * Implementation: + * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods + * - rewrite getTimezoneOffset() to trick strftime + */ +class TimezoneDate { + constructor(init, timezone) { + this.date = init instanceof TimezoneDate + ? init.date + : new Date(init); + this.timezoneOffset = isString(timezone) ? TimezoneDate.getTimezoneOffset(timezone, this.date) : timezone; + this.timezoneName = isString(timezone) ? timezone : ''; + const diff = (this.date.getTimezoneOffset() - this.timezoneOffset) * OneMinute; + const time = this.date.getTime() + diff; + this.displayDate = new Date(time); + } + getTime() { + return this.displayDate.getTime(); + } + getMilliseconds() { + return this.displayDate.getMilliseconds(); + } + getSeconds() { + return this.displayDate.getSeconds(); + } + getMinutes() { + return this.displayDate.getMinutes(); + } + getHours() { + return this.displayDate.getHours(); + } + getDay() { + return this.displayDate.getDay(); + } + getDate() { + return this.displayDate.getDate(); + } + getMonth() { + return this.displayDate.getMonth(); + } + getFullYear() { + return this.displayDate.getFullYear(); + } + toLocaleString(locale, init) { + if (init === null || init === void 0 ? void 0 : init.timeZone) { + return this.date.toLocaleString(locale, init); + } + return this.displayDate.toLocaleString(locale, init); + } + toLocaleTimeString(locale) { + return this.displayDate.toLocaleTimeString(locale); + } + toLocaleDateString(locale) { + return this.displayDate.toLocaleDateString(locale); + } + getTimezoneOffset() { + return this.timezoneOffset; + } + getTimezoneName() { + return this.timezoneName; + } + /** + * Create a Date object fixed to it's declared Timezone. Both + * - 2021-08-06T02:29:00.000Z and + * - 2021-08-06T02:29:00.000+08:00 + * will always be displayed as + * - 2021-08-06 02:29:00 + * regardless timezoneOffset in JavaScript realm + * + * The implementation hack: + * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`, + * we create a different Date to trick strftime, it's both simpler and more performant. + * Given that a template is expected to be parsed fewer times than rendered. + */ + static createDateFixedToTimezone(dateString) { + const m = dateString.match(ISO8601_TIMEZONE_PATTERN); + // representing a UTC timestamp + if (m && m[1] === 'Z') { + return new TimezoneDate(+new Date(dateString), 0); + } + // has a timezone specified + if (m && m[2] && m[3] && m[4]) { + const [, , sign, hours, minutes] = m; + const offset = (sign === '+' ? -1 : 1) * (parseInt(hours, 10) * 60 + parseInt(minutes, 10)); + return new TimezoneDate(+new Date(dateString), offset); + } + return new Date(dateString); + } + static getTimezoneOffset(timezoneName, date = new Date()) { + const localDateString = date.toLocaleString('en-US', { timeZone: timezoneName }); + const utcDateString = date.toLocaleString('en-US', { timeZone: 'UTC' }); + const localDate = new Date(localDateString); + const utcDate = new Date(utcDateString); + return (+utcDate - +localDate) / (60 * 1000); + } +} + +class DelimitedToken extends Token { + constructor(kind, [contentBegin, contentEnd], input, begin, end, trimLeft, trimRight, file) { + super(kind, input, begin, end, file); + this.trimLeft = false; + this.trimRight = false; + const tl = input[contentBegin] === '-'; + const tr = input[contentEnd - 1] === '-'; + let l = tl ? contentBegin + 1 : contentBegin; + let r = tr ? contentEnd - 1 : contentEnd; + while (l < r && (TYPES[input.charCodeAt(l)] & BLANK)) + l++; + while (r > l && (TYPES[input.charCodeAt(r - 1)] & BLANK)) + r--; + this.contentRange = [l, r]; + this.trimLeft = tl || trimLeft; + this.trimRight = tr || trimRight; + } + get content() { + return this.input.slice(this.contentRange[0], this.contentRange[1]); + } +} + +class TagToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + const { trimTagLeft, trimTagRight, tagDelimiterLeft, tagDelimiterRight } = options; + const [valueBegin, valueEnd] = [begin + tagDelimiterLeft.length, end - tagDelimiterRight.length]; + super(TokenKind.Tag, [valueBegin, valueEnd], input, begin, end, trimTagLeft, trimTagRight, file); + this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange); + this.name = this.tokenizer.readTagName(); + this.tokenizer.assert(this.name, `illegal tag syntax, tag name expected`); + this.tokenizer.skipBlank(); + } + get args() { + return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]); + } +} + +class OutputToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + const { trimOutputLeft, trimOutputRight, outputDelimiterLeft, outputDelimiterRight } = options; + const valueRange = [begin + outputDelimiterLeft.length, end - outputDelimiterRight.length]; + super(TokenKind.Output, valueRange, input, begin, end, trimOutputLeft, trimOutputRight, file); + } +} + +class HTMLToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.HTML, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.trimLeft = 0; + this.trimRight = 0; + } + getContent() { + return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight); + } +} + +class NumberToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Number, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = Number(this.getText()); + } +} + +class IdentifierToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Word, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = this.getText(); + } + isNumber(allowSign = false) { + const begin = allowSign && TYPES[this.input.charCodeAt(this.begin)] & SIGN + ? this.begin + 1 + : this.begin; + for (let i = begin; i < this.end; i++) { + if (!(TYPES[this.input.charCodeAt(i)] & NUMBER)) + return false; + } + return true; + } +} + +class LiteralToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Literal, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.literal = this.getText(); + this.content = literalValues[this.literal]; + } +} + +const operatorPrecedences = { + '==': 2, + '!=': 2, + '>': 2, + '<': 2, + '>=': 2, + '<=': 2, + 'contains': 2, + 'not': 1, + 'and': 0, + 'or': 0 +}; +const operatorTypes = { + '==': 0 /* OperatorType.Binary */, + '!=': 0 /* OperatorType.Binary */, + '>': 0 /* OperatorType.Binary */, + '<': 0 /* OperatorType.Binary */, + '>=': 0 /* OperatorType.Binary */, + '<=': 0 /* OperatorType.Binary */, + 'contains': 0 /* OperatorType.Binary */, + 'not': 1 /* OperatorType.Unary */, + 'and': 0 /* OperatorType.Binary */, + 'or': 0 /* OperatorType.Binary */ +}; +class OperatorToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Operator, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.operator = this.getText(); + } + getPrecedence() { + const key = this.getText(); + return key in operatorPrecedences ? operatorPrecedences[key] : 1; + } +} + +class PropertyAccessToken extends Token { + constructor(variable, props, input, begin, end, file) { + super(TokenKind.PropertyAccess, input, begin, end, file); + this.variable = variable; + this.props = props; + } +} + +class FilterToken extends Token { + constructor(name, args, input, begin, end, file) { + super(TokenKind.Filter, input, begin, end, file); + this.name = name; + this.args = args; + } +} + +class HashToken extends Token { + constructor(input, begin, end, name, value, file) { + super(TokenKind.Hash, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.name = name; + this.value = value; + this.file = file; + } +} + +const rHex = /[\da-fA-F]/; +const rOct = /[0-7]/; +const escapeChar = { + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t', + v: '\x0B' +}; +function hexVal(c) { + const code = c.charCodeAt(0); + if (code >= 97) + return code - 87; + if (code >= 65) + return code - 55; + return code - 48; +} +function parseStringLiteral(str) { + let ret = ''; + for (let i = 1; i < str.length - 1; i++) { + if (str[i] !== '\\') { + ret += str[i]; + continue; + } + if (escapeChar[str[i + 1]] !== undefined) { + ret += escapeChar[str[++i]]; + } + else if (str[i + 1] === 'u') { + let val = 0; + let j = i + 2; + while (j <= i + 5 && rHex.test(str[j])) { + val = val * 16 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + else if (!rOct.test(str[i + 1])) { + ret += str[++i]; + } + else { + let j = i + 1; + let val = 0; + while (j <= i + 3 && rOct.test(str[j])) { + val = val * 8 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + } + return ret; +} + +class QuotedToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Quoted, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = parseStringLiteral(this.getText()); + } +} + +class RangeToken extends Token { + constructor(input, begin, end, lhs, rhs, file) { + super(TokenKind.Range, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.lhs = lhs; + this.rhs = rhs; + this.file = file; + } +} + +/** + * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}` + */ +class LiquidTagToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + super(TokenKind.Tag, [begin, end], input, begin, end, false, false, file); + this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange); + this.name = this.tokenizer.readTagName(); + this.tokenizer.assert(this.name, 'illegal liquid tag syntax'); + this.tokenizer.skipBlank(); + this.args = this.tokenizer.remaining(); + } +} + +/** + * value expression with optional filters + * e.g. + * {% assign foo="bar" | append: "coo" %} + */ +class FilteredValueToken extends Token { + constructor(initial, filters, input, begin, end, file) { + super(TokenKind.FilteredValue, input, begin, end, file); + this.initial = initial; + this.filters = filters; + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + } +} + +class SimpleEmitter { + constructor() { + this.buffer = ''; + } + write(html) { + this.buffer += stringify(html); + } +} + +class StreamedEmitter { + constructor() { + this.buffer = ''; + this.stream = null; + throw new Error('streaming not supported in browser'); + } +} + +class KeepingTypeEmitter { + constructor() { + this.buffer = ''; + } + write(html) { + html = toValue(html); + // This will only preserve the type if the value is isolated. + // I.E: + // {{ my-port }} -> 42 + // {{ my-host }}:{{ my-port }} -> 'host:42' + if (typeof html !== 'string' && this.buffer === '') { + this.buffer = html; + } + else { + this.buffer = stringify(this.buffer) + stringify(html); + } + } +} + +class Render { + renderTemplatesToNodeStream(templates, ctx) { + const emitter = new StreamedEmitter(); + Promise.resolve().then(() => toPromise(this.renderTemplates(templates, ctx, emitter))) + .then(() => emitter.end(), err => emitter.error(err)); + return emitter.stream; + } + *renderTemplates(templates, ctx, emitter) { + if (!emitter) { + emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter(); + } + const errors = []; + for (const tpl of templates) { + try { + // if tpl.render supports emitter, it'll return empty `html` + const html = yield tpl.render(ctx, emitter); + // if not, it'll return an `html`, write to the emitter for it + html && emitter.write(html); + if (emitter['break'] || emitter['continue']) + break; + } + catch (e) { + const err = LiquidError.is(e) ? e : new RenderError(e, tpl); + if (ctx.opts.catchAllErrors) + errors.push(err); + else + throw err; + } + } + if (errors.length) { + throw new LiquidErrors(errors); + } + return emitter.buffer; + } +} + +class Expression { + constructor(tokens) { + this.postfix = [...toPostfix(tokens)]; + } + *evaluate(ctx, lenient) { + assert(ctx, 'unable to evaluate: context not defined'); + const operands = []; + for (const token of this.postfix) { + if (isOperatorToken(token)) { + const r = operands.pop(); + let result; + if (operatorTypes[token.operator] === 1 /* OperatorType.Unary */) { + result = yield ctx.opts.operators[token.operator](r, ctx); + } + else { + const l = operands.pop(); + result = yield ctx.opts.operators[token.operator](l, r, ctx); + } + operands.push(result); + } + else { + operands.push(yield evalToken(token, ctx, lenient)); + } + } + return operands[0]; + } + valid() { + return !!this.postfix.length; + } +} +function* evalToken(token, ctx, lenient = false) { + if (!token) + return; + if ('content' in token) + return token.content; + if (isPropertyAccessToken(token)) + return yield evalPropertyAccessToken(token, ctx, lenient); + if (isRangeToken(token)) + return yield evalRangeToken(token, ctx); +} +function* evalPropertyAccessToken(token, ctx, lenient) { + const props = []; + for (const prop of token.props) { + props.push((yield evalToken(prop, ctx, false))); + } + try { + if (token.variable) { + const variable = yield evalToken(token.variable, ctx, lenient); + return yield ctx._getFromScope(variable, props); + } + else { + return yield ctx._get(props); + } + } + catch (e) { + if (lenient && e.name === 'InternalUndefinedVariableError') + return null; + throw (new UndefinedVariableError(e, token)); + } +} +function evalQuotedToken(token) { + return token.content; +} +function* evalRangeToken(token, ctx) { + const low = yield evalToken(token.lhs, ctx); + const high = yield evalToken(token.rhs, ctx); + return range(+low, +high + 1); +} +function* toPostfix(tokens) { + const ops = []; + for (const token of tokens) { + if (isOperatorToken(token)) { + while (ops.length && ops[ops.length - 1].getPrecedence() > token.getPrecedence()) { + yield ops.pop(); + } + ops.push(token); + } + else + yield token; + } + while (ops.length) { + yield ops.pop(); + } +} + +function isTruthy(val, ctx) { + return !isFalsy(val, ctx); +} +function isFalsy(val, ctx) { + val = toValue(val); + if (ctx.opts.jsTruthy) { + return !val; + } + else { + return val === false || undefined === val || val === null; + } +} + +const defaultOperators = { + '==': equals, + '!=': (l, r) => !equals(l, r), + '>': (l, r) => { + if (isComparable(l)) + return l.gt(r); + if (isComparable(r)) + return r.lt(l); + return toValue(l) > toValue(r); + }, + '<': (l, r) => { + if (isComparable(l)) + return l.lt(r); + if (isComparable(r)) + return r.gt(l); + return toValue(l) < toValue(r); + }, + '>=': (l, r) => { + if (isComparable(l)) + return l.geq(r); + if (isComparable(r)) + return r.leq(l); + return toValue(l) >= toValue(r); + }, + '<=': (l, r) => { + if (isComparable(l)) + return l.leq(r); + if (isComparable(r)) + return r.geq(l); + return toValue(l) <= toValue(r); + }, + 'contains': (l, r) => { + l = toValue(l); + if (isArray(l)) + return l.some((i) => equals(i, r)); + if (isFunction(l === null || l === void 0 ? void 0 : l.indexOf)) + return l.indexOf(toValue(r)) > -1; + return false; + }, + 'not': (v, ctx) => isFalsy(toValue(v), ctx), + 'and': (l, r, ctx) => isTruthy(toValue(l), ctx) && isTruthy(toValue(r), ctx), + 'or': (l, r, ctx) => isTruthy(toValue(l), ctx) || isTruthy(toValue(r), ctx) +}; +function equals(lhs, rhs) { + if (isComparable(lhs)) + return lhs.equals(rhs); + if (isComparable(rhs)) + return rhs.equals(lhs); + lhs = toValue(lhs); + rhs = toValue(rhs); + if (isArray(lhs)) { + return isArray(rhs) && arrayEquals(lhs, rhs); + } + return lhs === rhs; +} +function arrayEquals(lhs, rhs) { + if (lhs.length !== rhs.length) + return false; + return !lhs.some((value, i) => !equals(value, rhs[i])); +} + +class Node { + constructor(key, value, next, prev) { + this.key = key; + this.value = value; + this.next = next; + this.prev = prev; + } +} +class LRU { + constructor(limit, size = 0) { + this.limit = limit; + this.size = size; + this.cache = {}; + this.head = new Node('HEAD', null, null, null); + this.tail = new Node('TAIL', null, null, null); + this.head.next = this.tail; + this.tail.prev = this.head; + } + write(key, value) { + if (this.cache[key]) { + this.cache[key].value = value; + } + else { + const node = new Node(key, value, this.head.next, this.head); + this.head.next.prev = node; + this.head.next = node; + this.cache[key] = node; + this.size++; + this.ensureLimit(); + } + } + read(key) { + if (!this.cache[key]) + return; + const { value } = this.cache[key]; + this.remove(key); + this.write(key, value); + return value; + } + remove(key) { + const node = this.cache[key]; + node.prev.next = node.next; + node.next.prev = node.prev; + delete this.cache[key]; + this.size--; + } + clear() { + this.head.next = this.tail; + this.tail.prev = this.head; + this.size = 0; + this.cache = {}; + } + ensureLimit() { + if (this.size > this.limit) + this.remove(this.tail.prev.key); + } +} + +function domResolve(root, path) { + const base = document.createElement('base'); + base.href = root; + const head = document.getElementsByTagName('head')[0]; + head.insertBefore(base, head.firstChild); + const a = document.createElement('a'); + a.href = path; + const resolved = a.href; + head.removeChild(base); + return resolved; +} +function resolve(root, filepath, ext) { + if (root.length && last(root) !== '/') + root += '/'; + const url = domResolve(root, filepath); + return url.replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/, (str, origin, path) => { + const last = path.split('/').pop(); + if (/\.\w+$/.test(last)) + return str; + return origin + path + ext; + }); +} +function readFile(url) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + xhr.onload = () => { + if (xhr.status >= 200 && xhr.status < 300) { + resolve(xhr.responseText); + } + else { + reject(new Error(xhr.statusText)); + } + }; + xhr.onerror = () => { + reject(new Error('An error occurred whilst receiving the response.')); + }; + xhr.open('GET', url); + xhr.send(); + }); + }); +} +function readFileSync(url) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.send(); + if (xhr.status < 200 || xhr.status >= 300) { + throw new Error(xhr.statusText); + } + return xhr.responseText; +} +function exists(filepath) { + return __awaiter(this, void 0, void 0, function* () { + return true; + }); +} +function existsSync(filepath) { + return true; +} +function dirname(filepath) { + return domResolve(filepath, '.'); +} +const sep = '/'; + +var fs = /*#__PURE__*/Object.freeze({ + __proto__: null, + resolve: resolve, + readFile: readFile, + readFileSync: readFileSync, + exists: exists, + existsSync: existsSync, + dirname: dirname, + sep: sep +}); + +function defaultFilter(value, defaultValue, ...args) { + value = toValue(value); + if (isArray(value) || isString(value)) + return value.length ? value : defaultValue; + if (value === false && (new Map(args)).get('allow_false')) + return false; + return isFalsy(value, this.context) ? defaultValue : value; +} +function json(value, space = 0) { + return JSON.stringify(value, null, space); +} +function inspect(value, space = 0) { + const ancestors = []; + return JSON.stringify(value, function (_key, value) { + if (typeof value !== 'object' || value === null) + return value; + // `this` is the object that value is contained in, i.e., its direct parent. + while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) + ancestors.pop(); + if (ancestors.includes(value)) + return '[Circular]'; + ancestors.push(value); + return value; + }, space); +} +function to_integer(value) { + return Number(value); +} +const raw = { + raw: true, + handler: identify +}; +var misc = { + default: defaultFilter, + raw, + jsonify: json, + to_integer, + json, + inspect +}; + +const escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; +const unescapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; +function escape(str) { + return stringify(str).replace(/&|<|>|"|'/g, m => escapeMap[m]); +} +function xml_escape(str) { + return escape(str); +} +function unescape(str) { + return stringify(str).replace(/&(amp|lt|gt|#34|#39);/g, m => unescapeMap[m]); +} +function escape_once(str) { + return escape(unescape(stringify(str))); +} +function newline_to_br(v) { + return stringify(v).replace(/\r?\n/gm, '
    \n'); +} +function strip_html(v) { + return stringify(v).replace(/||<.*?>|/g, ''); +} + +var htmlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + escape: escape, + xml_escape: xml_escape, + escape_once: escape_once, + newline_to_br: newline_to_br, + strip_html: strip_html +}); + +const defaultOptions = { + root: ['.'], + layouts: ['.'], + partials: ['.'], + relativeReference: true, + jekyllInclude: false, + cache: undefined, + extname: '', + fs: fs, + dynamicPartials: true, + jsTruthy: false, + dateFormat: '%A, %B %-e, %Y at %-l:%M %P %z', + trimTagRight: false, + trimTagLeft: false, + trimOutputRight: false, + trimOutputLeft: false, + greedy: true, + tagDelimiterLeft: '{%', + tagDelimiterRight: '%}', + outputDelimiterLeft: '{{', + outputDelimiterRight: '}}', + preserveTimezones: false, + strictFilters: false, + strictVariables: false, + ownPropertyOnly: true, + lenientIf: false, + globals: {}, + keepOutputType: false, + operators: defaultOperators +}; +function normalize(options) { + if (options.hasOwnProperty('root')) { + if (!options.hasOwnProperty('partials')) + options.partials = options.root; + if (!options.hasOwnProperty('layouts')) + options.layouts = options.root; + } + if (options.hasOwnProperty('cache')) { + let cache; + if (typeof options.cache === 'number') + cache = options.cache > 0 ? new LRU(options.cache) : undefined; + else if (typeof options.cache === 'object') + cache = options.cache; + else + cache = options.cache ? new LRU(1024) : undefined; + options.cache = cache; + } + options = Object.assign(Object.assign(Object.assign({}, defaultOptions), (options.jekyllInclude ? { dynamicPartials: false } : {})), options); + if ((!options.fs.dirname || !options.fs.sep) && options.relativeReference) { + console.warn('[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning'); + options.relativeReference = false; + } + options.root = normalizeDirectoryList(options.root); + options.partials = normalizeDirectoryList(options.partials); + options.layouts = normalizeDirectoryList(options.layouts); + options.outputEscape = options.outputEscape && getOutputEscapeFunction(options.outputEscape); + return options; +} +function getOutputEscapeFunction(nameOrFunction) { + if (nameOrFunction === 'escape') + return escape; + if (nameOrFunction === 'json') + return misc.json; + assert(isFunction(nameOrFunction), '`outputEscape` need to be of type string or function'); + return nameOrFunction; +} +function normalizeDirectoryList(value) { + let list = []; + if (isArray(value)) + list = value; + if (isString(value)) + list = [value]; + return list; +} + +function whiteSpaceCtrl(tokens, options) { + let inRaw = false; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + if (!isDelimitedToken(token)) + continue; + if (!inRaw && token.trimLeft) { + trimLeft(tokens[i - 1], options.greedy); + } + if (isTagToken(token)) { + if (token.name === 'raw') + inRaw = true; + else if (token.name === 'endraw') + inRaw = false; + } + if (!inRaw && token.trimRight) { + trimRight(tokens[i + 1], options.greedy); + } + } +} +function trimLeft(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + const mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.end - 1 - token.trimRight)] & mask) + token.trimRight++; +} +function trimRight(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + const mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.begin + token.trimLeft)] & mask) + token.trimLeft++; + if (token.input.charAt(token.begin + token.trimLeft) === '\n') + token.trimLeft++; +} + +class Tokenizer { + constructor(input, operators = defaultOptions.operators, file, range) { + this.input = input; + this.file = file; + this.rawBeginAt = -1; + this.p = range ? range[0] : 0; + this.N = range ? range[1] : input.length; + this.opTrie = createTrie(operators); + this.literalTrie = createTrie(literalValues); + } + readExpression() { + return new Expression(this.readExpressionTokens()); + } + *readExpressionTokens() { + while (this.p < this.N) { + const operator = this.readOperator(); + if (operator) { + yield operator; + continue; + } + const operand = this.readValue(); + if (operand) { + yield operand; + continue; + } + return; + } + } + readOperator() { + this.skipBlank(); + const end = this.matchTrie(this.opTrie); + if (end === -1) + return; + return new OperatorToken(this.input, this.p, (this.p = end), this.file); + } + matchTrie(trie) { + let node = trie; + let i = this.p; + let info; + while (node[this.input[i]] && i < this.N) { + node = node[this.input[i++]]; + if (node['end']) + info = node; + } + if (!info) + return -1; + if (info['needBoundary'] && isWord(this.peek(i - this.p))) + return -1; + return i; + } + readFilteredValue() { + const begin = this.p; + const initial = this.readExpression(); + this.assert(initial.valid(), `invalid value expression: ${this.snapshot()}`); + const filters = this.readFilters(); + return new FilteredValueToken(initial, filters, this.input, begin, this.p, this.file); + } + readFilters() { + const filters = []; + while (true) { + const filter = this.readFilter(); + if (!filter) + return filters; + filters.push(filter); + } + } + readFilter() { + this.skipBlank(); + if (this.end()) + return null; + this.assert(this.peek() === '|', `expected "|" before filter`); + this.p++; + const begin = this.p; + const name = this.readIdentifier(); + if (!name.size()) { + this.assert(this.end(), `expected filter name`); + return null; + } + const args = []; + this.skipBlank(); + if (this.peek() === ':') { + do { + ++this.p; + const arg = this.readFilterArg(); + arg && args.push(arg); + this.skipBlank(); + this.assert(this.end() || this.peek() === ',' || this.peek() === '|', () => `unexpected character ${this.snapshot()}`); + } while (this.peek() === ','); + } + else if (this.peek() === '|' || this.end()) ; + else { + throw this.error('expected ":" after filter name'); + } + return new FilterToken(name.getText(), args, this.input, begin, this.p, this.file); + } + readFilterArg() { + const key = this.readValue(); + if (!key) + return; + this.skipBlank(); + if (this.peek() !== ':') + return key; + ++this.p; + const value = this.readValue(); + return [key.getText(), value]; + } + readTopLevelTokens(options = defaultOptions) { + const tokens = []; + while (this.p < this.N) { + const token = this.readTopLevelToken(options); + tokens.push(token); + } + whiteSpaceCtrl(tokens, options); + return tokens; + } + readTopLevelToken(options) { + const { tagDelimiterLeft, outputDelimiterLeft } = options; + if (this.rawBeginAt > -1) + return this.readEndrawOrRawContent(options); + if (this.match(tagDelimiterLeft)) + return this.readTagToken(options); + if (this.match(outputDelimiterLeft)) + return this.readOutputToken(options); + return this.readHTMLToken([tagDelimiterLeft, outputDelimiterLeft]); + } + readHTMLToken(stopStrings) { + const begin = this.p; + while (this.p < this.N) { + if (stopStrings.some(str => this.match(str))) + break; + ++this.p; + } + return new HTMLToken(this.input, begin, this.p, this.file); + } + readTagToken(options = defaultOptions) { + const { file, input } = this; + const begin = this.p; + if (this.readToDelimiter(options.tagDelimiterRight) === -1) { + throw this.error(`tag ${this.snapshot(begin)} not closed`, begin); + } + const token = new TagToken(input, begin, this.p, options, file); + if (token.name === 'raw') + this.rawBeginAt = begin; + return token; + } + readToDelimiter(delimiter, respectQuoted = false) { + this.skipBlank(); + while (this.p < this.N) { + if (respectQuoted && (this.peekType() & QUOTE)) { + this.readQuoted(); + continue; + } + ++this.p; + if (this.rmatch(delimiter)) + return this.p; + } + return -1; + } + readOutputToken(options = defaultOptions) { + const { file, input } = this; + const { outputDelimiterRight } = options; + const begin = this.p; + if (this.readToDelimiter(outputDelimiterRight, true) === -1) { + throw this.error(`output ${this.snapshot(begin)} not closed`, begin); + } + return new OutputToken(input, begin, this.p, options, file); + } + readEndrawOrRawContent(options) { + const { tagDelimiterLeft, tagDelimiterRight } = options; + const begin = this.p; + let leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + while (this.p < this.N) { + if (this.readIdentifier().getText() !== 'endraw') { + leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + continue; + } + while (this.p <= this.N) { + if (this.rmatch(tagDelimiterRight)) { + const end = this.p; + if (begin === leftPos) { + this.rawBeginAt = -1; + return new TagToken(this.input, begin, end, options, this.file); + } + else { + this.p = leftPos; + return new HTMLToken(this.input, begin, leftPos, this.file); + } + } + if (this.rmatch(tagDelimiterLeft)) + break; + this.p++; + } + } + throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, begin); + } + readLiquidTagTokens(options = defaultOptions) { + const tokens = []; + while (this.p < this.N) { + const token = this.readLiquidTagToken(options); + token && tokens.push(token); + } + return tokens; + } + readLiquidTagToken(options) { + this.skipBlank(); + if (this.end()) + return; + const begin = this.p; + this.readToDelimiter('\n'); + const end = this.p; + return new LiquidTagToken(this.input, begin, end, options, this.file); + } + error(msg, pos = this.p) { + return new TokenizationError(msg, new IdentifierToken(this.input, pos, this.N, this.file)); + } + assert(pred, msg, pos) { + if (!pred) + throw this.error(typeof msg === 'function' ? msg() : msg, pos); + } + snapshot(begin = this.p) { + return JSON.stringify(ellipsis(this.input.slice(begin, this.N), 32)); + } + /** + * @deprecated use #readIdentifier instead + */ + readWord() { + return this.readIdentifier(); + } + readIdentifier() { + this.skipBlank(); + const begin = this.p; + while (!this.end() && isWord(this.peek())) + ++this.p; + return new IdentifierToken(this.input, begin, this.p, this.file); + } + readNonEmptyIdentifier() { + const id = this.readIdentifier(); + return id.size() ? id : undefined; + } + readTagName() { + this.skipBlank(); + // Handle inline comment tags + if (this.input[this.p] === '#') + return this.input.slice(this.p, ++this.p); + return this.readIdentifier().getText(); + } + readHashes(jekyllStyle) { + const hashes = []; + while (true) { + const hash = this.readHash(jekyllStyle); + if (!hash) + return hashes; + hashes.push(hash); + } + } + readHash(jekyllStyle) { + this.skipBlank(); + if (this.peek() === ',') + ++this.p; + const begin = this.p; + const name = this.readNonEmptyIdentifier(); + if (!name) + return; + let value; + this.skipBlank(); + const sep = jekyllStyle ? '=' : ':'; + if (this.peek() === sep) { + ++this.p; + value = this.readValue(); + } + return new HashToken(this.input, begin, this.p, name, value, this.file); + } + remaining() { + return this.input.slice(this.p, this.N); + } + advance(step = 1) { + this.p += step; + } + end() { + return this.p >= this.N; + } + readTo(end) { + while (this.p < this.N) { + ++this.p; + if (this.rmatch(end)) + return this.p; + } + return -1; + } + readValue() { + this.skipBlank(); + const begin = this.p; + const variable = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber(); + const props = this.readProperties(!variable); + if (!props.length) + return variable; + return new PropertyAccessToken(variable, props, this.input, begin, this.p); + } + readScopeValue() { + this.skipBlank(); + const begin = this.p; + const props = this.readProperties(); + if (!props.length) + return undefined; + return new PropertyAccessToken(undefined, props, this.input, begin, this.p); + } + readProperties(isBegin = true) { + const props = []; + while (true) { + if (this.peek() === '[') { + this.p++; + const prop = this.readValue() || new IdentifierToken(this.input, this.p, this.p, this.file); + this.assert(this.readTo(']') !== -1, '[ not closed'); + props.push(prop); + continue; + } + if (isBegin && !props.length) { + const prop = this.readNonEmptyIdentifier(); + if (prop) { + props.push(prop); + continue; + } + } + if (this.peek() === '.' && this.peek(1) !== '.') { // skip range syntax + this.p++; + const prop = this.readNonEmptyIdentifier(); + if (!prop) + break; + props.push(prop); + continue; + } + break; + } + return props; + } + readNumber() { + this.skipBlank(); + let decimalFound = false; + let digitFound = false; + let n = 0; + if (this.peekType() & SIGN) + n++; + while (this.p + n <= this.N) { + if (this.peekType(n) & NUMBER) { + digitFound = true; + n++; + } + else if (this.peek(n) === '.' && this.peek(n + 1) !== '.') { + if (decimalFound || !digitFound) + return; + decimalFound = true; + n++; + } + else + break; + } + if (digitFound && !isWord(this.peek(n))) { + const num = new NumberToken(this.input, this.p, this.p + n, this.file); + this.advance(n); + return num; + } + } + readLiteral() { + this.skipBlank(); + const end = this.matchTrie(this.literalTrie); + if (end === -1) + return; + const literal = new LiteralToken(this.input, this.p, end, this.file); + this.p = end; + return literal; + } + readRange() { + this.skipBlank(); + const begin = this.p; + if (this.peek() !== '(') + return; + ++this.p; + const lhs = this.readValueOrThrow(); + this.p += 2; + const rhs = this.readValueOrThrow(); + ++this.p; + return new RangeToken(this.input, begin, this.p, lhs, rhs, this.file); + } + readValueOrThrow() { + const value = this.readValue(); + this.assert(value, () => `unexpected token ${this.snapshot()}, value expected`); + return value; + } + readQuoted() { + this.skipBlank(); + const begin = this.p; + if (!(this.peekType() & QUOTE)) + return; + ++this.p; + let escaped = false; + while (this.p < this.N) { + ++this.p; + if (this.input[this.p - 1] === this.input[begin] && !escaped) + break; + if (escaped) + escaped = false; + else if (this.input[this.p - 1] === '\\') + escaped = true; + } + return new QuotedToken(this.input, begin, this.p, this.file); + } + *readFileNameTemplate(options) { + const { outputDelimiterLeft } = options; + const htmlStopStrings = [',', ' ', outputDelimiterLeft]; + const htmlStopStringSet = new Set(htmlStopStrings); + // break on ',' and ' ', outputDelimiterLeft only stops HTML token + while (this.p < this.N && !htmlStopStringSet.has(this.peek())) { + yield this.match(outputDelimiterLeft) + ? this.readOutputToken(options) + : this.readHTMLToken(htmlStopStrings); + } + } + match(word) { + for (let i = 0; i < word.length; i++) { + if (word[i] !== this.input[this.p + i]) + return false; + } + return true; + } + rmatch(pattern) { + for (let i = 0; i < pattern.length; i++) { + if (pattern[pattern.length - 1 - i] !== this.input[this.p - 1 - i]) + return false; + } + return true; + } + peekType(n = 0) { + return this.p + n >= this.N ? 0 : TYPES[this.input.charCodeAt(this.p + n)]; + } + peek(n = 0) { + return this.p + n >= this.N ? '' : this.input[this.p + n]; + } + skipBlank() { + while (this.peekType() & BLANK) + ++this.p; + } +} + +class ParseStream { + constructor(tokens, parseToken) { + this.handlers = {}; + this.stopRequested = false; + this.tokens = tokens; + this.parseToken = parseToken; + } + on(name, cb) { + this.handlers[name] = cb; + return this; + } + trigger(event, arg) { + const h = this.handlers[event]; + return h ? (h.call(this, arg), true) : false; + } + start() { + this.trigger('start'); + let token; + while (!this.stopRequested && (token = this.tokens.shift())) { + if (this.trigger('token', token)) + continue; + if (isTagToken(token) && this.trigger(`tag:${token.name}`, token)) { + continue; + } + const template = this.parseToken(token, this.tokens); + this.trigger('template', template); + } + if (!this.stopRequested) + this.trigger('end'); + return this; + } + stop() { + this.stopRequested = true; + return this; + } +} + +class TemplateImpl { + constructor(token) { + this.token = token; + } +} + +class Tag extends TemplateImpl { + constructor(token, remainTokens, liquid) { + super(token); + this.name = token.name; + this.liquid = liquid; + this.tokenizer = token.tokenizer; + } +} + +/** + * Key-Value Pairs Representing Tag Arguments + * Example: + * For the markup `, foo:'bar', coo:2 reversed %}`, + * hash['foo'] === 'bar' + * hash['coo'] === 2 + * hash['reversed'] === undefined + */ +class Hash { + constructor(markup, jekyllStyle) { + this.hash = {}; + const tokenizer = new Tokenizer(markup, {}); + for (const hash of tokenizer.readHashes(jekyllStyle)) { + this.hash[hash.name.content] = hash.value; + } + } + *render(ctx) { + const hash = {}; + for (const key of Object.keys(this.hash)) { + hash[key] = this.hash[key] === undefined ? true : yield evalToken(this.hash[key], ctx); + } + return hash; + } +} + +function createTagClass(options) { + return class extends Tag { + constructor(token, tokens, liquid) { + super(token, tokens, liquid); + if (isFunction(options.parse)) { + options.parse.call(this, token, tokens); + } + } + *render(ctx, emitter) { + const hash = (yield new Hash(this.token.args).render(ctx)); + return yield options.render.call(this, ctx, emitter, hash); + } + }; +} + +function isKeyValuePair(arr) { + return isArray(arr); +} + +class Filter { + constructor(name, options, args, liquid) { + this.name = name; + this.handler = isFunction(options) + ? options + : (isFunction(options === null || options === void 0 ? void 0 : options.handler) ? options.handler : identify); + this.raw = !isFunction(options) && !!(options === null || options === void 0 ? void 0 : options.raw); + this.args = args; + this.liquid = liquid; + } + *render(value, context) { + const argv = []; + for (const arg of this.args) { + if (isKeyValuePair(arg)) + argv.push([arg[0], yield evalToken(arg[1], context)]); + else + argv.push(yield evalToken(arg, context)); + } + return yield this.handler.apply({ context, liquid: this.liquid }, [value, ...argv]); + } +} + +class Value { + /** + * @param str the value to be valuated, eg.: "foobar" | truncate: 3 + */ + constructor(input, liquid) { + this.filters = []; + const token = typeof input === 'string' + ? new Tokenizer(input, liquid.options.operators).readFilteredValue() + : input; + this.initial = token.initial; + this.filters = token.filters.map(({ name, args }) => new Filter(name, this.getFilter(liquid, name), args, liquid)); + } + *value(ctx, lenient) { + lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default'); + let val = yield this.initial.evaluate(ctx, lenient); + for (const filter of this.filters) { + val = yield filter.render(val, ctx); + } + return val; + } + getFilter(liquid, name) { + const impl = liquid.filters[name]; + assert(impl || !liquid.options.strictFilters, () => `undefined filter: ${name}`); + return impl; + } +} + +class Output extends TemplateImpl { + constructor(token, liquid) { + var _a; + super(token); + const tokenizer = new Tokenizer(token.input, liquid.options.operators, token.file, token.contentRange); + this.value = new Value(tokenizer.readFilteredValue(), liquid); + const filters = this.value.filters; + const outputEscape = liquid.options.outputEscape; + if (!((_a = filters[filters.length - 1]) === null || _a === void 0 ? void 0 : _a.raw) && outputEscape) { + filters.push(new Filter(toString.call(outputEscape), outputEscape, [], liquid)); + } + } + *render(ctx, emitter) { + const val = yield this.value.value(ctx, false); + emitter.write(val); + } +} + +class HTML extends TemplateImpl { + constructor(token) { + super(token); + this.str = token.getContent(); + } + *render(ctx, emitter) { + emitter.write(this.str); + } +} + +var LookupType; +(function (LookupType) { + LookupType["Partials"] = "partials"; + LookupType["Layouts"] = "layouts"; + LookupType["Root"] = "root"; +})(LookupType || (LookupType = {})); +class Loader { + constructor(options) { + this.options = options; + if (options.relativeReference) { + const sep = options.fs.sep; + assert(sep, '`fs.sep` is required for relative reference'); + const rRelativePath = new RegExp(['.' + sep, '..' + sep, './', '../'].map(prefix => escapeRegex(prefix)).join('|')); + this.shouldLoadRelative = (referencedFile) => rRelativePath.test(referencedFile); + } + else { + this.shouldLoadRelative = (referencedFile) => false; + } + this.contains = this.options.fs.contains || (() => true); + } + *lookup(file, type, sync, currentFile) { + const { fs } = this.options; + const dirs = this.options[type]; + for (const filepath of this.candidates(file, dirs, currentFile, type !== LookupType.Root)) { + if (sync ? fs.existsSync(filepath) : yield fs.exists(filepath)) + return filepath; + } + throw this.lookupError(file, dirs); + } + *candidates(file, dirs, currentFile, enforceRoot) { + const { fs, extname } = this.options; + if (this.shouldLoadRelative(file) && currentFile) { + const referenced = fs.resolve(this.dirname(currentFile), file, extname); + for (const dir of dirs) { + if (!enforceRoot || this.contains(dir, referenced)) { + // the relatively referenced file is within one of root dirs + yield referenced; + break; + } + } + } + for (const dir of dirs) { + const referenced = fs.resolve(dir, file, extname); + if (!enforceRoot || this.contains(dir, referenced)) { + yield referenced; + } + } + if (fs.fallback !== undefined) { + const filepath = fs.fallback(file); + if (filepath !== undefined) + yield filepath; + } + } + dirname(path) { + const fs = this.options.fs; + assert(fs.dirname, '`fs.dirname` is required for relative reference'); + return fs.dirname(path); + } + lookupError(file, roots) { + const err = new Error('ENOENT'); + err.message = `ENOENT: Failed to lookup "${file}" in "${roots}"`; + err.code = 'ENOENT'; + return err; + } +} + +class Parser { + constructor(liquid) { + this.liquid = liquid; + this.cache = this.liquid.options.cache; + this.fs = this.liquid.options.fs; + this.parseFile = this.cache ? this._parseFileCached : this._parseFile; + this.loader = new Loader(this.liquid.options); + } + parse(html, filepath) { + const tokenizer = new Tokenizer(html, this.liquid.options.operators, filepath); + const tokens = tokenizer.readTopLevelTokens(this.liquid.options); + return this.parseTokens(tokens); + } + parseTokens(tokens) { + let token; + const templates = []; + const errors = []; + while ((token = tokens.shift())) { + try { + templates.push(this.parseToken(token, tokens)); + } + catch (err) { + if (this.liquid.options.catchAllErrors) + errors.push(err); + else + throw err; + } + } + if (errors.length) + throw new LiquidErrors(errors); + return templates; + } + parseToken(token, remainTokens) { + try { + if (isTagToken(token)) { + const TagClass = this.liquid.tags[token.name]; + assert(TagClass, `tag "${token.name}" not found`); + return new TagClass(token, remainTokens, this.liquid); + } + if (isOutputToken(token)) { + return new Output(token, this.liquid); + } + return new HTML(token); + } + catch (e) { + if (LiquidError.is(e)) + throw e; + throw new ParseError(e, token); + } + } + parseStream(tokens) { + return new ParseStream(tokens, (token, tokens) => this.parseToken(token, tokens)); + } + *_parseFileCached(file, sync, type = LookupType.Root, currentFile) { + const cache = this.cache; + const key = this.loader.shouldLoadRelative(file) ? currentFile + ',' + file : type + ':' + file; + const tpls = yield cache.read(key); + if (tpls) + return tpls; + const task = this._parseFile(file, sync, type, currentFile); + // sync mode: exec the task and cache the result + // async mode: cache the task before exec + const taskOrTpl = sync ? yield task : toPromise(task); + cache.write(key, taskOrTpl); + // note: concurrent tasks will be reused, cache for failed task is removed until its end + try { + return yield taskOrTpl; + } + catch (err) { + cache.remove(key); + throw err; + } + } + *_parseFile(file, sync, type = LookupType.Root, currentFile) { + const filepath = yield this.loader.lookup(file, type, sync, currentFile); + return this.liquid.parse(sync ? this.fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath); + } +} + +var TokenKind; +(function (TokenKind) { + TokenKind[TokenKind["Number"] = 1] = "Number"; + TokenKind[TokenKind["Literal"] = 2] = "Literal"; + TokenKind[TokenKind["Tag"] = 4] = "Tag"; + TokenKind[TokenKind["Output"] = 8] = "Output"; + TokenKind[TokenKind["HTML"] = 16] = "HTML"; + TokenKind[TokenKind["Filter"] = 32] = "Filter"; + TokenKind[TokenKind["Hash"] = 64] = "Hash"; + TokenKind[TokenKind["PropertyAccess"] = 128] = "PropertyAccess"; + TokenKind[TokenKind["Word"] = 256] = "Word"; + TokenKind[TokenKind["Range"] = 512] = "Range"; + TokenKind[TokenKind["Quoted"] = 1024] = "Quoted"; + TokenKind[TokenKind["Operator"] = 2048] = "Operator"; + TokenKind[TokenKind["FilteredValue"] = 4096] = "FilteredValue"; + TokenKind[TokenKind["Delimited"] = 12] = "Delimited"; +})(TokenKind || (TokenKind = {})); + +function isDelimitedToken(val) { + return !!(getKind(val) & TokenKind.Delimited); +} +function isOperatorToken(val) { + return getKind(val) === TokenKind.Operator; +} +function isHTMLToken(val) { + return getKind(val) === TokenKind.HTML; +} +function isOutputToken(val) { + return getKind(val) === TokenKind.Output; +} +function isTagToken(val) { + return getKind(val) === TokenKind.Tag; +} +function isQuotedToken(val) { + return getKind(val) === TokenKind.Quoted; +} +function isLiteralToken(val) { + return getKind(val) === TokenKind.Literal; +} +function isNumberToken(val) { + return getKind(val) === TokenKind.Number; +} +function isPropertyAccessToken(val) { + return getKind(val) === TokenKind.PropertyAccess; +} +function isWordToken(val) { + return getKind(val) === TokenKind.Word; +} +function isRangeToken(val) { + return getKind(val) === TokenKind.Range; +} +function getKind(val) { + return val ? val.kind : -1; +} + +var typeGuards = /*#__PURE__*/Object.freeze({ + __proto__: null, + isDelimitedToken: isDelimitedToken, + isOperatorToken: isOperatorToken, + isHTMLToken: isHTMLToken, + isOutputToken: isOutputToken, + isTagToken: isTagToken, + isQuotedToken: isQuotedToken, + isLiteralToken: isLiteralToken, + isNumberToken: isNumberToken, + isPropertyAccessToken: isPropertyAccessToken, + isWordToken: isWordToken, + isRangeToken: isRangeToken +}); + +class Context { + constructor(env = {}, opts = defaultOptions, renderOptions = {}) { + var _a, _b, _c; + /** + * insert a Context-level empty scope, + * for tags like `{% capture %}` `{% assign %}` to operate + */ + this.scopes = [{}]; + this.registers = {}; + this.sync = !!renderOptions.sync; + this.opts = opts; + this.globals = (_a = renderOptions.globals) !== null && _a !== void 0 ? _a : opts.globals; + this.environments = isObject(env) ? env : Object(env); + this.strictVariables = (_b = renderOptions.strictVariables) !== null && _b !== void 0 ? _b : this.opts.strictVariables; + this.ownPropertyOnly = (_c = renderOptions.ownPropertyOnly) !== null && _c !== void 0 ? _c : opts.ownPropertyOnly; + } + getRegister(key) { + return (this.registers[key] = this.registers[key] || {}); + } + setRegister(key, value) { + return (this.registers[key] = value); + } + saveRegister(...keys) { + return keys.map(key => [key, this.getRegister(key)]); + } + restoreRegister(keyValues) { + return keyValues.forEach(([key, value]) => this.setRegister(key, value)); + } + getAll() { + return [this.globals, this.environments, ...this.scopes] + .reduce((ctx, val) => __assign(ctx, val), {}); + } + /** + * @deprecated use `_get()` or `getSync()` instead + */ + get(paths) { + return this.getSync(paths); + } + getSync(paths) { + return toValueSync(this._get(paths)); + } + *_get(paths) { + const scope = this.findScope(paths[0]); + return yield this._getFromScope(scope, paths); + } + /** + * @deprecated use `_get()` instead + */ + getFromScope(scope, paths) { + return toValueSync(this._getFromScope(scope, paths)); + } + *_getFromScope(scope, paths, strictVariables = this.strictVariables) { + if (isString(paths)) + paths = paths.split('.'); + for (let i = 0; i < paths.length; i++) { + scope = yield readProperty(scope, paths[i], this.ownPropertyOnly); + if (strictVariables && isUndefined(scope)) { + throw new InternalUndefinedVariableError(paths.slice(0, i + 1).join('.')); + } + } + return scope; + } + push(ctx) { + return this.scopes.push(ctx); + } + pop() { + return this.scopes.pop(); + } + bottom() { + return this.scopes[0]; + } + findScope(key) { + for (let i = this.scopes.length - 1; i >= 0; i--) { + const candidate = this.scopes[i]; + if (key in candidate) + return candidate; + } + if (key in this.environments) + return this.environments; + return this.globals; + } +} +function readProperty(obj, key, ownPropertyOnly) { + obj = toLiquid(obj); + if (isNil(obj)) + return obj; + if (isArray(obj) && key < 0) + return obj[obj.length + +key]; + const value = readJSProperty(obj, key, ownPropertyOnly); + if (value === undefined && obj instanceof Drop) + return obj.liquidMethodMissing(key); + if (isFunction(value)) + return value.call(obj); + if (key === 'size') + return readSize(obj); + else if (key === 'first') + return readFirst(obj); + else if (key === 'last') + return readLast(obj); + return value; +} +function readJSProperty(obj, key, ownPropertyOnly) { + if (ownPropertyOnly && !Object.hasOwnProperty.call(obj, key) && !(obj instanceof Drop)) + return undefined; + return obj[key]; +} +function readFirst(obj) { + if (isArray(obj)) + return obj[0]; + return obj['first']; +} +function readLast(obj) { + if (isArray(obj)) + return obj[obj.length - 1]; + return obj['last']; +} +function readSize(obj) { + if (obj.hasOwnProperty('size') || obj['size'] !== undefined) + return obj['size']; + if (isArray(obj) || isString(obj)) + return obj.length; + if (typeof obj === 'object') + return Object.keys(obj).length; +} + +var BlockMode; +(function (BlockMode) { + /* store rendered html into blocks */ + BlockMode[BlockMode["OUTPUT"] = 0] = "OUTPUT"; + /* output rendered html directly */ + BlockMode[BlockMode["STORE"] = 1] = "STORE"; +})(BlockMode || (BlockMode = {})); + +const abs = argumentsToValue(Math.abs); +const at_least = argumentsToValue(Math.max); +const at_most = argumentsToValue(Math.min); +const ceil = argumentsToValue(Math.ceil); +const divided_by = argumentsToValue((dividend, divisor, integerArithmetic = false) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor); +const floor = argumentsToValue(Math.floor); +const minus = argumentsToValue((v, arg) => v - arg); +const modulo = argumentsToValue((v, arg) => v % arg); +const times = argumentsToValue((v, arg) => v * arg); +function round(v, arg = 0) { + v = toValue(v); + arg = toValue(arg); + const amp = Math.pow(10, arg); + return Math.round(v * amp) / amp; +} +function plus(v, arg) { + v = toValue(v); + arg = toValue(arg); + return Number(v) + Number(arg); +} + +var mathFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + abs: abs, + at_least: at_least, + at_most: at_most, + ceil: ceil, + divided_by: divided_by, + floor: floor, + minus: minus, + modulo: modulo, + times: times, + round: round, + plus: plus +}); + +const url_decode = (x) => decodeURIComponent(stringify(x)).replace(/\+/g, ' '); +const url_encode = (x) => encodeURIComponent(stringify(x)).replace(/%20/g, '+'); +const cgi_escape = (x) => encodeURIComponent(stringify(x)) + .replace(/%20/g, '+') + .replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase()); +const uri_escape = (x) => encodeURI(stringify(x)) + .replace(/%5B/g, '[') + .replace(/%5D/g, ']'); +const rSlugifyDefault = /[^\p{M}\p{L}\p{Nd}]+/ug; +const rSlugifyReplacers = { + 'raw': /\s+/g, + 'default': rSlugifyDefault, + 'pretty': /[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/ug, + 'ascii': /[^A-Za-z0-9]+/g, + 'latin': rSlugifyDefault, + 'none': null +}; +function slugify(str, mode = 'default', cased = false) { + str = stringify(str); + const replacer = rSlugifyReplacers[mode]; + if (replacer) { + if (mode === 'latin') + str = removeAccents(str); + str = str.replace(replacer, '-').replace(/^-|-$/g, ''); + } + return cased ? str : str.toLowerCase(); +} +function removeAccents(str) { + return str.replace(/[àáâãäå]/g, 'a') + .replace(/[æ]/g, 'ae') + .replace(/[ç]/g, 'c') + .replace(/[èéêë]/g, 'e') + .replace(/[ìíîï]/g, 'i') + .replace(/[ð]/g, 'd') + .replace(/[ñ]/g, 'n') + .replace(/[òóôõöø]/g, 'o') + .replace(/[ùúûü]/g, 'u') + .replace(/[ýÿ]/g, 'y') + .replace(/[ß]/g, 'ss') + .replace(/[œ]/g, 'oe') + .replace(/[þ]/g, 'th') + .replace(/[ẞ]/g, 'SS') + .replace(/[Œ]/g, 'OE') + .replace(/[Þ]/g, 'TH'); +} + +var urlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + url_decode: url_decode, + url_encode: url_encode, + cgi_escape: cgi_escape, + uri_escape: uri_escape, + slugify: slugify +}); + +const join = argumentsToValue((v, arg) => toArray(v).join(arg === undefined ? ' ' : arg)); +const last$1 = argumentsToValue((v) => isArray(v) ? last(v) : ''); +const first = argumentsToValue((v) => isArray(v) ? v[0] : ''); +const reverse = argumentsToValue((v) => [...toArray(v)].reverse()); +function* sort(arr, property) { + const values = []; + for (const item of toArray(arr)) { + values.push([ + item, + property ? yield this.context._getFromScope(item, stringify(property).split('.'), false) : item + ]); + } + return values.sort((lhs, rhs) => { + const lvalue = lhs[1]; + const rvalue = rhs[1]; + return lvalue < rvalue ? -1 : (lvalue > rvalue ? 1 : 0); + }).map(tuple => tuple[0]); +} +function sort_natural(input, property) { + const propertyString = stringify(property); + const compare = property === undefined + ? caseInsensitiveCompare + : (lhs, rhs) => caseInsensitiveCompare(lhs[propertyString], rhs[propertyString]); + return [...toArray(input)].sort(compare); +} +const size = (v) => (v && v.length) || 0; +function* map(arr, property) { + const results = []; + for (const item of toArray(arr)) { + results.push(yield this.context._getFromScope(item, stringify(property), false)); + } + return results; +} +function* sum(arr, property) { + let sum = 0; + for (const item of toArray(arr)) { + const data = Number(property ? yield this.context._getFromScope(item, stringify(property), false) : item); + sum += Number.isNaN(data) ? 0 : data; + } + return sum; +} +function compact(arr) { + return toArray(arr).filter(x => !isNil(toValue(x))); +} +function concat(v, arg = []) { + return toArray(v).concat(toArray(arg)); +} +function push(v, arg) { + return concat(v, [arg]); +} +function unshift(v, arg) { + const clone = [...toArray(v)]; + clone.unshift(arg); + return clone; +} +function pop(v) { + const clone = [...toArray(v)]; + clone.pop(); + return clone; +} +function shift(v) { + const clone = [...toArray(v)]; + clone.shift(); + return clone; +} +function slice(v, begin, length = 1) { + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + begin = begin < 0 ? v.length + begin : begin; + return v.slice(begin, begin + length); +} +function* where(arr, property, expected) { + const values = []; + arr = toArray(arr); + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of arr) { + values.push(yield evalToken(token, new Context(item))); + } + return arr.filter((_, i) => { + if (expected === undefined) + return isTruthy(values[i], this.context); + return equals(values[i], expected); + }); +} +function* where_exp(arr, itemName, exp) { + const filtered = []; + const keyTemplate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const value = yield keyTemplate.value(new Context({ [itemName]: item })); + if (value) + filtered.push(item); + } + return filtered; +} +function* group_by(arr, property) { + const map = new Map(); + arr = toArray(arr); + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of arr) { + const key = yield evalToken(token, new Context(item)); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + } + return [...map.entries()].map(([name, items]) => ({ name, items })); +} +function* group_by_exp(arr, itemName, exp) { + const map = new Map(); + const keyTemplate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const key = yield keyTemplate.value(new Context({ [itemName]: item })); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + } + return [...map.entries()].map(([name, items]) => ({ name, items })); +} +function* find(arr, property, expected) { + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of toArray(arr)) { + const value = yield evalToken(token, new Context(item)); + if (equals(value, expected)) + return item; + } + return null; +} +function* find_exp(arr, itemName, exp) { + const predicate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const value = yield predicate.value(new Context({ [itemName]: item })); + if (value) + return item; + } + return null; +} +function uniq(arr) { + arr = toValue(arr); + const u = {}; + return (arr || []).filter(val => { + if (hasOwnProperty.call(u, String(val))) + return false; + u[String(val)] = true; + return true; + }); +} +function sample(v, count = 1) { + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + const shuffled = [...v].sort(() => Math.random() - 0.5); + if (count === 1) + return shuffled[0]; + return shuffled.slice(0, count); +} + +var arrayFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + join: join, + last: last$1, + first: first, + reverse: reverse, + sort: sort, + sort_natural: sort_natural, + size: size, + map: map, + sum: sum, + compact: compact, + concat: concat, + push: push, + unshift: unshift, + pop: pop, + shift: shift, + slice: slice, + where: where, + where_exp: where_exp, + group_by: group_by, + group_by_exp: group_by_exp, + find: find, + find_exp: find_exp, + uniq: uniq, + sample: sample +}); + +function date(v, format, timezoneOffset) { + const date = parseDate(v, this.context.opts, timezoneOffset); + if (!date) + return v; + format = toValue(format); + format = isNil(format) ? this.context.opts.dateFormat : stringify(format); + return strftime(date, format); +} +function date_to_xmlschema(v) { + return date.call(this, v, '%Y-%m-%dT%H:%M:%S%:z'); +} +function date_to_rfc822(v) { + return date.call(this, v, '%a, %d %b %Y %H:%M:%S %z'); +} +function date_to_string(v, type, style) { + return stringify_date.call(this, v, '%b', type, style); +} +function date_to_long_string(v, type, style) { + return stringify_date.call(this, v, '%B', type, style); +} +function stringify_date(v, month_type, type, style) { + const date = parseDate(v, this.context.opts); + if (!date) + return v; + if (type === 'ordinal') { + const d = date.getDate(); + return style === 'US' + ? strftime(date, `${month_type} ${d}%q, %Y`) + : strftime(date, `${d}%q ${month_type} %Y`); + } + return strftime(date, `%d ${month_type} %Y`); +} +function parseDate(v, opts, timezoneOffset) { + let date; + v = toValue(v); + if (v === 'now' || v === 'today') { + date = new Date(); + } + else if (isNumber(v)) { + date = new Date(v * 1000); + } + else if (isString(v)) { + if (/^\d+$/.test(v)) { + date = new Date(+v * 1000); + } + else if (opts.preserveTimezones) { + date = TimezoneDate.createDateFixedToTimezone(v); + } + else { + date = new Date(v); + } + } + else { + date = v; + } + if (!isValidDate(date)) + return; + if (timezoneOffset !== undefined) { + date = new TimezoneDate(date, timezoneOffset); + } + else if (!(date instanceof TimezoneDate) && opts.timezoneOffset !== undefined) { + date = new TimezoneDate(date, opts.timezoneOffset); + } + return date; +} +function isValidDate(date) { + return (date instanceof Date || date instanceof TimezoneDate) && !isNaN(date.getTime()); +} + +var dateFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + date: date, + date_to_xmlschema: date_to_xmlschema, + date_to_rfc822: date_to_rfc822, + date_to_string: date_to_string, + date_to_long_string: date_to_long_string +}); + +/** + * String related filters + * + * * prefer stringify() to String() since `undefined`, `null` should eval '' + */ +const rCJKWord = /[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu; +// Word boundary followed by word characters (for detecting words) +const rNonCJKWord = /[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu; +function append(v, arg) { + assert(arguments.length === 2, 'append expect 2 arguments'); + return stringify(v) + stringify(arg); +} +function prepend(v, arg) { + assert(arguments.length === 2, 'prepend expect 2 arguments'); + return stringify(arg) + stringify(v); +} +function lstrip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v).replace(new RegExp(`^[${chars}]+`, 'g'), ''); + } + return stringify(v).replace(/^\s+/, ''); +} +function downcase(v) { + return stringify(v).toLowerCase(); +} +function upcase(str) { + return stringify(str).toUpperCase(); +} +function remove(v, arg) { + return stringify(v).split(stringify(arg)).join(''); +} +function remove_first(v, l) { + return stringify(v).replace(stringify(l), ''); +} +function remove_last(v, l) { + const str = stringify(v); + const pattern = stringify(l); + const index = str.lastIndexOf(pattern); + if (index === -1) + return str; + return str.substring(0, index) + str.substring(index + pattern.length); +} +function rstrip(str, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(str).replace(new RegExp(`[${chars}]+$`, 'g'), ''); + } + return stringify(str).replace(/\s+$/, ''); +} +function split(v, arg) { + const arr = stringify(v).split(stringify(arg)); + // align to ruby split, which is the behavior of shopify/liquid + // see: https://ruby-doc.org/core-2.4.0/String.html#method-i-split + while (arr.length && arr[arr.length - 1] === '') + arr.pop(); + return arr; +} +function strip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v) + .replace(new RegExp(`^[${chars}]+`, 'g'), '') + .replace(new RegExp(`[${chars}]+$`, 'g'), ''); + } + return stringify(v).trim(); +} +function strip_newlines(v) { + return stringify(v).replace(/\r?\n/gm, ''); +} +function capitalize(str) { + str = stringify(str); + return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); +} +function replace(v, pattern, replacement) { + return stringify(v).split(stringify(pattern)).join(replacement); +} +function replace_first(v, arg1, arg2) { + return stringify(v).replace(stringify(arg1), arg2); +} +function replace_last(v, arg1, arg2) { + const str = stringify(v); + const pattern = stringify(arg1); + const index = str.lastIndexOf(pattern); + if (index === -1) + return str; + const replacement = stringify(arg2); + return str.substring(0, index) + replacement + str.substring(index + pattern.length); +} +function truncate(v, l = 50, o = '...') { + v = stringify(v); + if (v.length <= l) + return v; + return v.substring(0, l - o.length) + o; +} +function truncatewords(v, words = 15, o = '...') { + const arr = stringify(v).split(/\s+/); + if (words <= 0) + words = 1; + let ret = arr.slice(0, words).join(' '); + if (arr.length >= words) + ret += o; + return ret; +} +function normalize_whitespace(v) { + v = stringify(v); + return v.replace(/\s+/g, ' '); +} +function number_of_words(input, mode) { + input = stringify(input).trim(); + if (!input) + return 0; + switch (mode) { + case 'cjk': + // Count CJK characters and words + return (input.match(rCJKWord) || []).length + (input.match(rNonCJKWord) || []).length; + case 'auto': + // Count CJK characters, if none, count words + return rCJKWord.test(input) + ? input.match(rCJKWord).length + (input.match(rNonCJKWord) || []).length + : input.split(/\s+/).length; + default: + // Count words only + return input.split(/\s+/).length; + } +} +function array_to_sentence_string(array, connector = 'and') { + switch (array.length) { + case 0: + return ''; + case 1: + return array[0]; + case 2: + return `${array[0]} ${connector} ${array[1]}`; + default: + return `${array.slice(0, -1).join(', ')}, ${connector} ${array[array.length - 1]}`; + } +} + +var stringFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + append: append, + prepend: prepend, + lstrip: lstrip, + downcase: downcase, + upcase: upcase, + remove: remove, + remove_first: remove_first, + remove_last: remove_last, + rstrip: rstrip, + split: split, + strip: strip, + strip_newlines: strip_newlines, + capitalize: capitalize, + replace: replace, + replace_first: replace_first, + replace_last: replace_last, + truncate: truncate, + truncatewords: truncatewords, + normalize_whitespace: normalize_whitespace, + number_of_words: number_of_words, + array_to_sentence_string: array_to_sentence_string +}); + +const filters = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, htmlFilters), mathFilters), urlFilters), arrayFilters), dateFilters), stringFilters), misc); + +class AssignTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.key = this.tokenizer.readIdentifier().content; + this.tokenizer.assert(this.key, 'expected variable name'); + this.tokenizer.skipBlank(); + this.tokenizer.assert(this.tokenizer.peek() === '=', 'expected "="'); + this.tokenizer.advance(); + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + } + *render(ctx) { + ctx.bottom()[this.key] = yield this.value.value(ctx, this.liquid.options.lenientIf); + } +} + +const MODIFIERS = ['offset', 'limit', 'reversed']; +class ForTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const variable = this.tokenizer.readIdentifier(); + const inStr = this.tokenizer.readIdentifier(); + const collection = this.tokenizer.readValue(); + if (!variable.size() || inStr.content !== 'in' || !collection) { + throw new Error(`illegal tag: ${token.getText()}`); + } + this.variable = variable.content; + this.collection = collection; + this.hash = new Hash(this.tokenizer.remaining()); + this.templates = []; + this.elseTemplates = []; + let p; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('start', () => (p = this.templates)) + .on('tag:else', () => (p = this.elseTemplates)) + .on('tag:endfor', () => stream.stop()) + .on('template', (tpl) => p.push(tpl)) + .on('end', () => { + throw new Error(`tag ${token.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + let collection = toEnumerable(yield evalToken(this.collection, ctx)); + if (!collection.length) { + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + return; + } + const continueKey = 'continue-' + this.variable + '-' + this.collection.getText(); + ctx.push({ continue: ctx.getRegister(continueKey) }); + const hash = yield this.hash.render(ctx); + ctx.pop(); + const modifiers = this.liquid.options.orderedFilterParameters + ? Object.keys(hash).filter(x => MODIFIERS.includes(x)) + : MODIFIERS.filter(x => hash[x] !== undefined); + collection = modifiers.reduce((collection, modifier) => { + if (modifier === 'offset') + return offset(collection, hash['offset']); + if (modifier === 'limit') + return limit(collection, hash['limit']); + return reversed(collection); + }, collection); + ctx.setRegister(continueKey, (hash['offset'] || 0) + collection.length); + const scope = { forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) }; + ctx.push(scope); + for (const item of collection) { + scope[this.variable] = item; + yield r.renderTemplates(this.templates, ctx, emitter); + if (emitter['break']) { + emitter['break'] = false; + break; + } + emitter['continue'] = false; + scope.forloop.next(); + } + ctx.pop(); + } +} +function reversed(arr) { + return [...arr].reverse(); +} +function offset(arr, count) { + return arr.slice(count); +} +function limit(arr, count) { + return arr.slice(0, count); +} + +class CaptureTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.templates = []; + this.variable = this.readVariableName(); + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcapture') + return; + this.templates.push(liquid.parser.parseToken(token, remainTokens)); + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + *render(ctx) { + const r = this.liquid.renderer; + const html = yield r.renderTemplates(this.templates, ctx); + ctx.bottom()[this.variable] = html; + } + readVariableName() { + const word = this.tokenizer.readIdentifier().content; + if (word) + return word; + const quoted = this.tokenizer.readQuoted(); + if (quoted) + return evalQuotedToken(quoted); + throw this.tokenizer.error('invalid capture name'); + } +} + +class CaseTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + this.elseTemplates = []; + let p = []; + let elseCount = 0; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('tag:when', (token) => { + if (elseCount > 0) { + return; + } + p = []; + const values = []; + while (!token.tokenizer.end()) { + values.push(token.tokenizer.readValueOrThrow()); + token.tokenizer.skipBlank(); + if (token.tokenizer.peek() === ',') { + token.tokenizer.readTo(','); + } + else { + token.tokenizer.readTo('or'); + } + } + this.branches.push({ + values, + templates: p + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endcase', () => stream.stop()) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { + throw new Error(`tag ${tagToken.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + const target = toValue(yield this.value.value(ctx, ctx.opts.lenientIf)); + let branchHit = false; + for (const branch of this.branches) { + for (const valueToken of branch.values) { + const value = yield evalToken(valueToken, ctx, ctx.opts.lenientIf); + if (equals(target, value)) { + yield r.renderTemplates(branch.templates, ctx, emitter); + branchHit = true; + break; + } + } + } + if (!branchHit) { + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } + } +} + +class CommentTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcomment') + return; + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + render() { } +} + +class RenderTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const tokenizer = this.tokenizer; + this.file = parseFilePath(tokenizer, this.liquid); + this.currentFile = token.file; + while (!tokenizer.end()) { + tokenizer.skipBlank(); + const begin = tokenizer.p; + const keyword = tokenizer.readIdentifier(); + if (keyword.content === 'with' || keyword.content === 'for') { + tokenizer.skipBlank(); + // can be normal key/value pair, like "with: true" + if (tokenizer.peek() !== ':') { + const value = tokenizer.readValue(); + // can be normal key, like "with," + if (value) { + const beforeAs = tokenizer.p; + const asStr = tokenizer.readIdentifier(); + let alias; + if (asStr.content === 'as') + alias = tokenizer.readIdentifier(); + else + tokenizer.p = beforeAs; + this[keyword.content] = { value, alias: alias && alias.content }; + tokenizer.skipBlank(); + if (tokenizer.peek() === ',') + tokenizer.advance(); + continue; // matched! + } + } + } + /** + * restore cursor if with/for not matched + */ + tokenizer.p = begin; + break; + } + this.hash = new Hash(tokenizer.remaining()); + } + *render(ctx, emitter) { + const { liquid, hash } = this; + const filepath = (yield renderFilePath(this['file'], ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables }); + const scope = childCtx.bottom(); + __assign(scope, yield hash.render(ctx)); + if (this['with']) { + const { value, alias } = this['with']; + scope[alias || filepath] = yield evalToken(value, ctx); + } + if (this['for']) { + const { value, alias } = this['for']; + const collection = toEnumerable(yield evalToken(value, ctx)); + scope['forloop'] = new ForloopDrop(collection.length, value.getText(), alias); + for (const item of collection) { + scope[alias] = item; + const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])); + yield liquid.renderer.renderTemplates(templates, childCtx, emitter); + scope['forloop'].next(); + } + } + else { + const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])); + yield liquid.renderer.renderTemplates(templates, childCtx, emitter); + } + } +} +/** + * @return null for "none", + * @return Template[] for quoted with tags and/or filters + * @return Token for expression (not quoted) + * @throws TypeError if cannot read next token + */ +function parseFilePath(tokenizer, liquid) { + if (liquid.options.dynamicPartials) { + const file = tokenizer.readValue(); + tokenizer.assert(file, 'illegal file path'); + if (file.getText() === 'none') + return; + if (isQuotedToken(file)) { + // for filenames like "files/{{file}}", eval as liquid template + const templates = liquid.parse(evalQuotedToken(file)); + return optimize(templates); + } + return file; + } + const tokens = [...tokenizer.readFileNameTemplate(liquid.options)]; + const templates = optimize(liquid.parser.parseTokens(tokens)); + return templates === 'none' ? undefined : templates; +} +function optimize(templates) { + // for filenames like "files/file.liquid", extract the string directly + if (templates.length === 1 && isHTMLToken(templates[0].token)) + return templates[0].token.getContent(); + return templates; +} +function* renderFilePath(file, ctx, liquid) { + if (typeof file === 'string') + return file; + if (Array.isArray(file)) + return liquid.renderer.renderTemplates(file, ctx); + return yield evalToken(file, ctx); +} + +class IncludeTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const { tokenizer } = token; + this['file'] = parseFilePath(tokenizer, this.liquid); + this['currentFile'] = token.file; + const begin = tokenizer.p; + const withStr = tokenizer.readIdentifier(); + if (withStr.content === 'with') { + tokenizer.skipBlank(); + if (tokenizer.peek() !== ':') { + this.withVar = tokenizer.readValue(); + } + else + tokenizer.p = begin; + } + else + tokenizer.p = begin; + this.hash = new Hash(tokenizer.remaining(), this.liquid.options.jekyllInclude); + } + *render(ctx, emitter) { + const { liquid, hash, withVar } = this; + const { renderer } = liquid; + const filepath = (yield renderFilePath(this['file'], ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const saved = ctx.saveRegister('blocks', 'blockMode'); + ctx.setRegister('blocks', {}); + ctx.setRegister('blockMode', BlockMode.OUTPUT); + const scope = (yield hash.render(ctx)); + if (withVar) + scope[filepath] = yield evalToken(withVar, ctx); + const templates = (yield liquid._parsePartialFile(filepath, ctx.sync, this['currentFile'])); + ctx.push(ctx.opts.jekyllInclude ? { include: scope } : scope); + yield renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + ctx.restoreRegister(saved); + } +} + +class DecrementTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.variable = this.tokenizer.readIdentifier().content; + } + render(context, emitter) { + const scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + emitter.write(stringify(--scope[this.variable])); + } +} + +class CycleTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.candidates = []; + const group = this.tokenizer.readValue(); + this.tokenizer.skipBlank(); + if (group) { + if (this.tokenizer.peek() === ':') { + this.group = group; + this.tokenizer.advance(); + } + else + this.candidates.push(group); + } + while (!this.tokenizer.end()) { + const value = this.tokenizer.readValue(); + if (value) + this.candidates.push(value); + this.tokenizer.readTo(','); + } + this.tokenizer.assert(this.candidates.length, () => `empty candidates: "${token.getText()}"`); + } + *render(ctx, emitter) { + const group = (yield evalToken(this.group, ctx)); + const fingerprint = `cycle:${group}:` + this.candidates.join(','); + const groups = ctx.getRegister('cycle'); + let idx = groups[fingerprint]; + if (idx === undefined) { + idx = groups[fingerprint] = 0; + } + const candidate = this.candidates[idx]; + idx = (idx + 1) % this.candidates.length; + groups[fingerprint] = idx; + return yield evalToken(candidate, ctx); + } +} + +class IfTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + let p = []; + let elseCount = 0; + liquid.parser.parseStream(remainTokens) + .on('start', () => this.branches.push({ + value: new Value(tagToken.args, this.liquid), + templates: (p = []) + })) + .on('tag:elsif', (token) => { + if (elseCount > 0) { + p = []; + return; + } + this.branches.push({ + value: new Value(token.args, this.liquid), + templates: (p = []) + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endif', function () { this.stop(); }) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`); }) + .start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + for (const { value, templates } of this.branches) { + const v = yield value.value(ctx, ctx.opts.lenientIf); + if (isTruthy(v, ctx)) { + yield r.renderTemplates(templates, ctx, emitter); + return; + } + } + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } +} + +class IncrementTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.variable = this.tokenizer.readIdentifier().content; + } + render(context, emitter) { + const scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + const val = scope[this.variable]; + scope[this.variable]++; + emitter.write(stringify(val)); + } +} + +class LayoutTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.file = parseFilePath(this.tokenizer, this.liquid); + this['currentFile'] = token.file; + this.args = new Hash(this.tokenizer.remaining()); + this.templates = this.liquid.parser.parseTokens(remainTokens); + } + *render(ctx, emitter) { + const { liquid, args, file } = this; + const { renderer } = liquid; + if (file === undefined) { + ctx.setRegister('blockMode', BlockMode.OUTPUT); + yield renderer.renderTemplates(this.templates, ctx, emitter); + return; + } + const filepath = (yield renderFilePath(this.file, ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const templates = (yield liquid._parseLayoutFile(filepath, ctx.sync, this['currentFile'])); + // render remaining contents and store rendered results + ctx.setRegister('blockMode', BlockMode.STORE); + const html = yield renderer.renderTemplates(this.templates, ctx); + const blocks = ctx.getRegister('blocks'); + // set whole content to anonymous block if anonymous doesn't specified + if (blocks[''] === undefined) + blocks[''] = (parent, emitter) => emitter.write(html); + ctx.setRegister('blockMode', BlockMode.OUTPUT); + // render the layout file use stored blocks + ctx.push((yield args.render(ctx))); + yield renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + } +} + +class BlockTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.templates = []; + const match = /\w+/.exec(token.args); + this.block = match ? match[0] : ''; + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endblock') + return; + const template = liquid.parser.parseToken(token, remainTokens); + this.templates.push(template); + } + throw new Error(`tag ${token.getText()} not closed`); + } + *render(ctx, emitter) { + const blockRender = this.getBlockRender(ctx); + if (ctx.getRegister('blockMode') === BlockMode.STORE) { + ctx.getRegister('blocks')[this.block] = blockRender; + } + else { + yield blockRender(new BlockDrop(), emitter); + } + } + getBlockRender(ctx) { + const { liquid, templates } = this; + const renderChild = ctx.getRegister('blocks')[this.block]; + const renderCurrent = function* (superBlock, emitter) { + // add {{ block.super }} support when rendering + ctx.push({ block: superBlock }); + yield liquid.renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + }; + return renderChild + ? (superBlock, emitter) => renderChild(new BlockDrop(() => renderCurrent(superBlock, emitter)), emitter) + : renderCurrent; + } +} + +class RawTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.tokens = []; + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endraw') + return; + this.tokens.push(token); + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + render() { + return this.tokens.map((token) => token.getText()).join(''); + } +} + +class TablerowloopDrop extends ForloopDrop { + constructor(length, cols, collection, variable) { + super(length, collection, variable); + this.length = length; + this.cols = cols; + } + row() { + return Math.floor(this.i / this.cols) + 1; + } + col0() { + return (this.i % this.cols); + } + col() { + return this.col0() + 1; + } + col_first() { + return this.col0() === 0; + } + col_last() { + return this.col() === this.cols; + } +} + +class TablerowTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + const variable = this.tokenizer.readIdentifier(); + this.tokenizer.skipBlank(); + const predicate = this.tokenizer.readIdentifier(); + const collectionToken = this.tokenizer.readValue(); + if (predicate.content !== 'in' || !collectionToken) { + throw new Error(`illegal tag: ${tagToken.getText()}`); + } + this.variable = variable.content; + this.collection = collectionToken; + this.args = new Hash(this.tokenizer.remaining()); + this.templates = []; + let p; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('start', () => (p = this.templates)) + .on('tag:endtablerow', () => stream.stop()) + .on('template', (tpl) => p.push(tpl)) + .on('end', () => { + throw new Error(`tag ${tagToken.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + let collection = toEnumerable(yield evalToken(this.collection, ctx)); + const args = (yield this.args.render(ctx)); + const offset = args.offset || 0; + const limit = (args.limit === undefined) ? collection.length : args.limit; + collection = collection.slice(offset, offset + limit); + const cols = args.cols || collection.length; + const r = this.liquid.renderer; + const tablerowloop = new TablerowloopDrop(collection.length, cols, this.collection.getText(), this.variable); + const scope = { tablerowloop }; + ctx.push(scope); + for (let idx = 0; idx < collection.length; idx++, tablerowloop.next()) { + scope[this.variable] = collection[idx]; + if (tablerowloop.col0() === 0) { + if (tablerowloop.row() !== 1) + emitter.write(''); + emitter.write(``); + } + emitter.write(``); + yield r.renderTemplates(this.templates, ctx, emitter); + emitter.write(''); + } + if (collection.length) + emitter.write(''); + ctx.pop(); + } +} + +class UnlessTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + let p = []; + let elseCount = 0; + this.liquid.parser.parseStream(remainTokens) + .on('start', () => this.branches.push({ + value: new Value(tagToken.args, this.liquid), + test: isFalsy, + templates: (p = []) + })) + .on('tag:elsif', (token) => { + if (elseCount > 0) { + p = []; + return; + } + this.branches.push({ + value: new Value(token.args, this.liquid), + test: isTruthy, + templates: (p = []) + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endunless', function () { this.stop(); }) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`); }) + .start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + for (const { value, test, templates } of this.branches) { + const v = yield value.value(ctx, ctx.opts.lenientIf); + if (test(v, ctx)) { + yield r.renderTemplates(templates, ctx, emitter); + return; + } + } + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } +} + +class BreakTag extends Tag { + render(ctx, emitter) { + emitter['break'] = true; + } +} + +class ContinueTag extends Tag { + render(ctx, emitter) { + emitter['continue'] = true; + } +} + +class EchoTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.tokenizer.skipBlank(); + if (!this.tokenizer.end()) { + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + } + } + *render(ctx, emitter) { + if (!this.value) + return; + const val = yield this.value.value(ctx, false); + emitter.write(val); + } +} + +class LiquidTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const tokens = this.tokenizer.readLiquidTagTokens(this.liquid.options); + this.templates = this.liquid.parser.parseTokens(tokens); + } + *render(ctx, emitter) { + yield this.liquid.renderer.renderTemplates(this.templates, ctx, emitter); + } +} + +class InlineCommentTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + if (tagToken.args.search(/\n\s*[^#\s]/g) !== -1) { + throw new Error('every line of an inline comment must start with a \'#\' character'); + } + } + render() { } +} + +const tags = { + assign: AssignTag, + 'for': ForTag, + capture: CaptureTag, + 'case': CaseTag, + comment: CommentTag, + include: IncludeTag, + render: RenderTag, + decrement: DecrementTag, + increment: IncrementTag, + cycle: CycleTag, + 'if': IfTag, + layout: LayoutTag, + block: BlockTag, + raw: RawTag, + tablerow: TablerowTag, + unless: UnlessTag, + 'break': BreakTag, + 'continue': ContinueTag, + echo: EchoTag, + liquid: LiquidTag, + '#': InlineCommentTag +}; + +class Liquid { + constructor(opts = {}) { + this.renderer = new Render(); + this.filters = {}; + this.tags = {}; + this.options = normalize(opts); + this.parser = new Parser(this); + forOwn(tags, (conf, name) => this.registerTag(name, conf)); + forOwn(filters, (handler, name) => this.registerFilter(name, handler)); + } + parse(html, filepath) { + return this.parser.parse(html, filepath); + } + _render(tpl, scope, renderOptions) { + const ctx = scope instanceof Context ? scope : new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplates(tpl, ctx); + } + render(tpl, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._render(tpl, scope, Object.assign(Object.assign({}, renderOptions), { sync: false }))); + }); + } + renderSync(tpl, scope, renderOptions) { + return toValueSync(this._render(tpl, scope, Object.assign(Object.assign({}, renderOptions), { sync: true }))); + } + renderToNodeStream(tpl, scope, renderOptions = {}) { + const ctx = new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplatesToNodeStream(tpl, ctx); + } + _parseAndRender(html, scope, renderOptions) { + const tpl = this.parse(html); + return this._render(tpl, scope, renderOptions); + } + parseAndRender(html, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._parseAndRender(html, scope, Object.assign(Object.assign({}, renderOptions), { sync: false }))); + }); + } + parseAndRenderSync(html, scope, renderOptions) { + return toValueSync(this._parseAndRender(html, scope, Object.assign(Object.assign({}, renderOptions), { sync: true }))); + } + _parsePartialFile(file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Partials, currentFile); + } + _parseLayoutFile(file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile); + } + _parseFile(file, sync, lookupType, currentFile) { + return this.parser.parseFile(file, sync, lookupType, currentFile); + } + parseFile(file, lookupType) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this.parser.parseFile(file, false, lookupType)); + }); + } + parseFileSync(file, lookupType) { + return toValueSync(this.parser.parseFile(file, true, lookupType)); + } + *_renderFile(file, ctx, renderFileOptions) { + const templates = (yield this._parseFile(file, renderFileOptions.sync, renderFileOptions.lookupType)); + return yield this._render(templates, ctx, renderFileOptions); + } + renderFile(file, ctx, renderFileOptions) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._renderFile(file, ctx, Object.assign(Object.assign({}, renderFileOptions), { sync: false }))); + }); + } + renderFileSync(file, ctx, renderFileOptions) { + return toValueSync(this._renderFile(file, ctx, Object.assign(Object.assign({}, renderFileOptions), { sync: true }))); + } + renderFileToNodeStream(file, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function* () { + const templates = yield this.parseFile(file); + return this.renderToNodeStream(templates, scope, renderOptions); + }); + } + _evalValue(str, scope) { + const value = new Value(str, this); + const ctx = scope instanceof Context ? scope : new Context(scope, this.options); + return value.value(ctx); + } + evalValue(str, scope) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._evalValue(str, scope)); + }); + } + evalValueSync(str, scope) { + return toValueSync(this._evalValue(str, scope)); + } + registerFilter(name, filter) { + this.filters[name] = filter; + } + registerTag(name, tag) { + this.tags[name] = isFunction(tag) ? tag : createTagClass(tag); + } + plugin(plugin) { + return plugin.call(this, Liquid); + } + express() { + const self = this; // eslint-disable-line + let firstCall = true; + return function (filePath, ctx, callback) { + if (firstCall) { + firstCall = false; + const dirs = normalizeDirectoryList(this.root); + self.options.root.unshift(...dirs); + self.options.layouts.unshift(...dirs); + self.options.partials.unshift(...dirs); + } + self.renderFile(filePath, ctx).then(html => callback(null, html), callback); + }; + } +} + +/* istanbul ignore file */ +const version = '10.14.0'; + +export { AssertionError, AssignTag, BlockTag, BreakTag, CaptureTag, CaseTag, CommentTag, Context, ContinueTag, CycleTag, DecrementTag, Drop, EchoTag, Expression, Filter, ForTag, Hash, IfTag, IncludeTag, IncrementTag, InlineCommentTag, LayoutTag, Liquid, LiquidError, LiquidTag, Output, ParseError, ParseStream, RawTag, RenderError, RenderTag, TablerowTag, Tag, TagToken, TimezoneDate, Token, TokenKind, TokenizationError, Tokenizer, typeGuards as TypeGuards, UndefinedVariableError, UnlessTag, Value, assert, createTrie, defaultOperators, defaultOptions, evalQuotedToken, evalToken, filters, isFalsy, isTruthy, tags, toPromise, toValue, toValueSync, version }; diff --git a/node_modules/liquidjs/dist/liquid.browser.min.js b/node_modules/liquidjs/dist/liquid.browser.min.js new file mode 100644 index 0000000..9fd36c1 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid.browser.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).liquidjs={})}(this,function(l){"use strict";var j=function(e,t){return(j=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return(T=Object.assign||function(e){for(var t,r=1,n=arguments.length;ra[0]&&t[1]=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||0> ":" ",r=J(String(e),String(o).length),t="".concat(t).concat(r,"| "),r=e===n?"\n"+J("^",i+t.length):"";return t+s[e-1]+r}).join("\n")),enumerable:!1}),this.message=(e=this.message,(t=this.token).file&&(e+=", file:".concat(t.file)),t=d(t.getPosition(),2),r=t[0],t=t[1],e+=", line:".concat(r,", col:").concat(t)),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)},ie.is=function(e){return"LiquidError"===(null==e?void 0:e[re])},ie);function ie(e,t){var r=te.call(this,"string"==typeof e?e:e.message)||this;return r.context="","string"!=typeof e&&Object.defineProperty(r,"originalError",{value:e,enumerable:!1}),Object.defineProperty(r,"token",{value:t,enumerable:!1}),Object.defineProperty(r,re,{value:"LiquidError",enumerable:!1}),r}s(ae,se=ne);var se,oe=ae;function ae(e,t){e=se.call(this,e,t)||this;return e.name="TokenizationError",se.prototype.update.call(e),e}s(le,ue=ne);var ue,ce=le;function le(e,t){t=ue.call(this,e,t)||this;return t.name="ParseError",t.message=e.message,ue.prototype.update.call(t),t}s(fe,pe=ne),fe.is=function(e){return"RenderError"===e.name};var pe,he=fe;function fe(e,t){t=pe.call(this,e,t.token)||this;return t.name="RenderError",t.message=e.message,pe.prototype.update.call(t),t}s(ve,de=ne),ve.is=function(e){return"LiquidErrors"===e.name};var de,ge=ve;function ve(e){var t=de.call(this,e[0],e[0].token)||this,r=(t.errors=e,t.name="LiquidErrors",1":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},zt={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0},St=(s(Rt,Ft=e),Rt.prototype.getPrecedence=function(){var e=this.getText();return e in Ot?Ot[e]:1},Rt);function Rt(e,t,r,n){var i=Ft.call(this,l.TokenKind.Operator,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.operator=i.getText(),i}s(Lt,qt=e);var qt,Et=Lt;function Lt(e,t,r,n,i,s){r=qt.call(this,l.TokenKind.PropertyAccess,r,n,i,s)||this;return r.variable=e,r.props=t,r}s(Mt,Dt=e);var Dt,Nt=Mt;function Mt(e,t,r,n,i,s){r=Dt.call(this,l.TokenKind.Filter,r,n,i,s)||this;return r.name=e,r.args=t,r}s(At,jt=e);var jt,Pt=At;function At(e,t,r,n,i,s){var o=jt.call(this,l.TokenKind.Hash,e,t,r,s)||this;return o.input=e,o.begin=t,o.end=r,o.name=n,o.value=i,o.file=s,o}var Vt=/[\da-fA-F]/,It=/[0-7]/,Bt={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function Ct(e){e=e.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}s(Kt,Ht=e);var Ht,Ut=Kt;function Kt(e,t,r,n){var i=Ht.call(this,l.TokenKind.Quoted,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.content=function(e){for(var t="",r=1;rs.getPrecedence()?[4,r.pop()]:[3,5];case 4:return e.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:e.sent(),e.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=e.sent(),o={error:o},[3,12];case 11:try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return e.sent(),[3,12];case 14:return[2]}})}(e)),!1)}function z(t,r,n){return void 0===n&&(n=!1),x(this,function(e){switch(e.label){case 0:return t?"content"in t?[2,t.content]:en(t)?[4,function(t,r,n){var i,s,o,a,u,c,l,p,h;return x(this,function(e){switch(e.label){case 0:i=[],e.label=1;case 1:e.trys.push([1,6,7,8]),s=_(t.props),o=s.next(),e.label=2;case 2:return o.done?[3,5]:(c=o.value,u=(a=i).push,[4,z(c,r,!1)]);case 3:u.apply(a,[e.sent()]),e.label=4;case 4:return o=s.next(),[3,2];case 5:return[3,8];case 6:return c=e.sent(),p={error:c},[3,8];case 7:try{o&&!o.done&&(h=s.return)&&h.call(s)}finally{if(p)throw p.error}return[7];case 8:return(e.trys.push([8,14,,15]),t.variable)?[4,z(t.variable,r,n)]:[3,11];case 9:return l=e.sent(),[4,r._getFromScope(l,i)];case 10:return[2,e.sent()];case 11:return[4,r._get(i)];case 12:return[2,e.sent()];case 13:return[3,15];case 14:if(l=e.sent(),n&&"InternalUndefinedVariableError"===l.name)return[2,null];throw new me(l,t);case 15:return[2]}})}(t,r,n)]:[3,2]:[2];case 1:return[2,e.sent()];case 2:return tn(t)?[4,function(t,r){var n,i;return x(this,function(e){switch(e.label){case 0:return[4,z(t.lhs,r)];case 1:return n=e.sent(),[4,z(t.rhs,r)];case 2:return i=e.sent(),[2,W(+n,+i+1)]}})}(t,r)]:[3,4];case 3:return[2,e.sent()];case 4:return[2]}})}function lr(e){return e.content}function pr(e,t){return!hr(e,t)}function hr(e,t){return e=m(e),t.opts.jsTruthy?!e:!1===e||null==e}De={"==":fr,"!=":function(e,t){return!fr(e,t)},">":function(e,t){return f(e)?e.gt(t):f(t)?t.lt(e):m(e)>m(t)},"<":function(e,t){return f(e)?e.lt(t):f(t)?t.gt(e):m(e)=":function(e,t){return f(e)?e.geq(t):f(t)?t.leq(e):m(e)>=m(t)},"<=":function(e,t){return f(e)?e.leq(t):f(t)?t.geq(e):m(e)<=m(t)},contains:function(e,t){return b(e=m(e))?e.some(function(e){return fr(e,t)}):!!u(null==e?void 0:e.indexOf)&&-1this.limit&&this.remove(this.tail.prev.key)},vr);function vr(e,t){void 0===t&&(t=0),this.limit=e,this.size=t,this.cache={},this.head=new dr("HEAD",null,null,null),this.tail=new dr("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}function yr(e,t){var r=document.createElement("base"),e=(r.href=e,document.getElementsByTagName("head")[0]),n=(e.insertBefore(r,e.firstChild),document.createElement("a")),t=(n.href=t,n.href);return e.removeChild(r),t}i=Object.freeze({__proto__:null,resolve:function(e,t,i){return e.length&&"/"!==$(e)&&(e+="/"),yr(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(e,t,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?e:t+r+i})},readFile:function(n){return a(this,void 0,void 0,function(){return x(this,function(e){return[2,new Promise(function(e,t){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?e(r.responseText):t(new Error(r.statusText))},r.onerror=function(){t(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(e){var t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||300<=t.status)throw new Error(t.statusText);return t.responseText},exists:function(e){return a(this,void 0,void 0,function(){return x(this,function(e){return[2,!0]})})},existsSync:function(e){return!0},dirname:function(e){return yr(e,".")},sep:"/"});function mr(e,t){return void 0===t&&(t=0),JSON.stringify(e,null,t)}var br={default:function(e,t){for(var r=[],n=2;n":">",'"':""","'":"'"},kr={"&":"&","<":"<",">":">",""":'"',"'":"'"};function Tr(e){return v(e).replace(/&|<|>|"|'/g,function(e){return wr[e]})}var r=Object.freeze({__proto__:null,escape:Tr,xml_escape:Tr,escape_once:function(e){return Tr((e=v(e),v(e).replace(/&(amp|lt|gt|#34|#39);/g,function(e){return kr[e]})))},newline_to_br:function(e){return v(e).replace(/\r?\n/gm,"
    \n")},strip_html:function(e){return v(e).replace(/||<.*?>|/g,"")}}),xr={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,cache:void 0,extname:"",fs:i,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:De};function _r(e){var t;return e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")&&(t=void 0,t="number"==typeof e.cache?0t?e.slice(0,t-3)+"...":e));var t},R.prototype.readWord=function(){return this.readIdentifier()},R.prototype.readIdentifier=function(){this.skipBlank();for(var e=this.p;!this.end()&&Re(this.peek());)++this.p;return new wt(this.input,e,this.p,this.file)},R.prototype.readNonEmptyIdentifier=function(){var e=this.readIdentifier();return e.size()?e:void 0},R.prototype.readTagName=function(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()},R.prototype.readHashes=function(e){for(var t=[];;){var r=this.readHash(e);if(!r)return t;t.push(r)}},R.prototype.readHash=function(e){this.skipBlank(),","===this.peek()&&++this.p;var t,r=this.p,n=this.readNonEmptyIdentifier();if(n)return this.skipBlank(),e=e?"=":":",this.peek()===e&&(++this.p,t=this.readValue()),new Pt(this.input,r,this.p,n,t,this.file)},R.prototype.remaining=function(){return this.input.slice(this.p,this.N)},R.prototype.advance=function(e){this.p+=e=void 0===e?1:e},R.prototype.end=function(){return this.p>=this.N},R.prototype.readTo=function(e){for(;this.p=this.N?0:p[this.input.charCodeAt(this.p+e)]},R.prototype.peek=function(e){return this.p+(e=void 0===e?0:e)>=this.N?"":this.input[this.p+e]},R.prototype.skipBlank=function(){for(;this.peekType()&ze;)++this.p};var S=R;function R(e,t,r,n){void 0===t&&(t=xr.operators),this.input=e,this.file=r,this.rawBeginAt=-1,this.p=n?n[0]:0,this.N=n?n[1]:e.length,this.opTrie=Ce(t),this.literalTrie=Ce(Be)}Sr.prototype.on=function(e,t){return this.handlers[e]=t,this},Sr.prototype.trigger=function(e,t){e=this.handlers[e];return!!e&&(e.call(this,t),!0)},Sr.prototype.start=function(){var e,t;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)this.trigger("token",e)||Gr(e)&&this.trigger("tag:".concat(e.name),e)||(t=this.parseToken(e,this.tokens),this.trigger("template",t));return this.stopRequested||this.trigger("end"),this},Sr.prototype.stop=function(){return this.stopRequested=!0,this};var zr=Sr;function Sr(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}function Rr(e){this.token=e}s(Er,qr=Rr);var qr,q=Er;function Er(e,t,r){var n=qr.call(this,e)||this;return n.name=e.name,n.liquid=r,n.tokenizer=e.tokenizer,n}Dr.prototype.render=function(t){var r,n,i,s,o,a,u,c,l;return x(this,function(e){switch(e.label){case 0:r={},e.label=1;case 1:e.trys.push([1,8,9,10]),n=_(Object.keys(this.hash)),i=n.next(),e.label=2;case 2:return i.done?[3,7]:(s=i.value,o=r,a=s,void 0!==this.hash[s]?[3,3]:(u=!0,[3,5]));case 3:return[4,z(this.hash[s],t)];case 4:u=e.sent(),e.label=5;case 5:o[a]=u,e.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=e.sent(),c={error:c},[3,10];case 9:try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(c)throw c.error}return[7];case 10:return[2,r]}})};var Lr=Dr;function Dr(e,t){this.hash={};var r,n,e=new S(e,{});try{for(var i=_(e.readHashes(t)),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}Mr.prototype.render=function(t,r){var n,i,s,o,a,u,c,l,p,h,f;return x(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=_(this.args),s=i.next(),e.label=2;case 2:return s.done?[3,7]:b(o=s.value)?(u=(a=n).push,c=[o[0]],[4,z(o[1],r)]):[3,4];case 3:return u.apply(a,[c.concat([e.sent()])]),[3,6];case 4:return p=(l=n).push,[4,z(o,r)];case 5:p.apply(l,[e.sent()]),e.label=6;case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return h=e.sent(),h={error:h},[3,10];case 9:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(h)throw h.error}return[7];case 10:return[4,this.handler.apply({context:r,liquid:this.liquid},g([t],d(n),!1))];case 11:return[2,e.sent()]}})};var Nr=Mr;function Mr(e,t,r,n){this.name=e,this.handler=u(t)?t:u(null==t?void 0:t.handler)?t.handler:G,this.raw=!u(t)&&!(null==t||!t.raw),this.args=r,this.liquid=n}jr.prototype.value=function(t,r){var n,i,s,o,a;return x(this,function(e){switch(e.label){case 0:return r=r||t.opts.lenientIf&&0=t&&(n+=r),n},normalize_whitespace:function(e){return(e=v(e)).replace(/\s+/g," ")},number_of_words:function(e,t){if(!(e=v(e).trim()))return 0;switch(t){case"cjk":return(e.match(mn)||[]).length+(e.match(bn)||[]).length;case"auto":return mn.test(e)?e.match(mn).length+(e.match(bn)||[]).length:e.split(/\s+/).length;default:return e.split(/\s+/).length}},array_to_sentence_string:function(e,t){switch(void 0===t&&(t="and"),e.length){case 0:return"";case 1:return e[0];case 2:return"".concat(e[0]," ").concat(t," ").concat(e[1]);default:return"".concat(e.slice(0,-1).join(", "),", ").concat(t," ").concat(e[e.length-1])}}}),kn=T(T(T(T(T(T(T({},r),nn),on),pn),hn),sn),br),an=(s(Tn,wn=q),Tn.prototype.render=function(t){var r,n;return x(this,function(e){switch(e.label){case 0:return r=t.bottom(),n=this.key,[4,this.value.value(t,this.liquid.options.lenientIf)];case 1:return r[n]=e.sent(),[2]}})},Tn);function Tn(e,t,r){e=wn.call(this,e,t,r)||this;return e.key=e.tokenizer.readIdentifier().content,e.tokenizer.assert(e.key,"expected variable name"),e.tokenizer.skipBlank(),e.tokenizer.assert("="===e.tokenizer.peek(),'expected "="'),e.tokenizer.advance(),e.value=new E(e.tokenizer.readFilteredValue(),e.liquid),e}var xn,_n=["offset","limit","reversed"],un=(s(Fn,xn=q),Fn.prototype.render=function(t,r){var n,i,s,o,a,u,c,l,p,h,f;return x(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,s=U,[4,z(this.collection,t)];case 1:return(i=s.apply(void 0,[e.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,t,r)];case 2:return e.sent(),[2];case 3:return o="continue-"+this.variable+"-"+this.collection.getText(),t.push({continue:t.getRegister(o)}),[4,this.hash.render(t)];case 4:a=e.sent(),t.pop(),u=this.liquid.options.orderedFilterParameters?Object.keys(a).filter(function(e){return _n.includes(e)}):_n.filter(function(e){return void 0!==a[e]}),i=u.reduce(function(e,t){var r;return"offset"===t?(r=a.offset,e.slice(r)):"limit"===t?(r=a.limit,e.slice(0,r)):g([],d(e),!1).reverse()},i),t.setRegister(o,(a.offset||0)+i.length),u={forloop:new Pe(i.length,this.collection.getText(),this.variable)},t.push(u),e.label=5;case 5:e.trys.push([5,10,11,12]),c=_(i),l=c.next(),e.label=6;case 6:return l.done?[3,9]:(p=l.value,u[this.variable]=p,[4,n.renderTemplates(this.templates,t,r)]);case 7:if(e.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,u.forloop.next(),e.label=8;case 8:return l=c.next(),[3,6];case 9:return[3,12];case 10:return p=e.sent(),h={error:p},[3,12];case 11:try{l&&!l.done&&(f=c.return)&&f.call(c)}finally{if(h)throw h.error}return[7];case 12:return t.pop(),[2]}})},Fn);function Fn(e,t,r){var n,i=xn.call(this,e,t,r)||this,r=i.tokenizer.readIdentifier(),s=i.tokenizer.readIdentifier(),o=i.tokenizer.readValue();if(!r.size()||"in"!==s.content||!o)throw new Error("illegal tag: ".concat(e.getText()));i.variable=r.content,i.collection=o,i.hash=new Lr(i.tokenizer.remaining()),i.templates=[],i.elseTemplates=[];var a=i.liquid.parser.parseStream(t).on("start",function(){return n=i.templates}).on("tag:else",function(){return n=i.elseTemplates}).on("tag:endfor",function(){return a.stop()}).on("template",function(e){return n.push(e)}).on("end",function(){throw new Error("tag ".concat(e.getText()," not closed"))});return a.start(),i}s(zn,On=q),zn.prototype.render=function(t){var r;return x(this,function(e){switch(e.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,t)];case 1:return r=e.sent(),t.bottom()[this.variable]=r,[2]}})},zn.prototype.readVariableName=function(){var e=this.tokenizer.readIdentifier().content;if(e)return e;e=this.tokenizer.readQuoted();if(e)return lr(e);throw this.tokenizer.error("invalid capture name")};var On,cn=zn;function zn(e,t,r){var n=On.call(this,e,t,r)||this;for(n.templates=[],n.variable=n.readVariableName();t.length;){var i=t.shift();if(Gr(i)&&"endcapture"===i.name)return n;n.templates.push(r.parser.parseToken(i,t))}throw new Error("tag ".concat(e.getText()," not closed"))}s(Rn,Sn=q),Rn.prototype.render=function(t,r){var n,i,s,o,a,u,c,l,p,h,f,d,g,v;return x(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,s=m,[4,this.value.value(t,t.opts.lenientIf)];case 1:i=s.apply(void 0,[e.sent()]),o=!1,e.label=2;case 2:e.trys.push([2,14,15,16]),a=_(this.branches),u=a.next(),e.label=3;case 3:if(u.done)return[3,13];c=u.value,e.label=4;case 4:e.trys.push([4,10,11,12]),g=void 0,l=_(c.values),p=l.next(),e.label=5;case 5:return p.done?[3,9]:[4,z(p.value,t,t.opts.lenientIf)];case 6:return(h=e.sent(),fr(i,h))?[4,n.renderTemplates(c.templates,t,r)]:[3,8];case 7:return e.sent(),o=!0,[3,9];case 8:return p=l.next(),[3,5];case 9:return[3,12];case 10:return h=e.sent(),g={error:h},[3,12];case 11:try{p&&!p.done&&(v=l.return)&&v.call(l)}finally{if(g)throw g.error}return[7];case 12:return u=a.next(),[3,3];case 13:return[3,16];case 14:return f=e.sent(),f={error:f},[3,16];case 15:try{u&&!u.done&&(d=a.return)&&d.call(a)}finally{if(f)throw f.error}return[7];case 16:return o?[3,18]:[4,n.renderTemplates(this.elseTemplates,t,r)];case 17:e.sent(),e.label=18;case 18:return[2]}})};var Sn,ln=Rn;function Rn(e,t,r){var n=Sn.call(this,e,t,r)||this,i=(n.branches=[],n.elseTemplates=[],n.value=new E(n.tokenizer.readFilteredValue(),n.liquid),n.elseTemplates=[],[]),s=0,o=n.liquid.parser.parseStream(t).on("tag:when",function(e){if(!(0"),r.write(''))),r.write('')),[4,s.renderTemplates(this.templates,t,r)]):[3,6];case 4:e.sent(),r.write(""),e.label=5;case 5:return u++,o.next(),[3,3];case 6:return n.length&&r.write(""),t.pop(),[2]}})};var oi,ai=ui;function ui(e,t,r){var n,i=oi.call(this,e,t,r)||this,r=i.tokenizer.readIdentifier(),s=(i.tokenizer.skipBlank(),i.tokenizer.readIdentifier()),o=i.tokenizer.readValue();if("in"!==s.content||!o)throw new Error("illegal tag: ".concat(e.getText()));i.variable=r.content,i.collection=o,i.args=new Lr(i.tokenizer.remaining()),i.templates=[];var a=i.liquid.parser.parseStream(t).on("start",function(){return n=i.templates}).on("tag:endtablerow",function(){return a.stop()}).on("template",function(e){return n.push(e)}).on("end",function(){throw new Error("tag ".concat(e.getText()," not closed"))});return a.start(),i}s(pi,ci=q),pi.prototype.render=function(t,r){var n,i,s,o,a,u,c,l;return x(this,function(e){switch(e.label){case 0:n=this.liquid.renderer,e.label=1;case 1:e.trys.push([1,7,8,9]),i=_(this.branches),s=i.next(),e.label=2;case 2:return s.done?[3,6]:(a=s.value,u=a.value,o=a.test,a=a.templates,[4,u.value(t,t.opts.lenientIf)]);case 3:return(u=e.sent(),o(u,t))?[4,n.renderTemplates(a,t,r)]:[3,5];case 4:return e.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return c=e.sent(),c={error:c},[3,9];case 8:try{s&&!s.done&&(l=i.return)&&l.call(i)}finally{if(c)throw c.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,t,r)];case 10:return e.sent(),[2]}})};var ci,li=pi;function pi(e,t,r){var n=ci.call(this,e,t,r)||this,i=(n.branches=[],n.elseTemplates=[],[]),s=0;return n.liquid.parser.parseStream(t).on("start",function(){return n.branches.push({value:new E(e.args,n.liquid),test:hr,templates:i=[]})}).on("tag:elsif",function(e){0 | any {\n return undefined\n }\n}\n","import { Drop } from '../drop/drop'\n\nexport const toString = Object.prototype.toString\nconst toLowerCase = String.prototype.toLowerCase\n\nexport const hasOwnProperty = Object.hasOwnProperty\n\nexport function isString (value: any): value is string {\n return typeof value === 'string'\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isFunction (value: any): value is Function {\n return typeof value === 'function'\n}\n\nexport function isPromise (val: any): val is Promise {\n return val && isFunction(val.then)\n}\n\nexport function isIterator (val: any): val is IterableIterator {\n return val && isFunction(val.next) && isFunction(val.throw) && isFunction(val.return)\n}\n\nexport function escapeRegex (str: string) {\n return str.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n}\n\nexport function promisify (fn: (arg1: T1, cb: (err: Error | null, result: T2) => void) => void): (arg1: T1) => Promise;\nexport function promisify (fn: (arg1: T1, arg2: T2, cb: (err: Error | null, result: T3) => void) => void): (arg1: T1, arg2: T2) => Promise;\nexport function promisify (fn: any) {\n return function (...args: any[]) {\n return new Promise((resolve, reject) => {\n fn(...args, (err: Error, result: any) => {\n err ? reject(err) : resolve(result)\n })\n })\n }\n}\n\nexport function stringify (value: any): string {\n value = toValue(value)\n if (isString(value)) return value\n if (isNil(value)) return ''\n if (isArray(value)) return value.map(x => stringify(x)).join('')\n return String(value)\n}\n\nexport function toEnumerable (val: any): T[] {\n val = toValue(val)\n if (isArray(val)) return val\n if (isString(val) && val.length > 0) return [val] as unknown as T[]\n if (isIterable(val)) return Array.from(val)\n if (isObject(val)) return Object.keys(val).map((key) => [key, val[key]]) as unknown as T[]\n return []\n}\n\nexport function toArray (val: any) {\n val = toValue(val)\n if (isNil(val)) return []\n if (isArray(val)) return val\n return [ val ]\n}\n\nexport function toValue (value: any): any {\n return (value instanceof Drop && isFunction(value.valueOf)) ? value.valueOf() : value\n}\n\nexport function isNumber (value: any): value is number {\n return typeof value === 'number'\n}\n\nexport function toLiquid (value: any): any {\n if (value && isFunction(value.toLiquid)) return toLiquid(value.toLiquid())\n return value\n}\n\nexport function isNil (value: any): boolean {\n return value == null\n}\n\nexport function isUndefined (value: any): boolean {\n return value === undefined\n}\n\nexport function isArray (value: any): value is any[] {\n // be compatible with IE 8\n return toString.call(value) === '[object Array]'\n}\n\nexport function isIterable (value: any): value is Iterable {\n return isObject(value) && Symbol.iterator in value\n}\n\n/*\n * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property.\n * The iteratee is invoked with three arguments: (value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning false.\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @return {Object} Returns object.\n */\nexport function forOwn (\n obj: Record | undefined,\n iteratee: ((val: T, key: string, obj: {[key: string]: T}) => boolean | void)\n) {\n obj = obj || {}\n for (const k in obj) {\n if (hasOwnProperty.call(obj, k)) {\n if (iteratee(obj[k], k, obj) === false) break\n }\n }\n return obj\n}\n\nexport function last (arr: T[]): T;\nexport function last (arr: string): string;\nexport function last (arr: any[] | string): any | string {\n return arr[arr.length - 1]\n}\n\n/*\n * Checks if value is the language type of Object.\n * (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))\n * @param {any} value The value to check.\n * @return {Boolean} Returns true if value is an object, else false.\n */\nexport function isObject (value: any): value is object {\n const type = typeof value\n return value !== null && (type === 'object' || type === 'function')\n}\n\nexport function range (start: number, stop: number, step = 1) {\n const arr: number[] = []\n for (let i = start; i < stop; i += step) {\n arr.push(i)\n }\n return arr\n}\n\nexport function padStart (str: any, length: number, ch = ' ') {\n return pad(str, length, ch, (str, ch) => ch + str)\n}\n\nexport function padEnd (str: any, length: number, ch = ' ') {\n return pad(str, length, ch, (str, ch) => str + ch)\n}\n\nexport function pad (str: any, length: number, ch: string, add: (str: string, ch: string) => string) {\n str = String(str)\n let n = length - str.length\n while (n-- > 0) str = add(str, ch)\n return str\n}\n\nexport function identify (val: T): T {\n return val\n}\n\nexport function changeCase (str: string): string {\n const hasLowerCase = [...str].some(ch => ch >= 'a' && ch <= 'z')\n return hasLowerCase ? str.toUpperCase() : str.toLowerCase()\n}\n\nexport function ellipsis (str: string, N: number): string {\n return str.length > N ? str.slice(0, N - 3) + '...' : str\n}\n\n// compare string in case-insensitive way, undefined values to the tail\nexport function caseInsensitiveCompare (a: any, b: any) {\n if (a == null && b == null) return 0\n if (a == null) return 1\n if (b == null) return -1\n a = toLowerCase.call(a)\n b = toLowerCase.call(b)\n if (a < b) return -1\n if (a > b) return 1\n return 0\n}\n\nexport function argumentsToValue any> (fn: F) {\n return (...args: Parameters) => fn(...args.map(toValue))\n}\n\nexport function escapeRegExp (text: string) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","import * as _ from './underscore'\nimport { Token } from '../tokens/token'\nimport { Template } from '../template/template'\n\n/**\n * targeting ES5, extends Error won't create a proper prototype chain, need a trait to keep track of classes\n */\nconst TRAIT = '__liquidClass__'\n\nexport abstract class LiquidError extends Error {\n public token!: Token\n public context = ''\n private originalError?: Error\n public constructor (err: Error | string, token: Token) {\n /**\n * note: for ES5 targeting, `this` will be replaced by return value of Error(),\n * thus everything on `this` will be lost, avoid calling `LiquidError` methods here\n */\n super(typeof err === 'string' ? err : err.message)\n if (typeof err !== 'string') Object.defineProperty(this, 'originalError', { value: err, enumerable: false })\n Object.defineProperty(this, 'token', { value: token, enumerable: false })\n Object.defineProperty(this, TRAIT, { value: 'LiquidError', enumerable: false })\n }\n protected update () {\n Object.defineProperty(this, 'context', { value: mkContext(this.token), enumerable: false })\n this.message = mkMessage(this.message, this.token)\n this.stack = this.message + '\\n' + this.context +\n '\\n' + this.stack\n if (this.originalError) this.stack += '\\nFrom ' + this.originalError.stack\n }\n static is (obj: unknown): obj is LiquidError {\n return obj?.[TRAIT] === 'LiquidError'\n }\n}\n\nexport class TokenizationError extends LiquidError {\n public constructor (message: string, token: Token) {\n super(message, token)\n this.name = 'TokenizationError'\n super.update()\n }\n}\n\nexport class ParseError extends LiquidError {\n public constructor (err: Error, token: Token) {\n super(err, token)\n this.name = 'ParseError'\n this.message = err.message\n super.update()\n }\n}\n\nexport class RenderError extends LiquidError {\n public constructor (err: Error, tpl: Template) {\n super(err, tpl.token)\n this.name = 'RenderError'\n this.message = err.message\n super.update()\n }\n public static is (obj: any): obj is RenderError {\n return obj.name === 'RenderError'\n }\n}\n\nexport class LiquidErrors extends LiquidError {\n public constructor (public errors: RenderError[]) {\n super(errors[0], errors[0].token)\n this.name = 'LiquidErrors'\n const s = errors.length > 1 ? 's' : ''\n this.message = `${errors.length} error${s} found`\n super.update()\n }\n public static is (obj: any): obj is LiquidErrors {\n return obj.name === 'LiquidErrors'\n }\n}\n\nexport class UndefinedVariableError extends LiquidError {\n public constructor (err: Error, token: Token) {\n super(err, token)\n this.name = 'UndefinedVariableError'\n this.message = err.message\n super.update()\n }\n}\n\n// only used internally; raised where we don't have token information,\n// so it can't be an UndefinedVariableError.\nexport class InternalUndefinedVariableError extends Error {\n variableName: string\n\n public constructor (variableName: string) {\n super(`undefined variable: ${variableName}`)\n this.name = 'InternalUndefinedVariableError'\n this.variableName = variableName\n }\n}\n\nexport class AssertionError extends Error {\n public constructor (message: string) {\n super(message)\n this.name = 'AssertionError'\n this.message = message + ''\n }\n}\n\nfunction mkContext (token: Token) {\n const [line, col] = token.getPosition()\n const lines = token.input.split('\\n')\n const begin = Math.max(line - 2, 1)\n const end = Math.min(line + 3, lines.length)\n\n const context = _\n .range(begin, end + 1)\n .map(lineNumber => {\n const rowIndicator = (lineNumber === line) ? '>> ' : ' '\n const num = _.padStart(String(lineNumber), String(end).length)\n let text = `${rowIndicator}${num}| `\n\n const colIndicator = lineNumber === line\n ? '\\n' + _.padStart('^', col + text.length)\n : ''\n\n text += lines[lineNumber - 1]\n text += colIndicator\n return text\n })\n .join('\\n')\n\n return context\n}\n\nfunction mkMessage (msg: string, token: Token) {\n if (token.file) msg += `, file:${token.file}`\n const [line, col] = token.getPosition()\n msg += `, line:${line}, col:${col}`\n return msg\n}\n","// **DO NOT CHANGE THIS FILE**\n//\n// This file is generated by bin/character-gen.js\n// bitmask character types to boost performance\nexport const TYPES = [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 4, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 8, 0, 0, 0, 0, 8, 0, 0, 0, 64, 0, 65, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]\nexport const WORD = 1\nexport const OPERATOR = 2\nexport const BLANK = 4\nexport const QUOTE = 8\nexport const INLINE_BLANK = 16\nexport const NUMBER = 32\nexport const SIGN = 64\nexport const PUNCTUATION = 128\n\nexport function isWord (char: string): boolean {\n const code = char.charCodeAt(0)\n return code >= 128 ? !TYPES[code] : !!(TYPES[code] & WORD)\n}\nTYPES[160] = TYPES[5760] = TYPES[6158] = TYPES[8192] = TYPES[8193] = TYPES[8194] = TYPES[8195] = TYPES[8196] = TYPES[8197] = TYPES[8198] = TYPES[8199] = TYPES[8200] = TYPES[8201] = TYPES[8202] = TYPES[8232] = TYPES[8233] = TYPES[8239] = TYPES[8287] = TYPES[12288] = BLANK\nTYPES[8220] = TYPES[8221] = PUNCTUATION\n","import { AssertionError } from './error'\n\nexport function assert (predicate: T | null | undefined, message?: string | (() => string)) {\n if (!predicate) {\n const msg = typeof message === 'function'\n ? message()\n : (message || `expect ${predicate} to be true`)\n throw new AssertionError(msg)\n }\n}\n","import { Drop } from './drop'\nimport { Comparable } from './comparable'\nimport { isNil, toValue } from '../util'\n\nexport class NullDrop extends Drop implements Comparable {\n public equals (value: any) {\n return isNil(toValue(value))\n }\n public gt () {\n return false\n }\n public geq () {\n return false\n }\n public lt () {\n return false\n }\n public leq () {\n return false\n }\n public valueOf () {\n return null\n }\n}\n","import { Drop } from './drop'\nimport { Comparable } from './comparable'\nimport { isObject, isString, isArray, toValue } from '../util'\n\nexport class EmptyDrop extends Drop implements Comparable {\n public equals (value: any) {\n if (value instanceof EmptyDrop) return false\n value = toValue(value)\n if (isString(value) || isArray(value)) return value.length === 0\n if (isObject(value)) return Object.keys(value).length === 0\n return false\n }\n public gt () {\n return false\n }\n public geq () {\n return false\n }\n public lt () {\n return false\n }\n public leq () {\n return false\n }\n public valueOf () {\n return ''\n }\n}\n","import { isNil, isString, toValue } from '../util'\nimport { EmptyDrop } from '../drop'\n\nexport class BlankDrop extends EmptyDrop {\n public equals (value: any) {\n if (value === false) return true\n if (isNil(toValue(value))) return true\n if (isString(value)) return /^\\s*$/.test(value)\n return super.equals(value)\n }\n}\n","import { Drop } from './drop'\n\nexport class ForloopDrop extends Drop {\n protected i = 0\n public name: string\n public length: number\n public constructor (length: number, collection: string, variable: string) {\n super()\n this.length = length\n this.name = `${variable}-${collection}`\n }\n public next () {\n this.i++\n }\n public index0 () {\n return this.i\n }\n public index () {\n return this.i + 1\n }\n public first () {\n return this.i === 0\n }\n public last () {\n return this.i === this.length - 1\n }\n public rindex () {\n return this.length - this.i\n }\n public rindex0 () {\n return this.length - this.i - 1\n }\n public valueOf () {\n return JSON.stringify(this)\n }\n}\n","import { Drop } from './drop'\n\nexport class BlockDrop extends Drop {\n constructor (\n // the block render from layout template\n private superBlockRender: () => Iterable = () => ''\n ) {\n super()\n }\n /**\n * Provide parent access in child block by\n * {{ block.super }}\n */\n public super () {\n return this.superBlockRender()\n }\n}\n","import { isFunction } from '../util'\n\nexport interface Comparable {\n equals: (rhs: any) => boolean;\n gt: (rhs: any) => boolean;\n geq: (rhs: any) => boolean;\n lt: (rhs: any) => boolean;\n leq: (rhs: any) => boolean;\n}\n\nexport function isComparable (arg: any): arg is Comparable {\n return (\n arg &&\n isFunction(arg.equals) &&\n isFunction(arg.gt) &&\n isFunction(arg.geq) &&\n isFunction(arg.lt) &&\n isFunction(arg.leq)\n )\n}\n","import { BlankDrop, EmptyDrop, NullDrop } from '../drop'\n\nconst nil = new NullDrop()\nexport const literalValues = {\n 'true': true,\n 'false': false,\n 'nil': nil,\n 'null': nil,\n 'empty': new EmptyDrop(),\n 'blank': new BlankDrop()\n}\n\nexport type LiteralKey = keyof typeof literalValues\nexport type LiteralValue = typeof literalValues[LiteralKey]\n","import { isWord } from '../util/character'\n\ninterface TrieInput {\n [key: string]: T\n}\n\ninterface TrieLeafNode {\n data: T;\n end: true;\n needBoundary?: true;\n}\n\nexport interface Trie {\n [key: string]: Trie | TrieLeafNode;\n}\n\nexport type TrieNode = Trie | TrieLeafNode\n\nexport function createTrie (input: TrieInput): Trie {\n const trie: Trie = {}\n for (const [name, data] of Object.entries(input)) {\n let node: Trie | TrieLeafNode = trie\n\n for (let i = 0; i < name.length; i++) {\n const c = name[i]\n node[c] = node[c] || {}\n\n if (i === name.length - 1 && isWord(name[i])) {\n node[c].needBoundary = true\n }\n\n node = node[c]\n }\n\n node.data = data\n node.end = true\n }\n return trie\n}\n","import { isPromise, isIterator } from './underscore'\n\n// convert an async iterator to a Promise\nexport async function toPromise (val: Generator | Promise | T): Promise {\n if (!isIterator(val)) return val\n let value: unknown\n let done = false\n let next = 'next'\n do {\n const state = val[next](value)\n done = state.done\n value = state.value\n next = 'next'\n try {\n if (isIterator(value)) value = toPromise(value)\n if (isPromise(value)) value = await value\n } catch (err) {\n next = 'throw'\n value = err\n }\n } while (!done)\n return value as T\n}\n\n// convert an async iterator to a value in a synchronous manner\nexport function toValueSync (val: Generator | T): T {\n if (!isIterator(val)) return val\n let value: any\n let done = false\n let next = 'next'\n do {\n const state = val[next](value)\n done = state.done\n value = state.value\n next = 'next'\n if (isIterator(value)) {\n try {\n value = toValueSync(value)\n } catch (err) {\n next = 'throw'\n value = err\n }\n }\n } while (!done)\n return value\n}\n","import { changeCase, padStart, padEnd } from './underscore'\nimport { LiquidDate } from './liquid-date'\n\nconst rFormat = /%([-_0^#:]+)?(\\d+)?([EO])?(.)/\nconst monthNames = [\n 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',\n 'September', 'October', 'November', 'December'\n]\nconst dayNames = [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\n]\nconst monthNamesShort = monthNames.map(abbr)\nconst dayNamesShort = dayNames.map(abbr)\ninterface FormatOptions {\n flags: object;\n width?: string;\n modifier?: string;\n}\n\nfunction abbr (str: string) {\n return str.slice(0, 3)\n}\n\n// prototype extensions\nfunction daysInMonth (d: LiquidDate) {\n const feb = isLeapYear(d) ? 29 : 28\n return [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n}\nfunction getDayOfYear (d: LiquidDate) {\n let num = 0\n for (let i = 0; i < d.getMonth(); ++i) {\n num += daysInMonth(d)[i]\n }\n return num + d.getDate()\n}\nfunction getWeekOfYear (d: LiquidDate, startDay: number) {\n // Skip to startDay of this week\n const now = getDayOfYear(d) + (startDay - d.getDay())\n // Find the first startDay of the year\n const jan1 = new Date(d.getFullYear(), 0, 1)\n const then = (7 - jan1.getDay() + startDay)\n return String(Math.floor((now - then) / 7) + 1)\n}\nfunction isLeapYear (d: LiquidDate) {\n const year = d.getFullYear()\n return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year)))\n}\nfunction ordinal (d: LiquidDate) {\n const date = d.getDate()\n if ([11, 12, 13].includes(date)) return 'th'\n\n switch (date % 10) {\n case 1: return 'st'\n case 2: return 'nd'\n case 3: return 'rd'\n default: return 'th'\n }\n}\nfunction century (d: LiquidDate) {\n return parseInt(d.getFullYear().toString().substring(0, 2), 10)\n}\n\n// default to 0\nconst padWidths = {\n d: 2,\n e: 2,\n H: 2,\n I: 2,\n j: 3,\n k: 2,\n l: 2,\n L: 3,\n m: 2,\n M: 2,\n S: 2,\n U: 2,\n W: 2\n}\n\n// default to '0'\nconst padChars = {\n a: ' ',\n A: ' ',\n b: ' ',\n B: ' ',\n c: ' ',\n e: ' ',\n k: ' ',\n l: ' ',\n p: ' ',\n P: ' '\n}\nfunction getTimezoneOffset (d: LiquidDate, opts: FormatOptions) {\n const nOffset = Math.abs(d.getTimezoneOffset())\n const h = Math.floor(nOffset / 60)\n const m = nOffset % 60\n return (d.getTimezoneOffset() > 0 ? '-' : '+') +\n padStart(h, 2, '0') +\n (opts.flags[':'] ? ':' : '') +\n padStart(m, 2, '0')\n}\nconst formatCodes = {\n a: (d: LiquidDate) => dayNamesShort[d.getDay()],\n A: (d: LiquidDate) => dayNames[d.getDay()],\n b: (d: LiquidDate) => monthNamesShort[d.getMonth()],\n B: (d: LiquidDate) => monthNames[d.getMonth()],\n c: (d: LiquidDate) => d.toLocaleString(),\n C: (d: LiquidDate) => century(d),\n d: (d: LiquidDate) => d.getDate(),\n e: (d: LiquidDate) => d.getDate(),\n H: (d: LiquidDate) => d.getHours(),\n I: (d: LiquidDate) => String(d.getHours() % 12 || 12),\n j: (d: LiquidDate) => getDayOfYear(d),\n k: (d: LiquidDate) => d.getHours(),\n l: (d: LiquidDate) => String(d.getHours() % 12 || 12),\n L: (d: LiquidDate) => d.getMilliseconds(),\n m: (d: LiquidDate) => d.getMonth() + 1,\n M: (d: LiquidDate) => d.getMinutes(),\n N: (d: LiquidDate, opts: FormatOptions) => {\n const width = Number(opts.width) || 9\n const str = String(d.getMilliseconds()).slice(0, width)\n return padEnd(str, width, '0')\n },\n p: (d: LiquidDate) => (d.getHours() < 12 ? 'AM' : 'PM'),\n P: (d: LiquidDate) => (d.getHours() < 12 ? 'am' : 'pm'),\n q: (d: LiquidDate) => ordinal(d),\n s: (d: LiquidDate) => Math.round(d.getTime() / 1000),\n S: (d: LiquidDate) => d.getSeconds(),\n u: (d: LiquidDate) => d.getDay() || 7,\n U: (d: LiquidDate) => getWeekOfYear(d, 0),\n w: (d: LiquidDate) => d.getDay(),\n W: (d: LiquidDate) => getWeekOfYear(d, 1),\n x: (d: LiquidDate) => d.toLocaleDateString(),\n X: (d: LiquidDate) => d.toLocaleTimeString(),\n y: (d: LiquidDate) => d.getFullYear().toString().slice(2, 4),\n Y: (d: LiquidDate) => d.getFullYear(),\n z: getTimezoneOffset,\n Z: (d: LiquidDate, opts: FormatOptions) => {\n if (d.getTimezoneName) {\n return d.getTimezoneName() || getTimezoneOffset(d, opts)\n }\n return (typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : '')\n },\n 't': () => '\\t',\n 'n': () => '\\n',\n '%': () => '%'\n};\n(formatCodes as any).h = formatCodes.b\n\nexport function strftime (d: LiquidDate, formatStr: string) {\n let output = ''\n let remaining = formatStr\n let match\n while ((match = rFormat.exec(remaining))) {\n output += remaining.slice(0, match.index)\n remaining = remaining.slice(match.index + match[0].length)\n output += format(d, match)\n }\n return output + remaining\n}\n\nfunction format (d: LiquidDate, match: RegExpExecArray) {\n const [input, flagStr = '', width, modifier, conversion] = match\n const convert = formatCodes[conversion]\n if (!convert) return input\n const flags = {}\n for (const flag of flagStr) flags[flag] = true\n let ret = String(convert(d, { flags, width, modifier }))\n let padChar = padChars[conversion] || '0'\n let padWidth = width || padWidths[conversion] || 0\n if (flags['^']) ret = ret.toUpperCase()\n else if (flags['#']) ret = changeCase(ret)\n if (flags['_']) padChar = ' '\n else if (flags['0']) padChar = '0'\n if (flags['-']) padWidth = 0\n return padStart(ret, padWidth, padChar)\n}\n","import { LiquidDate } from './liquid-date'\nimport { isString } from './underscore'\n\n// one minute in milliseconds\nconst OneMinute = 60000\nconst ISO8601_TIMEZONE_PATTERN = /([zZ]|([+-])(\\d{2}):(\\d{2}))$/\n\n/**\n * A date implementation with timezone info, just like Ruby date\n *\n * Implementation:\n * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods\n * - rewrite getTimezoneOffset() to trick strftime\n */\nexport class TimezoneDate implements LiquidDate {\n private timezoneOffset: number\n private timezoneName: string\n private date: Date\n private displayDate: Date\n constructor (init: string | number | Date | TimezoneDate, timezone: number | string) {\n this.date = init instanceof TimezoneDate\n ? init.date\n : new Date(init)\n this.timezoneOffset = isString(timezone) ? TimezoneDate.getTimezoneOffset(timezone, this.date) : timezone\n this.timezoneName = isString(timezone) ? timezone : ''\n\n const diff = (this.date.getTimezoneOffset() - this.timezoneOffset) * OneMinute\n const time = this.date.getTime() + diff\n this.displayDate = new Date(time)\n }\n\n getTime () {\n return this.displayDate.getTime()\n }\n\n getMilliseconds () {\n return this.displayDate.getMilliseconds()\n }\n getSeconds () {\n return this.displayDate.getSeconds()\n }\n getMinutes () {\n return this.displayDate.getMinutes()\n }\n getHours () {\n return this.displayDate.getHours()\n }\n getDay () {\n return this.displayDate.getDay()\n }\n getDate () {\n return this.displayDate.getDate()\n }\n getMonth () {\n return this.displayDate.getMonth()\n }\n getFullYear () {\n return this.displayDate.getFullYear()\n }\n toLocaleString (locale?: string, init?: any) {\n if (init?.timeZone) {\n return this.date.toLocaleString(locale, init)\n }\n return this.displayDate.toLocaleString(locale, init)\n }\n toLocaleTimeString (locale?: string) {\n return this.displayDate.toLocaleTimeString(locale)\n }\n toLocaleDateString (locale?: string) {\n return this.displayDate.toLocaleDateString(locale)\n }\n getTimezoneOffset () {\n return this.timezoneOffset!\n }\n getTimezoneName () {\n return this.timezoneName\n }\n\n /**\n * Create a Date object fixed to it's declared Timezone. Both\n * - 2021-08-06T02:29:00.000Z and\n * - 2021-08-06T02:29:00.000+08:00\n * will always be displayed as\n * - 2021-08-06 02:29:00\n * regardless timezoneOffset in JavaScript realm\n *\n * The implementation hack:\n * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`,\n * we create a different Date to trick strftime, it's both simpler and more performant.\n * Given that a template is expected to be parsed fewer times than rendered.\n */\n static createDateFixedToTimezone (dateString: string): LiquidDate {\n const m = dateString.match(ISO8601_TIMEZONE_PATTERN)\n // representing a UTC timestamp\n if (m && m[1] === 'Z') {\n return new TimezoneDate(+new Date(dateString), 0)\n }\n // has a timezone specified\n if (m && m[2] && m[3] && m[4]) {\n const [, , sign, hours, minutes] = m\n const offset = (sign === '+' ? -1 : 1) * (parseInt(hours, 10) * 60 + parseInt(minutes, 10))\n return new TimezoneDate(+new Date(dateString), offset)\n }\n return new Date(dateString)\n }\n private static getTimezoneOffset (timezoneName: string, date = new Date()) {\n const localDateString = date.toLocaleString('en-US', { timeZone: timezoneName })\n const utcDateString = date.toLocaleString('en-US', { timeZone: 'UTC' })\n\n const localDate = new Date(localDateString)\n const utcDate = new Date(utcDateString)\n return (+utcDate - +localDate) / (60 * 1000)\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\nimport { TYPES, BLANK } from '../util'\n\nexport abstract class DelimitedToken extends Token {\n public trimLeft = false\n public trimRight = false\n public contentRange: [number, number]\n public constructor (\n kind: TokenKind,\n [contentBegin, contentEnd]: [number, number],\n input: string,\n begin: number,\n end: number,\n trimLeft: boolean,\n trimRight: boolean,\n file?: string\n ) {\n super(kind, input, begin, end, file)\n const tl = input[contentBegin] === '-'\n const tr = input[contentEnd - 1] === '-'\n\n let l = tl ? contentBegin + 1 : contentBegin\n let r = tr ? contentEnd - 1 : contentEnd\n while (l < r && (TYPES[input.charCodeAt(l)] & BLANK)) l++\n while (r > l && (TYPES[input.charCodeAt(r - 1)] & BLANK)) r--\n\n this.contentRange = [l, r]\n this.trimLeft = tl || trimLeft\n this.trimRight = tr || trimRight\n }\n get content () {\n return this.input.slice(this.contentRange[0], this.contentRange[1])\n }\n}\n","import { DelimitedToken } from './delimited-token'\nimport { Tokenizer, TokenKind } from '../parser'\nimport type { NormalizedFullOptions } from '../liquid-options'\n\nexport class TagToken extends DelimitedToken {\n public name: string\n public tokenizer: Tokenizer\n public constructor (\n input: string,\n begin: number,\n end: number,\n options: NormalizedFullOptions,\n file?: string\n ) {\n const { trimTagLeft, trimTagRight, tagDelimiterLeft, tagDelimiterRight } = options\n const [valueBegin, valueEnd] = [begin + tagDelimiterLeft.length, end - tagDelimiterRight.length]\n super(TokenKind.Tag, [valueBegin, valueEnd], input, begin, end, trimTagLeft, trimTagRight, file)\n\n this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange)\n this.name = this.tokenizer.readTagName()\n this.tokenizer.assert(this.name, `illegal tag syntax, tag name expected`)\n this.tokenizer.skipBlank()\n }\n get args (): string {\n return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1])\n }\n}\n","import { DelimitedToken } from './delimited-token'\nimport { NormalizedFullOptions } from '../liquid-options'\nimport { TokenKind } from '../parser'\n\nexport class OutputToken extends DelimitedToken {\n public constructor (\n input: string,\n begin: number,\n end: number,\n options: NormalizedFullOptions,\n file?: string\n ) {\n const { trimOutputLeft, trimOutputRight, outputDelimiterLeft, outputDelimiterRight } = options\n const valueRange: [number, number] = [begin + outputDelimiterLeft.length, end - outputDelimiterRight.length]\n super(TokenKind.Output, valueRange, input, begin, end, trimOutputLeft, trimOutputRight, file)\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\n\nexport class HTMLToken extends Token {\n trimLeft = 0\n trimRight = 0\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.HTML, input, begin, end, file)\n }\n public getContent () {\n return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight)\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\n\nexport class NumberToken extends Token {\n public content: number\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Number, input, begin, end, file)\n this.content = Number(this.getText())\n }\n}\n","import { Token } from './token'\nimport { NUMBER, TYPES, SIGN } from '../util'\nimport { TokenKind } from '../parser'\n\nexport class IdentifierToken extends Token {\n public content: string\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Word, input, begin, end, file)\n this.content = this.getText()\n }\n isNumber (allowSign = false) {\n const begin = allowSign && TYPES[this.input.charCodeAt(this.begin)] & SIGN\n ? this.begin + 1\n : this.begin\n for (let i = begin; i < this.end; i++) {\n if (!(TYPES[this.input.charCodeAt(i)] & NUMBER)) return false\n }\n return true\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\nimport { literalValues, LiteralValue } from '../util'\n\nexport class LiteralToken extends Token {\n public content: LiteralValue\n public literal: string\n public constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Literal, input, begin, end, file)\n this.literal = this.getText()\n this.content = literalValues[this.literal]\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\n\nexport const enum OperatorType {\n Binary,\n Unary\n}\n\nexport const operatorPrecedences = {\n '==': 2,\n '!=': 2,\n '>': 2,\n '<': 2,\n '>=': 2,\n '<=': 2,\n 'contains': 2,\n 'not': 1,\n 'and': 0,\n 'or': 0\n}\n\nexport const operatorTypes = {\n '==': OperatorType.Binary,\n '!=': OperatorType.Binary,\n '>': OperatorType.Binary,\n '<': OperatorType.Binary,\n '>=': OperatorType.Binary,\n '<=': OperatorType.Binary,\n 'contains': OperatorType.Binary,\n 'not': OperatorType.Unary,\n 'and': OperatorType.Binary,\n 'or': OperatorType.Binary\n}\n\nexport class OperatorToken extends Token {\n public operator: string\n public constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Operator, input, begin, end, file)\n this.operator = this.getText()\n }\n getPrecedence () {\n const key = this.getText()\n return key in operatorPrecedences ? operatorPrecedences[key] : 1\n }\n}\n","import { Token } from './token'\nimport { LiteralToken } from './literal-token'\nimport { ValueToken } from './value-token'\nimport { IdentifierToken } from './identifier-token'\nimport { NumberToken } from './number-token'\nimport { RangeToken } from './range-token'\nimport { QuotedToken } from './quoted-token'\nimport { TokenKind } from '../parser'\n\nexport class PropertyAccessToken extends Token {\n constructor (\n public variable: QuotedToken | RangeToken | LiteralToken | NumberToken | undefined,\n public props: (ValueToken | IdentifierToken)[],\n input: string,\n begin: number,\n end: number,\n file?: string\n ) {\n super(TokenKind.PropertyAccess, input, begin, end, file)\n }\n}\n","import { Token } from './token'\nimport { FilterArg } from '../parser/filter-arg'\nimport { TokenKind } from '../parser'\n\nexport class FilterToken extends Token {\n public constructor (\n public name: string,\n public args: FilterArg[],\n input: string,\n begin: number,\n end: number,\n file?: string\n ) {\n super(TokenKind.Filter, input, begin, end, file)\n }\n}\n","import { Token } from './token'\nimport { ValueToken } from './value-token'\nimport { IdentifierToken } from './identifier-token'\nimport { TokenKind } from '../parser'\n\nexport class HashToken extends Token {\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public name: IdentifierToken,\n public value?: ValueToken,\n public file?: string\n ) {\n super(TokenKind.Hash, input, begin, end, file)\n }\n}\n","const rHex = /[\\da-fA-F]/\nconst rOct = /[0-7]/\nconst escapeChar = {\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t',\n v: '\\x0B'\n}\n\nfunction hexVal (c: string) {\n const code = c.charCodeAt(0)\n if (code >= 97) return code - 87\n if (code >= 65) return code - 55\n return code - 48\n}\n\nexport function parseStringLiteral (str: string): string {\n let ret = ''\n for (let i = 1; i < str.length - 1; i++) {\n if (str[i] !== '\\\\') {\n ret += str[i]\n continue\n }\n if (escapeChar[str[i + 1]] !== undefined) {\n ret += escapeChar[str[++i]]\n } else if (str[i + 1] === 'u') {\n let val = 0\n let j = i + 2\n while (j <= i + 5 && rHex.test(str[j])) {\n val = val * 16 + hexVal(str[j++])\n }\n i = j - 1\n ret += String.fromCharCode(val)\n } else if (!rOct.test(str[i + 1])) {\n ret += str[++i]\n } else {\n let j = i + 1\n let val = 0\n while (j <= i + 3 && rOct.test(str[j])) {\n val = val * 8 + hexVal(str[j++])\n }\n i = j - 1\n ret += String.fromCharCode(val)\n }\n }\n return ret\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\nimport { parseStringLiteral } from '../render/string'\n\nexport class QuotedToken extends Token {\n public readonly content: string\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Quoted, input, begin, end, file)\n this.content = parseStringLiteral(this.getText())\n }\n}\n","import { Token } from './token'\nimport { ValueToken } from './value-token'\nimport { TokenKind } from '../parser'\n\nexport class RangeToken extends Token {\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public lhs: ValueToken,\n public rhs: ValueToken,\n public file?: string\n ) {\n super(TokenKind.Range, input, begin, end, file)\n }\n}\n","import { DelimitedToken } from './delimited-token'\nimport { NormalizedFullOptions } from '../liquid-options'\nimport { Tokenizer, TokenKind } from '../parser'\n\n/**\n * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}`\n */\nexport class LiquidTagToken extends DelimitedToken {\n public name: string\n public args: string\n public tokenizer: Tokenizer\n public constructor (\n input: string,\n begin: number,\n end: number,\n options: NormalizedFullOptions,\n file?: string\n ) {\n super(TokenKind.Tag, [begin, end], input, begin, end, false, false, file)\n\n this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange)\n this.name = this.tokenizer.readTagName()\n this.tokenizer.assert(this.name, 'illegal liquid tag syntax')\n\n this.tokenizer.skipBlank()\n this.args = this.tokenizer.remaining()\n }\n}\n","import { Token } from './token'\nimport { FilterToken } from './filter-token'\nimport { TokenKind } from '../parser'\nimport { Expression } from '../render'\n\n/**\n * value expression with optional filters\n * e.g.\n * {% assign foo=\"bar\" | append: \"coo\" %}\n */\nexport class FilteredValueToken extends Token {\n constructor (\n public initial: Expression,\n public filters: FilterToken[],\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.FilteredValue, input, begin, end, file)\n }\n}\n","import { stringify } from '../util'\nimport { Emitter } from './emitter'\n\nexport class SimpleEmitter implements Emitter {\n public buffer = '';\n\n public write (html: any) {\n this.buffer += stringify(html)\n }\n}\n","import { Emitter } from '../emitters'\n\nexport class StreamedEmitter implements Emitter {\n public buffer = '';\n public stream: NodeJS.ReadableStream = null as any\n constructor () {\n throw new Error('streaming not supported in browser')\n }\n public write: (html: any) => void\n public error: (err: Error) => void\n public end: () => void\n}\n","import { stringify, toValue } from '../util'\nimport { Emitter } from './emitter'\n\nexport class KeepingTypeEmitter implements Emitter {\n public buffer: any = '';\n\n public write (html: any) {\n html = toValue(html)\n // This will only preserve the type if the value is isolated.\n // I.E:\n // {{ my-port }} -> 42\n // {{ my-host }}:{{ my-port }} -> 'host:42'\n if (typeof html !== 'string' && this.buffer === '') {\n this.buffer = html\n } else {\n this.buffer = stringify(this.buffer) + stringify(html)\n }\n }\n}\n","import { toPromise, RenderError, LiquidErrors, LiquidError } from '../util'\nimport { Context } from '../context'\nimport { Template } from '../template'\nimport { Emitter, KeepingTypeEmitter, StreamedEmitter, SimpleEmitter } from '../emitters'\n\nexport class Render {\n public renderTemplatesToNodeStream (templates: Template[], ctx: Context): NodeJS.ReadableStream {\n const emitter = new StreamedEmitter()\n Promise.resolve().then(() => toPromise(this.renderTemplates(templates, ctx, emitter)))\n .then(() => emitter.end(), err => emitter.error(err))\n return emitter.stream\n }\n public * renderTemplates (templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator {\n if (!emitter) {\n emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter()\n }\n const errors = []\n for (const tpl of templates) {\n try {\n // if tpl.render supports emitter, it'll return empty `html`\n const html = yield tpl.render(ctx, emitter)\n // if not, it'll return an `html`, write to the emitter for it\n html && emitter.write(html)\n if (emitter['break'] || emitter['continue']) break\n } catch (e) {\n const err = LiquidError.is(e) ? e : new RenderError(e as Error, tpl)\n if (ctx.opts.catchAllErrors) errors.push(err)\n else throw err\n }\n }\n if (errors.length) {\n throw new LiquidErrors(errors)\n }\n return emitter.buffer\n }\n}\n","import { QuotedToken, RangeToken, OperatorToken, Token, PropertyAccessToken, OperatorType, operatorTypes } from '../tokens'\nimport { isRangeToken, isPropertyAccessToken, UndefinedVariableError, range, isOperatorToken, assert } from '../util'\nimport type { Context } from '../context'\nimport type { UnaryOperatorHandler } from '../render'\n\nexport class Expression {\n private postfix: Token[]\n\n public constructor (tokens: IterableIterator) {\n this.postfix = [...toPostfix(tokens)]\n }\n public * evaluate (ctx: Context, lenient?: boolean): Generator {\n assert(ctx, 'unable to evaluate: context not defined')\n const operands: any[] = []\n for (const token of this.postfix) {\n if (isOperatorToken(token)) {\n const r = operands.pop()\n let result\n if (operatorTypes[token.operator] === OperatorType.Unary) {\n result = yield (ctx.opts.operators[token.operator] as UnaryOperatorHandler)(r, ctx)\n } else {\n const l = operands.pop()\n result = yield ctx.opts.operators[token.operator](l, r, ctx)\n }\n operands.push(result)\n } else {\n operands.push(yield evalToken(token, ctx, lenient))\n }\n }\n return operands[0]\n }\n public valid () {\n return !!this.postfix.length\n }\n}\n\nexport function * evalToken (token: Token | undefined, ctx: Context, lenient = false): IterableIterator {\n if (!token) return\n if ('content' in token) return token.content\n if (isPropertyAccessToken(token)) return yield evalPropertyAccessToken(token, ctx, lenient)\n if (isRangeToken(token)) return yield evalRangeToken(token, ctx)\n}\n\nfunction * evalPropertyAccessToken (token: PropertyAccessToken, ctx: Context, lenient: boolean): IterableIterator {\n const props: string[] = []\n for (const prop of token.props) {\n props.push((yield evalToken(prop, ctx, false)) as unknown as string)\n }\n try {\n if (token.variable) {\n const variable = yield evalToken(token.variable, ctx, lenient)\n return yield ctx._getFromScope(variable, props)\n } else {\n return yield ctx._get(props)\n }\n } catch (e) {\n if (lenient && (e as Error).name === 'InternalUndefinedVariableError') return null\n throw (new UndefinedVariableError(e as Error, token))\n }\n}\n\nexport function evalQuotedToken (token: QuotedToken) {\n return token.content\n}\n\nfunction * evalRangeToken (token: RangeToken, ctx: Context) {\n const low: number = yield evalToken(token.lhs, ctx)\n const high: number = yield evalToken(token.rhs, ctx)\n return range(+low, +high + 1)\n}\n\nfunction * toPostfix (tokens: IterableIterator): IterableIterator {\n const ops: OperatorToken[] = []\n for (const token of tokens) {\n if (isOperatorToken(token)) {\n while (ops.length && ops[ops.length - 1].getPrecedence() > token.getPrecedence()) {\n yield ops.pop()!\n }\n ops.push(token)\n } else yield token\n }\n while (ops.length) {\n yield ops.pop()!\n }\n}\n","import { Context } from '../context/context'\nimport { toValue } from '../util'\n\nexport function isTruthy (val: any, ctx: Context): boolean {\n return !isFalsy(val, ctx)\n}\n\nexport function isFalsy (val: any, ctx: Context): boolean {\n val = toValue(val)\n\n if (ctx.opts.jsTruthy) {\n return !val\n } else {\n return val === false || undefined === val || val === null\n }\n}\n","import { isComparable } from '../drop/comparable'\nimport { Context } from '../context'\nimport { toValue } from '../util'\nimport { isFalsy, isTruthy } from '../render/boolean'\nimport { isArray, isFunction } from '../util/underscore'\n\nexport type UnaryOperatorHandler = (operand: any, ctx: Context) => boolean;\nexport type BinaryOperatorHandler = (lhs: any, rhs: any, ctx: Context) => boolean;\nexport type OperatorHandler = UnaryOperatorHandler | BinaryOperatorHandler;\nexport type Operators = Record\n\nexport const defaultOperators: Operators = {\n '==': equals,\n '!=': (l: any, r: any) => !equals(l, r),\n '>': (l: any, r: any) => {\n if (isComparable(l)) return l.gt(r)\n if (isComparable(r)) return r.lt(l)\n return toValue(l) > toValue(r)\n },\n '<': (l: any, r: any) => {\n if (isComparable(l)) return l.lt(r)\n if (isComparable(r)) return r.gt(l)\n return toValue(l) < toValue(r)\n },\n '>=': (l: any, r: any) => {\n if (isComparable(l)) return l.geq(r)\n if (isComparable(r)) return r.leq(l)\n return toValue(l) >= toValue(r)\n },\n '<=': (l: any, r: any) => {\n if (isComparable(l)) return l.leq(r)\n if (isComparable(r)) return r.geq(l)\n return toValue(l) <= toValue(r)\n },\n 'contains': (l: any, r: any) => {\n l = toValue(l)\n if (isArray(l)) return l.some((i) => equals(i, r))\n if (isFunction(l?.indexOf)) return l.indexOf(toValue(r)) > -1\n return false\n },\n 'not': (v: any, ctx: Context) => isFalsy(toValue(v), ctx),\n 'and': (l: any, r: any, ctx: Context) => isTruthy(toValue(l), ctx) && isTruthy(toValue(r), ctx),\n 'or': (l: any, r: any, ctx: Context) => isTruthy(toValue(l), ctx) || isTruthy(toValue(r), ctx)\n}\n\nexport function equals (lhs: any, rhs: any): boolean {\n if (isComparable(lhs)) return lhs.equals(rhs)\n if (isComparable(rhs)) return rhs.equals(lhs)\n lhs = toValue(lhs)\n rhs = toValue(rhs)\n if (isArray(lhs)) {\n return isArray(rhs) && arrayEquals(lhs, rhs)\n }\n return lhs === rhs\n}\n\nfunction arrayEquals (lhs: any[], rhs: any[]): boolean {\n if (lhs.length !== rhs.length) return false\n return !lhs.some((value, i) => !equals(value, rhs[i]))\n}\n","import { Cache } from './cache'\n\nclass Node {\n constructor (\n public key: string,\n public value: T,\n public next: Node,\n public prev: Node\n ) {}\n}\n\nexport class LRU implements Cache {\n private cache: Record> = {}\n private head: Node\n private tail: Node\n\n constructor (\n public limit: number,\n public size = 0\n ) {\n this.head = new Node('HEAD', null as any, null as any, null as any)\n this.tail = new Node('TAIL', null as any, null as any, null as any)\n this.head.next = this.tail\n this.tail.prev = this.head\n }\n\n write (key: string, value: T) {\n if (this.cache[key]) {\n this.cache[key].value = value\n } else {\n const node = new Node(key, value, this.head.next, this.head)\n this.head.next.prev = node\n this.head.next = node\n\n this.cache[key] = node\n this.size++\n this.ensureLimit()\n }\n }\n\n read (key: string): T | undefined {\n if (!this.cache[key]) return\n const { value } = this.cache[key]\n this.remove(key)\n this.write(key, value)\n return value\n }\n\n remove (key: string) {\n const node = this.cache[key]\n node.prev.next = node.next\n node.next.prev = node.prev\n delete this.cache[key]\n this.size--\n }\n\n clear () {\n this.head.next = this.tail\n this.tail.prev = this.head\n this.size = 0\n this.cache = {}\n }\n\n private ensureLimit () {\n if (this.size > this.limit) this.remove(this.tail.prev.key)\n }\n}\n","import { last } from '../util'\n\nfunction domResolve (root: string, path: string) {\n const base = document.createElement('base')\n base.href = root\n\n const head = document.getElementsByTagName('head')[0]\n head.insertBefore(base, head.firstChild)\n\n const a = document.createElement('a')\n a.href = path\n const resolved = a.href\n head.removeChild(base)\n\n return resolved\n}\n\nexport function resolve (root: string, filepath: string, ext: string) {\n if (root.length && last(root) !== '/') root += '/'\n const url = domResolve(root, filepath)\n return url.replace(/^(\\w+:\\/\\/[^/]+)(\\/[^?]+)/, (str, origin, path) => {\n const last = path.split('/').pop()\n if (/\\.\\w+$/.test(last)) return str\n return origin + path + ext\n })\n}\n\nexport async function readFile (url: string): Promise {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.responseText as string)\n } else {\n reject(new Error(xhr.statusText))\n }\n }\n xhr.onerror = () => {\n reject(new Error('An error occurred whilst receiving the response.'))\n }\n xhr.open('GET', url)\n xhr.send()\n })\n}\n\nexport function readFileSync (url: string): string {\n const xhr = new XMLHttpRequest()\n xhr.open('GET', url, false)\n xhr.send()\n if (xhr.status < 200 || xhr.status >= 300) {\n throw new Error(xhr.statusText)\n }\n return xhr.responseText as string\n}\n\nexport async function exists (filepath: string) {\n return true\n}\n\nexport function existsSync (filepath: string) {\n return true\n}\n\nexport function dirname (filepath: string) {\n return domResolve(filepath, '.')\n}\n\nexport const sep = '/'\n","import { isFalsy } from '../render/boolean'\nimport { identify, isArray, isString, toValue } from '../util/underscore'\nimport { FilterImpl } from '../template'\n\nfunction defaultFilter (this: FilterImpl, value: T1, defaultValue: T2, ...args: Array<[string, any]>): T1 | T2 {\n value = toValue(value)\n if (isArray(value) || isString(value)) return value.length ? value : defaultValue\n if (value === false && (new Map(args)).get('allow_false')) return false as T1\n return isFalsy(value, this.context) ? defaultValue : value\n}\n\nfunction json (value: any, space = 0) {\n return JSON.stringify(value, null, space)\n}\n\nfunction inspect (value: any, space = 0) {\n const ancestors: object[] = []\n return JSON.stringify(value, function (this: unknown, _key: unknown, value: any) {\n if (typeof value !== 'object' || value === null) return value\n // `this` is the object that value is contained in, i.e., its direct parent.\n while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) ancestors.pop()\n if (ancestors.includes(value)) return '[Circular]'\n ancestors.push(value)\n return value\n }, space)\n}\n\nfunction to_integer (value: any) {\n return Number(value)\n}\n\nconst raw = {\n raw: true,\n handler: identify\n}\n\nexport default {\n default: defaultFilter,\n raw,\n jsonify: json,\n to_integer,\n json,\n inspect\n}\n","import { stringify } from '../util/underscore'\n\nconst escapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n}\nconst unescapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n}\n\nexport function escape (str: string) {\n return stringify(str).replace(/&|<|>|\"|'/g, m => escapeMap[m])\n}\n\nexport function xml_escape (str: string) {\n return escape(str)\n}\n\nfunction unescape (str: string) {\n return stringify(str).replace(/&(amp|lt|gt|#34|#39);/g, m => unescapeMap[m])\n}\n\nexport function escape_once (str: string) {\n return escape(unescape(stringify(str)))\n}\n\nexport function newline_to_br (v: string) {\n return stringify(v).replace(/\\r?\\n/gm, '
    \\n')\n}\n\nexport function strip_html (v: string) {\n return stringify(v).replace(/||<.*?>|/g, '')\n}\n","import { assert, isArray, isString, isFunction } from './util'\nimport { LRU, LiquidCache } from './cache'\nimport { FS, LookupType } from './fs'\nimport * as fs from './fs/fs-impl'\nimport { defaultOperators, Operators } from './render'\nimport misc from './filters/misc'\nimport { escape } from './filters/html'\n\ntype OutputEscape = (value: any) => string\ntype OutputEscapeOption = 'escape' | 'json' | OutputEscape\n\nexport interface LiquidOptions {\n /** A directory or an array of directories from where to resolve layout and include templates, and the filename passed to `.renderFile()`. If it's an array, the files are looked up in the order they occur in the array. Defaults to `[\".\"]` */\n root?: string | string[];\n /** A directory or an array of directories from where to resolve included templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */\n partials?: string | string[];\n /** A directory or an array of directories from where to resolve layout templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */\n layouts?: string | string[];\n /** Allow refer to layouts/partials by relative pathname. To avoid arbitrary filesystem read, paths been referenced also need to be within corresponding root, partials, layouts. Defaults to `true`. */\n relativeReference?: boolean;\n /** Use jekyll style include, pass parameters to `include` variable of current scope. Defaults to `false`. */\n jekyllInclude?: boolean;\n /** Add a extname (if filepath doesn't include one) before template file lookup. Eg: setting to `\".html\"` will allow including file by basename. Defaults to `\"\"`. */\n extname?: string;\n /** Whether or not to cache resolved templates. Defaults to `false`. */\n cache?: boolean | number | LiquidCache;\n /** Use JavaScript Truthiness. Defaults to `false`. */\n jsTruthy?: boolean;\n /** If set, treat the `filepath` parameter in `{%include filepath %}` and `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`. */\n dynamicPartials?: boolean;\n /** Whether or not to assert filter existence. If set to `false`, undefined filters will be skipped. Otherwise, undefined filters will cause an exception. Defaults to `false`. */\n strictFilters?: boolean;\n /** Whether or not to assert variable existence. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */\n strictVariables?: boolean;\n /** Catch all errors instead of exit upon one. Please note that render errors won't be reached when parse fails. */\n catchAllErrors?: boolean;\n /** Hide scope variables from prototypes, useful when you're passing a not sanitized object into LiquidJS or need to hide prototypes from templates. */\n ownPropertyOnly?: boolean;\n /** Modifies the behavior of `strictVariables`. If set, a single undefined variable will *not* cause an exception in the context of the `if`/`elsif`/`unless` tag and the `default` filter. Instead, it will evaluate to `false` and `null`, respectively. Irrelevant if `strictVariables` is not set. Defaults to `false`. **/\n lenientIf?: boolean;\n /** JavaScript timezone name or timezoneOffset for `date` filter, default to local time. That means if you're in Australia (UTC+10), it'll default to `-600` or `Australia/Lindeman` */\n timezoneOffset?: number | string;\n /** Default date format to use if the date filter doesn't include a format. Defaults to `%A, %B %-e, %Y at %-l:%M %P %z`. */\n dateFormat?: string;\n /** Strip blank characters (including ` `, `\\t`, and `\\r`) from the right of tags (`{% %}`) until `\\n` (inclusive). Defaults to `false`. */\n trimTagRight?: boolean;\n /** Similar to `trimTagRight`, whereas the `\\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */\n trimTagLeft?: boolean;\n /** Strip blank characters (including ` `, `\\t`, and `\\r`) from the right of values (`{{ }}`) until `\\n` (inclusive). Defaults to `false`. */\n trimOutputRight?: boolean;\n /** Similar to `trimOutputRight`, whereas the `\\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */\n trimOutputLeft?: boolean;\n /** The left delimiter for liquid tags. **/\n tagDelimiterLeft?: string;\n /** The right delimiter for liquid tags. **/\n tagDelimiterRight?: string;\n /** The left delimiter for liquid outputs. **/\n outputDelimiterLeft?: string;\n /** The right delimiter for liquid outputs. **/\n outputDelimiterRight?: string;\n /** Whether input strings to date filter preserve the given timezone **/\n preserveTimezones?: boolean;\n /** Whether `trim*Left`/`trim*Right` is greedy. When set to `true`, all consecutive blank characters including `\\n` will be trimmed regardless of line breaks. Defaults to `true`. */\n greedy?: boolean;\n /** `fs` is used to override the default file-system module with a custom implementation. */\n fs?: FS;\n /** the global scope passed down to all partial and layout templates, i.e. templates included by `include`, `layout` and `render` tags. */\n globals?: object;\n /** Whether or not to keep value type when writing the Output, not working for streamed rendering. Defaults to `false`. */\n keepOutputType?: boolean;\n /** Default escape filter applied to output values, when set, you'll have to add `| raw` for values don't need to be escaped. Defaults to `undefined`. */\n outputEscape?: OutputEscapeOption;\n /** An object of operators for conditional statements. Defaults to the regular Liquid operators. */\n operators?: Operators;\n /** Respect parameter order when using filters like \"for ... reversed limit\", Defaults to `false`. */\n orderedFilterParameters?: boolean;\n}\n\nexport interface RenderOptions {\n /**\n * This call is sync or async? It's used by Liquid internal methods, you'll not need this.\n */\n sync?: boolean;\n /**\n * Same as `globals` on LiquidOptions, but only for current render() call\n */\n globals?: object;\n /**\n * Same as `strictVariables` on LiquidOptions, but only for current render() call\n */\n strictVariables?: boolean;\n /**\n * Same as `ownPropertyOnly` on LiquidOptions, but only for current render() call\n */\n ownPropertyOnly?: boolean;\n}\n\nexport interface RenderFileOptions extends RenderOptions {\n lookupType?: LookupType;\n}\n\ninterface NormalizedOptions extends LiquidOptions {\n root?: string[];\n partials?: string[];\n layouts?: string[];\n cache?: LiquidCache;\n outputEscape?: OutputEscape;\n}\n\nexport interface NormalizedFullOptions extends NormalizedOptions {\n root: string[];\n partials: string[];\n layouts: string[];\n relativeReference: boolean;\n jekyllInclude: boolean;\n extname: string;\n cache?: LiquidCache;\n jsTruthy: boolean;\n dynamicPartials: boolean;\n fs: FS;\n strictFilters: boolean;\n strictVariables: boolean;\n ownPropertyOnly: boolean;\n lenientIf: boolean;\n dateFormat: string;\n trimTagRight: boolean;\n trimTagLeft: boolean;\n trimOutputRight: boolean;\n trimOutputLeft: boolean;\n tagDelimiterLeft: string;\n tagDelimiterRight: string;\n outputDelimiterLeft: string;\n outputDelimiterRight: string;\n preserveTimezones: boolean;\n greedy: boolean;\n globals: object;\n keepOutputType: boolean;\n operators: Operators;\n}\n\nexport const defaultOptions: NormalizedFullOptions = {\n root: ['.'],\n layouts: ['.'],\n partials: ['.'],\n relativeReference: true,\n jekyllInclude: false,\n cache: undefined,\n extname: '',\n fs: fs,\n dynamicPartials: true,\n jsTruthy: false,\n dateFormat: '%A, %B %-e, %Y at %-l:%M %P %z',\n trimTagRight: false,\n trimTagLeft: false,\n trimOutputRight: false,\n trimOutputLeft: false,\n greedy: true,\n tagDelimiterLeft: '{%',\n tagDelimiterRight: '%}',\n outputDelimiterLeft: '{{',\n outputDelimiterRight: '}}',\n preserveTimezones: false,\n strictFilters: false,\n strictVariables: false,\n ownPropertyOnly: true,\n lenientIf: false,\n globals: {},\n keepOutputType: false,\n operators: defaultOperators\n}\n\nexport function normalize (options: LiquidOptions): NormalizedFullOptions {\n if (options.hasOwnProperty('root')) {\n if (!options.hasOwnProperty('partials')) options.partials = options.root\n if (!options.hasOwnProperty('layouts')) options.layouts = options.root\n }\n if (options.hasOwnProperty('cache')) {\n let cache: LiquidCache | undefined\n if (typeof options.cache === 'number') cache = options.cache > 0 ? new LRU(options.cache) : undefined\n else if (typeof options.cache === 'object') cache = options.cache\n else cache = options.cache ? new LRU(1024) : undefined\n options.cache = cache\n }\n options = { ...defaultOptions, ...(options.jekyllInclude ? { dynamicPartials: false } : {}), ...options }\n if ((!options.fs!.dirname || !options.fs!.sep) && options.relativeReference) {\n console.warn('[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning')\n options.relativeReference = false\n }\n options.root = normalizeDirectoryList(options.root)\n options.partials = normalizeDirectoryList(options.partials)\n options.layouts = normalizeDirectoryList(options.layouts)\n options.outputEscape = options.outputEscape && getOutputEscapeFunction(options.outputEscape)\n return options as NormalizedFullOptions\n}\n\nfunction getOutputEscapeFunction (nameOrFunction: OutputEscapeOption): OutputEscape {\n if (nameOrFunction === 'escape') return escape\n if (nameOrFunction === 'json') return misc.json\n assert(isFunction(nameOrFunction), '`outputEscape` need to be of type string or function')\n return nameOrFunction\n}\n\nexport function normalizeDirectoryList (value: any): string[] {\n let list: string[] = []\n if (isArray(value)) list = value\n if (isString(value)) list = [value]\n return list\n}\n","import { Token } from '../tokens'\nimport { NormalizedFullOptions } from '../liquid-options'\nimport { isTagToken, isHTMLToken, isDelimitedToken, TYPES, INLINE_BLANK, BLANK } from '../util'\n\nexport function whiteSpaceCtrl (tokens: Token[], options: NormalizedFullOptions) {\n let inRaw = false\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n if (!isDelimitedToken(token)) continue\n if (!inRaw && token.trimLeft) {\n trimLeft(tokens[i - 1], options.greedy)\n }\n\n if (isTagToken(token)) {\n if (token.name === 'raw') inRaw = true\n else if (token.name === 'endraw') inRaw = false\n }\n\n if (!inRaw && token.trimRight) {\n trimRight(tokens[i + 1], options.greedy)\n }\n }\n}\n\nfunction trimLeft (token: Token, greedy: boolean) {\n if (!token || !isHTMLToken(token)) return\n\n const mask = greedy ? BLANK : INLINE_BLANK\n while (TYPES[token.input.charCodeAt(token.end - 1 - token.trimRight)] & mask) token.trimRight++\n}\n\nfunction trimRight (token: Token, greedy: boolean) {\n if (!token || !isHTMLToken(token)) return\n\n const mask = greedy ? BLANK : INLINE_BLANK\n while (TYPES[token.input.charCodeAt(token.begin + token.trimLeft)] & mask) token.trimLeft++\n if (token.input.charAt(token.begin + token.trimLeft) === '\\n') token.trimLeft++\n}\n","import { FilteredValueToken, TagToken, HTMLToken, HashToken, QuotedToken, LiquidTagToken, OutputToken, ValueToken, Token, RangeToken, FilterToken, TopLevelToken, PropertyAccessToken, OperatorToken, LiteralToken, IdentifierToken, NumberToken } from '../tokens'\nimport { OperatorHandler } from '../render/operator'\nimport { TrieNode, LiteralValue, Trie, createTrie, ellipsis, literalValues, TokenizationError, TYPES, QUOTE, BLANK, NUMBER, SIGN, isWord } from '../util'\nimport { Operators, Expression } from '../render'\nimport { NormalizedFullOptions, defaultOptions } from '../liquid-options'\nimport { FilterArg } from './filter-arg'\nimport { whiteSpaceCtrl } from './whitespace-ctrl'\n\nexport class Tokenizer {\n p: number\n N: number\n private rawBeginAt = -1\n private opTrie: Trie\n private literalTrie: Trie\n\n constructor (\n public input: string,\n operators: Operators = defaultOptions.operators,\n public file?: string,\n range?: [number, number]\n ) {\n this.p = range ? range[0] : 0\n this.N = range ? range[1] : input.length\n this.opTrie = createTrie(operators)\n this.literalTrie = createTrie(literalValues)\n }\n\n readExpression () {\n return new Expression(this.readExpressionTokens())\n }\n\n * readExpressionTokens (): IterableIterator {\n while (this.p < this.N) {\n const operator = this.readOperator()\n if (operator) {\n yield operator\n continue\n }\n const operand = this.readValue()\n if (operand) {\n yield operand\n continue\n }\n return\n }\n }\n readOperator (): OperatorToken | undefined {\n this.skipBlank()\n const end = this.matchTrie(this.opTrie)\n if (end === -1) return\n return new OperatorToken(this.input, this.p, (this.p = end), this.file)\n }\n matchTrie (trie: Trie) {\n let node: TrieNode = trie\n let i = this.p\n let info\n while (node[this.input[i]] && i < this.N) {\n node = node[this.input[i++]]\n if (node['end']) info = node\n }\n if (!info) return -1\n if (info['needBoundary'] && isWord(this.peek(i - this.p))) return -1\n return i\n }\n readFilteredValue (): FilteredValueToken {\n const begin = this.p\n const initial = this.readExpression()\n this.assert(initial.valid(), `invalid value expression: ${this.snapshot()}`)\n const filters = this.readFilters()\n return new FilteredValueToken(initial, filters, this.input, begin, this.p, this.file)\n }\n readFilters (): FilterToken[] {\n const filters = []\n while (true) {\n const filter = this.readFilter()\n if (!filter) return filters\n filters.push(filter)\n }\n }\n readFilter (): FilterToken | null {\n this.skipBlank()\n if (this.end()) return null\n this.assert(this.peek() === '|', `expected \"|\" before filter`)\n this.p++\n const begin = this.p\n const name = this.readIdentifier()\n if (!name.size()) {\n this.assert(this.end(), `expected filter name`)\n return null\n }\n const args = []\n this.skipBlank()\n if (this.peek() === ':') {\n do {\n ++this.p\n const arg = this.readFilterArg()\n arg && args.push(arg)\n this.skipBlank()\n this.assert(this.end() || this.peek() === ',' || this.peek() === '|', () => `unexpected character ${this.snapshot()}`)\n } while (this.peek() === ',')\n } else if (this.peek() === '|' || this.end()) {\n // do nothing\n } else {\n throw this.error('expected \":\" after filter name')\n }\n return new FilterToken(name.getText(), args, this.input, begin, this.p, this.file)\n }\n\n readFilterArg (): FilterArg | undefined {\n const key = this.readValue()\n if (!key) return\n this.skipBlank()\n if (this.peek() !== ':') return key\n ++this.p\n const value = this.readValue()\n return [key.getText(), value]\n }\n\n readTopLevelTokens (options: NormalizedFullOptions = defaultOptions): TopLevelToken[] {\n const tokens: TopLevelToken[] = []\n while (this.p < this.N) {\n const token = this.readTopLevelToken(options)\n tokens.push(token)\n }\n whiteSpaceCtrl(tokens, options)\n return tokens\n }\n\n readTopLevelToken (options: NormalizedFullOptions): TopLevelToken {\n const { tagDelimiterLeft, outputDelimiterLeft } = options\n if (this.rawBeginAt > -1) return this.readEndrawOrRawContent(options)\n if (this.match(tagDelimiterLeft)) return this.readTagToken(options)\n if (this.match(outputDelimiterLeft)) return this.readOutputToken(options)\n return this.readHTMLToken([tagDelimiterLeft, outputDelimiterLeft])\n }\n\n readHTMLToken (stopStrings: string[]): HTMLToken {\n const begin = this.p\n while (this.p < this.N) {\n if (stopStrings.some(str => this.match(str))) break\n ++this.p\n }\n return new HTMLToken(this.input, begin, this.p, this.file)\n }\n\n readTagToken (options: NormalizedFullOptions = defaultOptions): TagToken {\n const { file, input } = this\n const begin = this.p\n if (this.readToDelimiter(options.tagDelimiterRight) === -1) {\n throw this.error(`tag ${this.snapshot(begin)} not closed`, begin)\n }\n const token = new TagToken(input, begin, this.p, options, file)\n if (token.name === 'raw') this.rawBeginAt = begin\n return token\n }\n\n readToDelimiter (delimiter: string, respectQuoted = false) {\n this.skipBlank()\n while (this.p < this.N) {\n if (respectQuoted && (this.peekType() & QUOTE)) {\n this.readQuoted()\n continue\n }\n ++this.p\n if (this.rmatch(delimiter)) return this.p\n }\n return -1\n }\n\n readOutputToken (options: NormalizedFullOptions = defaultOptions): OutputToken {\n const { file, input } = this\n const { outputDelimiterRight } = options\n const begin = this.p\n if (this.readToDelimiter(outputDelimiterRight, true) === -1) {\n throw this.error(`output ${this.snapshot(begin)} not closed`, begin)\n }\n return new OutputToken(input, begin, this.p, options, file)\n }\n\n readEndrawOrRawContent (options: NormalizedFullOptions): HTMLToken | TagToken {\n const { tagDelimiterLeft, tagDelimiterRight } = options\n const begin = this.p\n let leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length\n while (this.p < this.N) {\n if (this.readIdentifier().getText() !== 'endraw') {\n leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length\n continue\n }\n while (this.p <= this.N) {\n if (this.rmatch(tagDelimiterRight)) {\n const end = this.p\n if (begin === leftPos) {\n this.rawBeginAt = -1\n return new TagToken(this.input, begin, end, options, this.file)\n } else {\n this.p = leftPos\n return new HTMLToken(this.input, begin, leftPos, this.file)\n }\n }\n if (this.rmatch(tagDelimiterLeft)) break\n this.p++\n }\n }\n throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, begin)\n }\n\n readLiquidTagTokens (options: NormalizedFullOptions = defaultOptions): LiquidTagToken[] {\n const tokens: LiquidTagToken[] = []\n while (this.p < this.N) {\n const token = this.readLiquidTagToken(options)\n token && tokens.push(token)\n }\n return tokens\n }\n\n readLiquidTagToken (options: NormalizedFullOptions): LiquidTagToken | undefined {\n this.skipBlank()\n if (this.end()) return\n\n const begin = this.p\n this.readToDelimiter('\\n')\n const end = this.p\n return new LiquidTagToken(this.input, begin, end, options, this.file)\n }\n\n error (msg: string, pos: number = this.p) {\n return new TokenizationError(msg, new IdentifierToken(this.input, pos, this.N, this.file))\n }\n\n assert (pred: unknown, msg: string | (() => string), pos?: number) {\n if (!pred) throw this.error(typeof msg === 'function' ? msg() : msg, pos)\n }\n\n snapshot (begin: number = this.p) {\n return JSON.stringify(ellipsis(this.input.slice(begin, this.N), 32))\n }\n\n /**\n * @deprecated use #readIdentifier instead\n */\n readWord () {\n return this.readIdentifier()\n }\n\n readIdentifier (): IdentifierToken {\n this.skipBlank()\n const begin = this.p\n while (!this.end() && isWord(this.peek())) ++this.p\n return new IdentifierToken(this.input, begin, this.p, this.file)\n }\n\n readNonEmptyIdentifier (): IdentifierToken | undefined {\n const id = this.readIdentifier()\n return id.size() ? id : undefined\n }\n\n readTagName (): string {\n this.skipBlank()\n // Handle inline comment tags\n if (this.input[this.p] === '#') return this.input.slice(this.p, ++this.p)\n return this.readIdentifier().getText()\n }\n\n readHashes (jekyllStyle?: boolean) {\n const hashes = []\n while (true) {\n const hash = this.readHash(jekyllStyle)\n if (!hash) return hashes\n hashes.push(hash)\n }\n }\n\n readHash (jekyllStyle?: boolean): HashToken | undefined {\n this.skipBlank()\n if (this.peek() === ',') ++this.p\n const begin = this.p\n const name = this.readNonEmptyIdentifier()\n if (!name) return\n let value\n\n this.skipBlank()\n const sep = jekyllStyle ? '=' : ':'\n if (this.peek() === sep) {\n ++this.p\n value = this.readValue()\n }\n return new HashToken(this.input, begin, this.p, name, value, this.file)\n }\n\n remaining () {\n return this.input.slice(this.p, this.N)\n }\n\n advance (step = 1) {\n this.p += step\n }\n\n end () {\n return this.p >= this.N\n }\n\n readTo (end: string): number {\n while (this.p < this.N) {\n ++this.p\n if (this.rmatch(end)) return this.p\n }\n return -1\n }\n\n readValue (): ValueToken | undefined {\n this.skipBlank()\n const begin = this.p\n const variable = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber()\n const props = this.readProperties(!variable)\n if (!props.length) return variable\n return new PropertyAccessToken(variable, props, this.input, begin, this.p)\n }\n\n readScopeValue (): ValueToken | undefined {\n this.skipBlank()\n const begin = this.p\n const props = this.readProperties()\n if (!props.length) return undefined\n return new PropertyAccessToken(undefined, props, this.input, begin, this.p)\n }\n\n private readProperties (isBegin = true): (ValueToken | IdentifierToken)[] {\n const props: (ValueToken | IdentifierToken)[] = []\n while (true) {\n if (this.peek() === '[') {\n this.p++\n const prop = this.readValue() || new IdentifierToken(this.input, this.p, this.p, this.file)\n this.assert(this.readTo(']') !== -1, '[ not closed')\n props.push(prop)\n continue\n }\n if (isBegin && !props.length) {\n const prop = this.readNonEmptyIdentifier()\n if (prop) {\n props.push(prop)\n continue\n }\n }\n if (this.peek() === '.' && this.peek(1) !== '.') { // skip range syntax\n this.p++\n const prop = this.readNonEmptyIdentifier()\n if (!prop) break\n props.push(prop)\n continue\n }\n break\n }\n return props\n }\n\n readNumber (): NumberToken | undefined {\n this.skipBlank()\n let decimalFound = false\n let digitFound = false\n let n = 0\n if (this.peekType() & SIGN) n++\n while (this.p + n <= this.N) {\n if (this.peekType(n) & NUMBER) {\n digitFound = true\n n++\n } else if (this.peek(n) === '.' && this.peek(n + 1) !== '.') {\n if (decimalFound || !digitFound) return\n decimalFound = true\n n++\n } else break\n }\n if (digitFound && !isWord(this.peek(n))) {\n const num = new NumberToken(this.input, this.p, this.p + n, this.file)\n this.advance(n)\n return num\n }\n }\n\n readLiteral (): LiteralToken | undefined {\n this.skipBlank()\n const end = this.matchTrie(this.literalTrie)\n if (end === -1) return\n const literal = new LiteralToken(this.input, this.p, end, this.file)\n this.p = end\n return literal\n }\n\n readRange (): RangeToken | undefined {\n this.skipBlank()\n const begin = this.p\n if (this.peek() !== '(') return\n ++this.p\n const lhs = this.readValueOrThrow()\n this.p += 2\n const rhs = this.readValueOrThrow()\n ++this.p\n return new RangeToken(this.input, begin, this.p, lhs, rhs, this.file)\n }\n\n readValueOrThrow (): ValueToken {\n const value = this.readValue()\n this.assert(value, () => `unexpected token ${this.snapshot()}, value expected`)\n return value!\n }\n\n readQuoted (): QuotedToken | undefined {\n this.skipBlank()\n const begin = this.p\n if (!(this.peekType() & QUOTE)) return\n ++this.p\n let escaped = false\n while (this.p < this.N) {\n ++this.p\n if (this.input[this.p - 1] === this.input[begin] && !escaped) break\n if (escaped) escaped = false\n else if (this.input[this.p - 1] === '\\\\') escaped = true\n }\n return new QuotedToken(this.input, begin, this.p, this.file)\n }\n\n * readFileNameTemplate (options: NormalizedFullOptions): IterableIterator {\n const { outputDelimiterLeft } = options\n const htmlStopStrings = [',', ' ', outputDelimiterLeft]\n const htmlStopStringSet = new Set(htmlStopStrings)\n // break on ',' and ' ', outputDelimiterLeft only stops HTML token\n while (this.p < this.N && !htmlStopStringSet.has(this.peek())) {\n yield this.match(outputDelimiterLeft)\n ? this.readOutputToken(options)\n : this.readHTMLToken(htmlStopStrings)\n }\n }\n\n match (word: string) {\n for (let i = 0; i < word.length; i++) {\n if (word[i] !== this.input[this.p + i]) return false\n }\n return true\n }\n\n rmatch (pattern: string) {\n for (let i = 0; i < pattern.length; i++) {\n if (pattern[pattern.length - 1 - i] !== this.input[this.p - 1 - i]) return false\n }\n return true\n }\n\n peekType (n = 0) {\n return this.p + n >= this.N ? 0 : TYPES[this.input.charCodeAt(this.p + n)]\n }\n\n peek (n = 0): string {\n return this.p + n >= this.N ? '' : this.input[this.p + n]\n }\n\n skipBlank () {\n while (this.peekType() & BLANK) ++this.p\n }\n}\n","import { Token, TopLevelToken } from '../tokens'\nimport { Template } from '../template'\nimport { isTagToken } from '../util'\n\ntype ParseToken = ((token: T, remainTokens: T[]) => Template)\n\nexport class ParseStream {\n private tokens: T[]\n private handlers: Record void> = {}\n private stopRequested = false\n private parseToken: ParseToken\n\n public constructor (tokens: T[], parseToken: ParseToken) {\n this.tokens = tokens\n this.parseToken = parseToken\n }\n public on (name: string, cb: (this: ParseStream, arg: T2) => void): ParseStream {\n this.handlers[name] = cb\n return this\n }\n private trigger (event: string, arg?: T) {\n const h = this.handlers[event]\n return h ? (h.call(this, arg), true) : false\n }\n public start () {\n this.trigger('start')\n let token: T | undefined\n while (!this.stopRequested && (token = this.tokens.shift())) {\n if (this.trigger('token', token)) continue\n if (isTagToken(token) && this.trigger(`tag:${token.name}`, token)) {\n continue\n }\n const template = this.parseToken(token, this.tokens)\n this.trigger('template', template)\n }\n if (!this.stopRequested) this.trigger('end')\n return this\n }\n public stop () {\n this.stopRequested = true\n return this\n }\n}\n","export abstract class TemplateImpl {\n public token: T;\n public constructor (token: T) {\n this.token = token\n }\n}\n","import { TemplateImpl } from './template-impl'\nimport type { Emitter } from '../emitters/emitter'\nimport type { Tokenizer } from '../parser'\nimport type { Context } from '../context/context'\nimport type { TopLevelToken, TagToken } from '../tokens'\nimport type { Template } from './template'\nimport type { Liquid } from '../liquid'\n\nexport type TagRenderReturn = Generator | Promise | unknown\n\nexport abstract class Tag extends TemplateImpl implements Template {\n public name: string\n public liquid: Liquid\n protected tokenizer: Tokenizer\n\n public constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token)\n this.name = token.name\n this.liquid = liquid\n this.tokenizer = token.tokenizer\n }\n public abstract render (ctx: Context, emitter: Emitter): TagRenderReturn;\n}\n\nexport interface TagClass {\n new(token: TagToken, tokens: TopLevelToken[], liquid: Liquid): Tag\n}\n","import { evalToken } from '../render/expression'\nimport { Context } from '../context/context'\nimport { Tokenizer } from '../parser/tokenizer'\nimport { Token } from '../tokens/token'\n\ntype HashValueTokens = Record\n\n/**\n * Key-Value Pairs Representing Tag Arguments\n * Example:\n * For the markup `, foo:'bar', coo:2 reversed %}`,\n * hash['foo'] === 'bar'\n * hash['coo'] === 2\n * hash['reversed'] === undefined\n */\nexport class Hash {\n hash: HashValueTokens = {}\n constructor (markup: string, jekyllStyle?: boolean) {\n const tokenizer = new Tokenizer(markup, {})\n for (const hash of tokenizer.readHashes(jekyllStyle)) {\n this.hash[hash.name.content] = hash.value\n }\n }\n * render (ctx: Context): Generator, unknown> {\n const hash = {}\n for (const key of Object.keys(this.hash)) {\n hash[key] = this.hash[key] === undefined ? true : yield evalToken(this.hash[key], ctx)\n }\n return hash\n }\n}\n","import { evalToken } from '../render'\nimport { Context } from '../context'\nimport { identify, isFunction } from '../util/underscore'\nimport { FilterHandler, FilterImplOptions } from './filter-impl-options'\nimport { FilterArg, isKeyValuePair } from '../parser/filter-arg'\nimport { Liquid } from '../liquid'\n\nexport class Filter {\n public name: string\n public args: FilterArg[]\n public readonly raw: boolean\n private handler: FilterHandler\n private liquid: Liquid\n\n public constructor (name: string, options: FilterImplOptions | undefined, args: FilterArg[], liquid: Liquid) {\n this.name = name\n this.handler = isFunction(options)\n ? options\n : (isFunction(options?.handler) ? options!.handler : identify)\n this.raw = !isFunction(options) && !!options?.raw\n this.args = args\n this.liquid = liquid\n }\n public * render (value: any, context: Context): IterableIterator {\n const argv: any[] = []\n for (const arg of this.args as FilterArg[]) {\n if (isKeyValuePair(arg)) argv.push([arg[0], yield evalToken(arg[1], context)])\n else argv.push(yield evalToken(arg, context))\n }\n return yield this.handler.apply({ context, liquid: this.liquid }, [value, ...argv])\n }\n}\n","import { isArray } from '../util/underscore'\nimport { ValueToken } from '../tokens/value-token'\n\ntype KeyValuePair = [string?, ValueToken?]\n\nexport type FilterArg = ValueToken | KeyValuePair\n\nexport function isKeyValuePair (arr: FilterArg): arr is KeyValuePair {\n return isArray(arr)\n}\n","import { Filter } from './filter'\nimport { Expression } from '../render'\nimport { Tokenizer } from '../parser'\nimport { assert } from '../util'\nimport type { FilteredValueToken } from '../tokens'\nimport type { Liquid } from '../liquid'\nimport type { Context } from '../context'\n\nexport class Value {\n public readonly filters: Filter[] = []\n public readonly initial: Expression\n\n /**\n * @param str the value to be valuated, eg.: \"foobar\" | truncate: 3\n */\n public constructor (input: string | FilteredValueToken, liquid: Liquid) {\n const token: FilteredValueToken = typeof input === 'string'\n ? new Tokenizer(input, liquid.options.operators).readFilteredValue()\n : input\n this.initial = token.initial\n this.filters = token.filters.map(({ name, args }) => new Filter(name, this.getFilter(liquid, name), args, liquid))\n }\n public * value (ctx: Context, lenient?: boolean): Generator {\n lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default')\n let val = yield this.initial.evaluate(ctx, lenient)\n\n for (const filter of this.filters) {\n val = yield filter.render(val, ctx)\n }\n return val\n }\n private getFilter (liquid: Liquid, name: string) {\n const impl = liquid.filters[name]\n assert(impl || !liquid.options.strictFilters, () => `undefined filter: ${name}`)\n return impl\n }\n}\n","import { Value } from './value'\nimport { Template, TemplateImpl } from '../template'\nimport { Context } from '../context/context'\nimport { Emitter } from '../emitters/emitter'\nimport { OutputToken } from '../tokens/output-token'\nimport { Tokenizer } from '../parser'\nimport { Liquid } from '../liquid'\nimport { Filter } from './filter'\n\nexport class Output extends TemplateImpl implements Template {\n value: Value\n public constructor (token: OutputToken, liquid: Liquid) {\n super(token)\n const tokenizer = new Tokenizer(token.input, liquid.options.operators, token.file, token.contentRange)\n this.value = new Value(tokenizer.readFilteredValue(), liquid)\n const filters = this.value.filters\n const outputEscape = liquid.options.outputEscape\n if (!filters[filters.length - 1]?.raw && outputEscape) {\n filters.push(new Filter(toString.call(outputEscape), outputEscape, [], liquid))\n }\n }\n public * render (ctx: Context, emitter: Emitter): IterableIterator {\n const val = yield this.value.value(ctx, false)\n emitter.write(val)\n }\n}\n","import { TemplateImpl, Template } from '../template'\nimport { HTMLToken } from '../tokens'\nimport { Context } from '../context'\nimport { Emitter } from '../emitters'\n\nexport class HTML extends TemplateImpl implements Template {\n private str: string\n public constructor (token: HTMLToken) {\n super(token)\n this.str = token.getContent()\n }\n public * render (ctx: Context, emitter: Emitter): IterableIterator {\n emitter.write(this.str)\n }\n}\n","import { FS } from './fs'\nimport { assert, escapeRegex } from '../util'\n\nexport interface LoaderOptions {\n fs: FS;\n extname: string;\n root: string[];\n partials: string[];\n layouts: string[];\n relativeReference: boolean;\n}\nexport enum LookupType {\n Partials = 'partials',\n Layouts = 'layouts',\n Root = 'root'\n}\nexport class Loader {\n public shouldLoadRelative: (referencedFile: string) => boolean\n private options: LoaderOptions\n private contains: (root: string, file: string) => boolean\n\n constructor (options: LoaderOptions) {\n this.options = options\n if (options.relativeReference) {\n const sep = options.fs.sep\n assert(sep, '`fs.sep` is required for relative reference')\n const rRelativePath = new RegExp(['.' + sep, '..' + sep, './', '../'].map(prefix => escapeRegex(prefix)).join('|'))\n this.shouldLoadRelative = (referencedFile: string) => rRelativePath.test(referencedFile)\n } else {\n this.shouldLoadRelative = (referencedFile: string) => false\n }\n this.contains = this.options.fs.contains || (() => true)\n }\n\n public * lookup (file: string, type: LookupType, sync?: boolean, currentFile?: string): Generator {\n const { fs } = this.options\n const dirs = this.options[type]\n for (const filepath of this.candidates(file, dirs, currentFile, type !== LookupType.Root)) {\n if (sync ? fs.existsSync(filepath) : yield fs.exists(filepath)) return filepath\n }\n throw this.lookupError(file, dirs)\n }\n\n public * candidates (file: string, dirs: string[], currentFile?: string, enforceRoot?: boolean) {\n const { fs, extname } = this.options\n if (this.shouldLoadRelative(file) && currentFile) {\n const referenced = fs.resolve(this.dirname(currentFile), file, extname)\n for (const dir of dirs) {\n if (!enforceRoot || this.contains(dir, referenced)) {\n // the relatively referenced file is within one of root dirs\n yield referenced\n break\n }\n }\n }\n for (const dir of dirs) {\n const referenced = fs.resolve(dir, file, extname)\n if (!enforceRoot || this.contains(dir, referenced)) {\n yield referenced\n }\n }\n if (fs.fallback !== undefined) {\n const filepath = fs.fallback(file)\n if (filepath !== undefined) yield filepath\n }\n }\n\n private dirname (path: string) {\n const fs = this.options.fs\n assert(fs.dirname, '`fs.dirname` is required for relative reference')\n return fs.dirname!(path)\n }\n\n private lookupError (file: string, roots: string[]) {\n const err = new Error('ENOENT') as any\n err.message = `ENOENT: Failed to lookup \"${file}\" in \"${roots}\"`\n err.code = 'ENOENT'\n return err\n }\n}\n","import { toPromise, assert, isTagToken, isOutputToken, ParseError } from '../util'\nimport { Tokenizer } from './tokenizer'\nimport { ParseStream } from './parse-stream'\nimport { TopLevelToken, OutputToken } from '../tokens'\nimport { Template, Output, HTML } from '../template'\nimport { LiquidCache } from '../cache'\nimport { FS, Loader, LookupType } from '../fs'\nimport { LiquidError, LiquidErrors } from '../util/error'\nimport type { Liquid } from '../liquid'\n\nexport class Parser {\n public parseFile: (file: string, sync?: boolean, type?: LookupType, currentFile?: string) => Generator\n\n private liquid: Liquid\n private fs: FS\n private cache?: LiquidCache\n private loader: Loader\n\n public constructor (liquid: Liquid) {\n this.liquid = liquid\n this.cache = this.liquid.options.cache\n this.fs = this.liquid.options.fs\n this.parseFile = this.cache ? this._parseFileCached : this._parseFile\n this.loader = new Loader(this.liquid.options)\n }\n public parse (html: string, filepath?: string): Template[] {\n const tokenizer = new Tokenizer(html, this.liquid.options.operators, filepath)\n const tokens = tokenizer.readTopLevelTokens(this.liquid.options)\n return this.parseTokens(tokens)\n }\n public parseTokens (tokens: TopLevelToken[]) {\n let token\n const templates: Template[] = []\n const errors: LiquidError[] = []\n while ((token = tokens.shift())) {\n try {\n templates.push(this.parseToken(token, tokens))\n } catch (err) {\n if (this.liquid.options.catchAllErrors) errors.push(err as LiquidError)\n else throw err\n }\n }\n if (errors.length) throw new LiquidErrors(errors)\n return templates\n }\n public parseToken (token: TopLevelToken, remainTokens: TopLevelToken[]) {\n try {\n if (isTagToken(token)) {\n const TagClass = this.liquid.tags[token.name]\n assert(TagClass, `tag \"${token.name}\" not found`)\n return new TagClass(token, remainTokens, this.liquid)\n }\n if (isOutputToken(token)) {\n return new Output(token as OutputToken, this.liquid)\n }\n return new HTML(token)\n } catch (e) {\n if (LiquidError.is(e)) throw e\n throw new ParseError(e as Error, token)\n }\n }\n public parseStream (tokens: TopLevelToken[]) {\n return new ParseStream(tokens, (token, tokens) => this.parseToken(token, tokens))\n }\n private * _parseFileCached (file: string, sync?: boolean, type: LookupType = LookupType.Root, currentFile?: string): Generator {\n const cache = this.cache!\n const key = this.loader.shouldLoadRelative(file) ? currentFile + ',' + file : type + ':' + file\n const tpls = yield cache.read(key)\n if (tpls) return tpls\n\n const task = this._parseFile(file, sync, type, currentFile)\n // sync mode: exec the task and cache the result\n // async mode: cache the task before exec\n const taskOrTpl = sync ? yield task : toPromise(task)\n cache.write(key, taskOrTpl as any)\n // note: concurrent tasks will be reused, cache for failed task is removed until its end\n try { return yield taskOrTpl } catch (err) { cache.remove(key); throw err }\n }\n private * _parseFile (file: string, sync?: boolean, type: LookupType = LookupType.Root, currentFile?: string): Generator {\n const filepath = yield this.loader.lookup(file, type, sync, currentFile)\n return this.liquid.parse(sync ? this.fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath)\n }\n}\n","import { RangeToken, NumberToken, QuotedToken, LiteralToken, PropertyAccessToken, OutputToken, HTMLToken, TagToken, IdentifierToken, DelimitedToken, OperatorToken } from '../tokens'\nimport { TokenKind } from '../parser'\n\nexport function isDelimitedToken (val: any): val is DelimitedToken {\n return !!(getKind(val) & TokenKind.Delimited)\n}\n\nexport function isOperatorToken (val: any): val is OperatorToken {\n return getKind(val) === TokenKind.Operator\n}\n\nexport function isHTMLToken (val: any): val is HTMLToken {\n return getKind(val) === TokenKind.HTML\n}\n\nexport function isOutputToken (val: any): val is OutputToken {\n return getKind(val) === TokenKind.Output\n}\n\nexport function isTagToken (val: any): val is TagToken {\n return getKind(val) === TokenKind.Tag\n}\n\nexport function isQuotedToken (val: any): val is QuotedToken {\n return getKind(val) === TokenKind.Quoted\n}\n\nexport function isLiteralToken (val: any): val is LiteralToken {\n return getKind(val) === TokenKind.Literal\n}\n\nexport function isNumberToken (val: any): val is NumberToken {\n return getKind(val) === TokenKind.Number\n}\n\nexport function isPropertyAccessToken (val: any): val is PropertyAccessToken {\n return getKind(val) === TokenKind.PropertyAccess\n}\n\nexport function isWordToken (val: any): val is IdentifierToken {\n return getKind(val) === TokenKind.Word\n}\n\nexport function isRangeToken (val: any): val is RangeToken {\n return getKind(val) === TokenKind.Range\n}\n\nfunction getKind (val: any) {\n return val ? val.kind : -1\n}\n","export enum TokenKind {\n Number = 1,\n Literal = 2,\n Tag = 4,\n Output = 8,\n HTML = 16,\n Filter = 32,\n Hash = 64,\n PropertyAccess = 128,\n Word = 256,\n Range = 512,\n Quoted = 1024,\n Operator = 2048,\n FilteredValue = 4096,\n Delimited = Tag | Output\n}\n","export enum BlockMode {\n /* store rendered html into blocks */\n OUTPUT,\n /* output rendered html directly */\n STORE\n}\n","import { Drop } from '../drop/drop'\nimport { __assign } from 'tslib'\nimport { NormalizedFullOptions, defaultOptions, RenderOptions } from '../liquid-options'\nimport { Scope } from './scope'\nimport { isArray, isNil, isUndefined, isString, isFunction, toLiquid, InternalUndefinedVariableError, toValueSync, isObject } from '../util'\n\ntype PropertyKey = string | number;\n\nexport class Context {\n /**\n * insert a Context-level empty scope,\n * for tags like `{% capture %}` `{% assign %}` to operate\n */\n private scopes: Scope[] = [{}]\n private registers = {}\n /**\n * user passed in scope\n * `{% increment %}`, `{% decrement %}` changes this scope,\n * whereas `{% capture %}`, `{% assign %}` only hide this scope\n */\n public environments: Scope\n /**\n * global scope used as fallback for missing variables\n */\n public globals: Scope\n public sync: boolean\n /**\n * The normalized liquid options object\n */\n public opts: NormalizedFullOptions\n /**\n * Throw when accessing undefined variable?\n */\n public strictVariables: boolean;\n public ownPropertyOnly: boolean;\n public constructor (env: object = {}, opts: NormalizedFullOptions = defaultOptions, renderOptions: RenderOptions = {}) {\n this.sync = !!renderOptions.sync\n this.opts = opts\n this.globals = renderOptions.globals ?? opts.globals\n this.environments = isObject(env) ? env : Object(env)\n this.strictVariables = renderOptions.strictVariables ?? this.opts.strictVariables\n this.ownPropertyOnly = renderOptions.ownPropertyOnly ?? opts.ownPropertyOnly\n }\n public getRegister (key: string) {\n return (this.registers[key] = this.registers[key] || {})\n }\n public setRegister (key: string, value: any) {\n return (this.registers[key] = value)\n }\n public saveRegister (...keys: string[]): [string, any][] {\n return keys.map(key => [key, this.getRegister(key)])\n }\n public restoreRegister (keyValues: [string, any][]) {\n return keyValues.forEach(([key, value]) => this.setRegister(key, value))\n }\n public getAll () {\n return [this.globals, this.environments, ...this.scopes]\n .reduce((ctx, val) => __assign(ctx, val), {})\n }\n /**\n * @deprecated use `_get()` or `getSync()` instead\n */\n public get (paths: PropertyKey[]): unknown {\n return this.getSync(paths)\n }\n public getSync (paths: PropertyKey[]): unknown {\n return toValueSync(this._get(paths))\n }\n public * _get (paths: PropertyKey[]): IterableIterator {\n const scope = this.findScope(paths[0])\n return yield this._getFromScope(scope, paths)\n }\n /**\n * @deprecated use `_get()` instead\n */\n public getFromScope (scope: unknown, paths: PropertyKey[] | string): IterableIterator {\n return toValueSync(this._getFromScope(scope, paths))\n }\n public * _getFromScope (scope: unknown, paths: PropertyKey[] | string, strictVariables = this.strictVariables): IterableIterator {\n if (isString(paths)) paths = paths.split('.')\n for (let i = 0; i < paths.length; i++) {\n scope = yield readProperty(scope as object, paths[i], this.ownPropertyOnly)\n if (strictVariables && isUndefined(scope)) {\n throw new InternalUndefinedVariableError((paths as string[]).slice(0, i + 1).join!('.'))\n }\n }\n return scope\n }\n public push (ctx: object) {\n return this.scopes.push(ctx)\n }\n public pop () {\n return this.scopes.pop()\n }\n public bottom () {\n return this.scopes[0]\n }\n private findScope (key: string | number) {\n for (let i = this.scopes.length - 1; i >= 0; i--) {\n const candidate = this.scopes[i]\n if (key in candidate) return candidate\n }\n if (key in this.environments) return this.environments\n return this.globals\n }\n}\n\nexport function readProperty (obj: Scope, key: PropertyKey, ownPropertyOnly: boolean) {\n obj = toLiquid(obj)\n if (isNil(obj)) return obj\n if (isArray(obj) && key < 0) return obj[obj.length + +key]\n const value = readJSProperty(obj, key, ownPropertyOnly)\n if (value === undefined && obj instanceof Drop) return obj.liquidMethodMissing(key)\n if (isFunction(value)) return value.call(obj)\n if (key === 'size') return readSize(obj)\n else if (key === 'first') return readFirst(obj)\n else if (key === 'last') return readLast(obj)\n return value\n}\nexport function readJSProperty (obj: Scope, key: PropertyKey, ownPropertyOnly: boolean) {\n if (ownPropertyOnly && !Object.hasOwnProperty.call(obj, key) && !(obj instanceof Drop)) return undefined\n return obj[key]\n}\n\nfunction readFirst (obj: Scope) {\n if (isArray(obj)) return obj[0]\n return obj['first']\n}\n\nfunction readLast (obj: Scope) {\n if (isArray(obj)) return obj[obj.length - 1]\n return obj['last']\n}\n\nfunction readSize (obj: Scope) {\n if (obj.hasOwnProperty('size') || obj['size'] !== undefined) return obj['size']\n if (isArray(obj) || isString(obj)) return obj.length\n if (typeof obj === 'object') return Object.keys(obj).length\n}\n","import { toValue, argumentsToValue } from '../util/underscore'\n\nexport const abs = argumentsToValue(Math.abs)\nexport const at_least = argumentsToValue(Math.max)\nexport const at_most = argumentsToValue(Math.min)\nexport const ceil = argumentsToValue(Math.ceil)\nexport const divided_by = argumentsToValue((dividend: number, divisor: number, integerArithmetic = false) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor)\nexport const floor = argumentsToValue(Math.floor)\nexport const minus = argumentsToValue((v: number, arg: number) => v - arg)\nexport const modulo = argumentsToValue((v: number, arg: number) => v % arg)\nexport const times = argumentsToValue((v: number, arg: number) => v * arg)\n\nexport function round (v: number, arg = 0) {\n v = toValue(v)\n arg = toValue(arg)\n const amp = Math.pow(10, arg)\n return Math.round(v * amp) / amp\n}\n\nexport function plus (v: number, arg: number) {\n v = toValue(v)\n arg = toValue(arg)\n return Number(v) + Number(arg)\n}\n","import { stringify } from '../util/underscore'\n\nexport const url_decode = (x: string) => decodeURIComponent(stringify(x)).replace(/\\+/g, ' ')\nexport const url_encode = (x: string) => encodeURIComponent(stringify(x)).replace(/%20/g, '+')\nexport const cgi_escape = (x: string) => encodeURIComponent(stringify(x))\n .replace(/%20/g, '+')\n .replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase())\nexport const uri_escape = (x: string) => encodeURI(stringify(x))\n .replace(/%5B/g, '[')\n .replace(/%5D/g, ']')\n\nconst rSlugifyDefault = /[^\\p{M}\\p{L}\\p{Nd}]+/ug\nconst rSlugifyReplacers = {\n 'raw': /\\s+/g,\n 'default': rSlugifyDefault,\n 'pretty': /[^\\p{M}\\p{L}\\p{Nd}._~!$&'()+,;=@]+/ug,\n 'ascii': /[^A-Za-z0-9]+/g,\n 'latin': rSlugifyDefault,\n 'none': null\n}\n\nexport function slugify (str: string, mode: keyof typeof rSlugifyReplacers = 'default', cased = false): string {\n str = stringify(str)\n\n const replacer = rSlugifyReplacers[mode]\n if (replacer) {\n if (mode === 'latin') str = removeAccents(str)\n str = str.replace(replacer, '-').replace(/^-|-$/g, '')\n }\n\n return cased ? str : str.toLowerCase()\n}\n\nfunction removeAccents (str: string): string {\n return str.replace(/[àáâãäå]/g, 'a')\n .replace(/[æ]/g, 'ae')\n .replace(/[ç]/g, 'c')\n .replace(/[èéêë]/g, 'e')\n .replace(/[ìíîï]/g, 'i')\n .replace(/[ð]/g, 'd')\n .replace(/[ñ]/g, 'n')\n .replace(/[òóôõöø]/g, 'o')\n .replace(/[ùúûü]/g, 'u')\n .replace(/[ýÿ]/g, 'y')\n .replace(/[ß]/g, 'ss')\n .replace(/[œ]/g, 'oe')\n .replace(/[þ]/g, 'th')\n .replace(/[ẞ]/g, 'SS')\n .replace(/[Œ]/g, 'OE')\n .replace(/[Þ]/g, 'TH')\n}\n","import { toArray, argumentsToValue, toValue, stringify, caseInsensitiveCompare, isArray, isNil, last as arrayLast, hasOwnProperty } from '../util'\nimport { equals, evalToken, isTruthy } from '../render'\nimport { Value, FilterImpl } from '../template'\nimport { Context, Scope } from '../context'\nimport { Tokenizer } from '../parser'\n\nexport const join = argumentsToValue((v: any[], arg: string) => toArray(v).join(arg === undefined ? ' ' : arg))\nexport const last = argumentsToValue((v: any) => isArray(v) ? arrayLast(v) : '')\nexport const first = argumentsToValue((v: any) => isArray(v) ? v[0] : '')\nexport const reverse = argumentsToValue((v: any[]) => [...toArray(v)].reverse())\n\nexport function * sort (this: FilterImpl, arr: T[], property?: string): IterableIterator {\n const values: [T, string | number][] = []\n for (const item of toArray(arr)) {\n values.push([\n item,\n property ? yield this.context._getFromScope(item, stringify(property).split('.'), false) : item\n ])\n }\n return values.sort((lhs, rhs) => {\n const lvalue = lhs[1]\n const rvalue = rhs[1]\n return lvalue < rvalue ? -1 : (lvalue > rvalue ? 1 : 0)\n }).map(tuple => tuple[0])\n}\n\nexport function sort_natural (input: T[], property?: string) {\n const propertyString = stringify(property)\n const compare = property === undefined\n ? caseInsensitiveCompare\n : (lhs: T, rhs: T) => caseInsensitiveCompare(lhs[propertyString], rhs[propertyString])\n return [...toArray(input)].sort(compare)\n}\n\nexport const size = (v: string | any[]) => (v && v.length) || 0\n\nexport function * map (this: FilterImpl, arr: Scope[], property: string): IterableIterator {\n const results = []\n for (const item of toArray(arr)) {\n results.push(yield this.context._getFromScope(item, stringify(property), false))\n }\n return results\n}\n\nexport function * sum (this: FilterImpl, arr: Scope[], property?: string): IterableIterator {\n let sum = 0\n for (const item of toArray(arr)) {\n const data = Number(property ? yield this.context._getFromScope(item, stringify(property), false) : item)\n sum += Number.isNaN(data) ? 0 : data\n }\n return sum\n}\n\nexport function compact (this: FilterImpl, arr: T[]) {\n return toArray(arr).filter(x => !isNil(toValue(x)))\n}\n\nexport function concat (v: T1[], arg: T2[] = []): (T1 | T2)[] {\n return toArray(v).concat(toArray(arg))\n}\n\nexport function push (v: T[], arg: T): T[] {\n return concat(v, [arg])\n}\n\nexport function unshift (v: T[], arg: T): T[] {\n const clone = [...toArray(v)]\n clone.unshift(arg)\n return clone\n}\n\nexport function pop (v: T[]): T[] {\n const clone = [...toArray(v)]\n clone.pop()\n return clone\n}\n\nexport function shift (v: T[]): T[] {\n const clone = [...toArray(v)]\n clone.shift()\n return clone\n}\n\nexport function slice (v: T[] | string, begin: number, length = 1): T[] | string {\n v = toValue(v)\n if (isNil(v)) return []\n if (!isArray(v)) v = stringify(v)\n begin = begin < 0 ? v.length + begin : begin\n return v.slice(begin, begin + length)\n}\n\nexport function * where (this: FilterImpl, arr: T[], property: string, expected?: any): IterableIterator {\n const values: unknown[] = []\n arr = toArray(arr)\n const token = new Tokenizer(stringify(property)).readScopeValue()\n for (const item of arr) {\n values.push(yield evalToken(token, new Context(item)))\n }\n return arr.filter((_, i) => {\n if (expected === undefined) return isTruthy(values[i], this.context)\n return equals(values[i], expected)\n })\n}\n\nexport function * where_exp (this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator {\n const filtered: unknown[] = []\n const keyTemplate = new Value(stringify(exp), this.liquid)\n for (const item of toArray(arr)) {\n const value = yield keyTemplate.value(new Context({ [itemName]: item }))\n if (value) filtered.push(item)\n }\n return filtered\n}\n\nexport function * group_by (arr: T[], property: string): IterableIterator {\n const map = new Map()\n arr = toArray(arr)\n const token = new Tokenizer(stringify(property)).readScopeValue()\n for (const item of arr) {\n const key = yield evalToken(token, new Context(item))\n if (!map.has(key)) map.set(key, [])\n map.get(key).push(item)\n }\n return [...map.entries()].map(([name, items]) => ({ name, items }))\n}\n\nexport function * group_by_exp (this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator {\n const map = new Map()\n const keyTemplate = new Value(stringify(exp), this.liquid)\n for (const item of toArray(arr)) {\n const key = yield keyTemplate.value(new Context({ [itemName]: item }))\n if (!map.has(key)) map.set(key, [])\n map.get(key).push(item)\n }\n return [...map.entries()].map(([name, items]) => ({ name, items }))\n}\n\nexport function * find (this: FilterImpl, arr: T[], property: string, expected: string): IterableIterator {\n const token = new Tokenizer(stringify(property)).readScopeValue()\n for (const item of toArray(arr)) {\n const value = yield evalToken(token, new Context(item))\n if (equals(value, expected)) return item\n }\n return null\n}\n\nexport function * find_exp (this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator {\n const predicate = new Value(stringify(exp), this.liquid)\n for (const item of toArray(arr)) {\n const value = yield predicate.value(new Context({ [itemName]: item }))\n if (value) return item\n }\n return null\n}\n\nexport function uniq (arr: T[]): T[] {\n arr = toValue(arr)\n const u = {}\n return (arr || []).filter(val => {\n if (hasOwnProperty.call(u, String(val))) return false\n u[String(val)] = true\n return true\n })\n}\n\nexport function sample (v: T[] | string, count = 1): T | string | (T | string)[] {\n v = toValue(v)\n if (isNil(v)) return []\n if (!isArray(v)) v = stringify(v)\n const shuffled = [...v].sort(() => Math.random() - 0.5)\n if (count === 1) return shuffled[0]\n return shuffled.slice(0, count)\n}\n","import { toValue, stringify, isString, isNumber, TimezoneDate, LiquidDate, strftime, isNil } from '../util'\nimport { FilterImpl } from '../template'\nimport { LiquidOptions } from '../liquid-options'\n\nexport function date (this: FilterImpl, v: string | Date, format?: string, timezoneOffset?: number | string) {\n const date = parseDate(v, this.context.opts, timezoneOffset)\n if (!date) return v\n format = toValue(format)\n format = isNil(format) ? this.context.opts.dateFormat : stringify(format)\n return strftime(date, format)\n}\n\nexport function date_to_xmlschema (this: FilterImpl, v: string | Date) {\n return date.call(this, v, '%Y-%m-%dT%H:%M:%S%:z')\n}\n\nexport function date_to_rfc822 (this: FilterImpl, v: string | Date) {\n return date.call(this, v, '%a, %d %b %Y %H:%M:%S %z')\n}\n\nexport function date_to_string (this: FilterImpl, v: string | Date, type?: string, style?: string) {\n return stringify_date.call(this, v, '%b', type, style)\n}\n\nexport function date_to_long_string (this: FilterImpl, v: string | Date, type?: string, style?: string) {\n return stringify_date.call(this, v, '%B', type, style)\n}\n\nfunction stringify_date (this: FilterImpl, v: string | Date, month_type: string, type?: string, style?: string) {\n const date = parseDate(v, this.context.opts)\n if (!date) return v\n if (type === 'ordinal') {\n const d = date.getDate()\n return style === 'US'\n ? strftime(date, `${month_type} ${d}%q, %Y`)\n : strftime(date, `${d}%q ${month_type} %Y`)\n }\n return strftime(date, `%d ${month_type} %Y`)\n}\n\nfunction parseDate (v: string | Date, opts: LiquidOptions, timezoneOffset?: number | string): LiquidDate | undefined {\n let date: LiquidDate\n v = toValue(v)\n if (v === 'now' || v === 'today') {\n date = new Date()\n } else if (isNumber(v)) {\n date = new Date(v * 1000)\n } else if (isString(v)) {\n if (/^\\d+$/.test(v)) {\n date = new Date(+v * 1000)\n } else if (opts.preserveTimezones) {\n date = TimezoneDate.createDateFixedToTimezone(v)\n } else {\n date = new Date(v)\n }\n } else {\n date = v\n }\n if (!isValidDate(date)) return\n if (timezoneOffset !== undefined) {\n date = new TimezoneDate(date, timezoneOffset)\n } else if (!(date instanceof TimezoneDate) && opts.timezoneOffset !== undefined) {\n date = new TimezoneDate(date, opts.timezoneOffset)\n }\n return date\n}\n\nfunction isValidDate (date: any): date is Date {\n return (date instanceof Date || date instanceof TimezoneDate) && !isNaN(date.getTime())\n}\n","/**\n * String related filters\n *\n * * prefer stringify() to String() since `undefined`, `null` should eval ''\n */\n\n// Han (Chinese) characters: \\u4E00-\\u9FFF\n// Additional Han characters: \\uF900-\\uFAFF (CJK Compatibility Ideographs)\n// Additional Han characters: \\u3400-\\u4DBF (CJK Unified Ideographs Extension A)\n// Katakana (Japanese): \\u30A0-\\u30FF\n// Hiragana (Japanese): \\u3040-\\u309F\n// Hangul (Korean): \\uAC00-\\uD7AF\nimport { assert, escapeRegExp, stringify } from '../util'\n\nconst rCJKWord = /[\\u4E00-\\u9FFF\\uF900-\\uFAFF\\u3400-\\u4DBF\\u3040-\\u309F\\u30A0-\\u30FF\\uAC00-\\uD7AF]/gu\n\n// Word boundary followed by word characters (for detecting words)\nconst rNonCJKWord = /[^\\u4E00-\\u9FFF\\uF900-\\uFAFF\\u3400-\\u4DBF\\u3040-\\u309F\\u30A0-\\u30FF\\uAC00-\\uD7AF\\s]+/gu\n\nexport function append (v: string, arg: string) {\n assert(arguments.length === 2, 'append expect 2 arguments')\n return stringify(v) + stringify(arg)\n}\n\nexport function prepend (v: string, arg: string) {\n assert(arguments.length === 2, 'prepend expect 2 arguments')\n return stringify(arg) + stringify(v)\n}\n\nexport function lstrip (v: string, chars?: string) {\n if (chars) {\n chars = escapeRegExp(stringify(chars))\n return stringify(v).replace(new RegExp(`^[${chars}]+`, 'g'), '')\n }\n return stringify(v).replace(/^\\s+/, '')\n}\n\nexport function downcase (v: string) {\n return stringify(v).toLowerCase()\n}\n\nexport function upcase (str: string) {\n return stringify(str).toUpperCase()\n}\n\nexport function remove (v: string, arg: string) {\n return stringify(v).split(stringify(arg)).join('')\n}\n\nexport function remove_first (v: string, l: string) {\n return stringify(v).replace(stringify(l), '')\n}\n\nexport function remove_last (v: string, l: string) {\n const str = stringify(v)\n const pattern = stringify(l)\n const index = str.lastIndexOf(pattern)\n if (index === -1) return str\n return str.substring(0, index) + str.substring(index + pattern.length)\n}\n\nexport function rstrip (str: string, chars?: string) {\n if (chars) {\n chars = escapeRegExp(stringify(chars))\n return stringify(str).replace(new RegExp(`[${chars}]+$`, 'g'), '')\n }\n return stringify(str).replace(/\\s+$/, '')\n}\n\nexport function split (v: string, arg: string) {\n const arr = stringify(v).split(stringify(arg))\n // align to ruby split, which is the behavior of shopify/liquid\n // see: https://ruby-doc.org/core-2.4.0/String.html#method-i-split\n while (arr.length && arr[arr.length - 1] === '') arr.pop()\n return arr\n}\n\nexport function strip (v: string, chars?: string) {\n if (chars) {\n chars = escapeRegExp(stringify(chars))\n return stringify(v)\n .replace(new RegExp(`^[${chars}]+`, 'g'), '')\n .replace(new RegExp(`[${chars}]+$`, 'g'), '')\n }\n return stringify(v).trim()\n}\n\nexport function strip_newlines (v: string) {\n return stringify(v).replace(/\\r?\\n/gm, '')\n}\n\nexport function capitalize (str: string) {\n str = stringify(str)\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()\n}\n\nexport function replace (v: string, pattern: string, replacement: string) {\n return stringify(v).split(stringify(pattern)).join(replacement)\n}\n\nexport function replace_first (v: string, arg1: string, arg2: string) {\n return stringify(v).replace(stringify(arg1), arg2)\n}\n\nexport function replace_last (v: string, arg1: string, arg2: string) {\n const str = stringify(v)\n const pattern = stringify(arg1)\n const index = str.lastIndexOf(pattern)\n if (index === -1) return str\n const replacement = stringify(arg2)\n return str.substring(0, index) + replacement + str.substring(index + pattern.length)\n}\n\nexport function truncate (v: string, l = 50, o = '...') {\n v = stringify(v)\n if (v.length <= l) return v\n return v.substring(0, l - o.length) + o\n}\n\nexport function truncatewords (v: string, words = 15, o = '...') {\n const arr = stringify(v).split(/\\s+/)\n if (words <= 0) words = 1\n let ret = arr.slice(0, words).join(' ')\n if (arr.length >= words) ret += o\n return ret\n}\n\nexport function normalize_whitespace (v: string) {\n v = stringify(v)\n return v.replace(/\\s+/g, ' ')\n}\n\nexport function number_of_words (input: string, mode?: 'cjk' | 'auto') {\n input = stringify(input).trim()\n if (!input) return 0\n switch (mode) {\n case 'cjk':\n // Count CJK characters and words\n return (input.match(rCJKWord) || []).length + (input.match(rNonCJKWord) || []).length\n case 'auto':\n // Count CJK characters, if none, count words\n return rCJKWord.test(input)\n ? input.match(rCJKWord)!.length + (input.match(rNonCJKWord) || []).length\n : input.split(/\\s+/).length\n default:\n // Count words only\n return input.split(/\\s+/).length\n }\n}\n\nexport function array_to_sentence_string (array: unknown[], connector = 'and') {\n switch (array.length) {\n case 0:\n return ''\n case 1:\n return array[0]\n case 2:\n return `${array[0]} ${connector} ${array[1]}`\n default:\n return `${array.slice(0, -1).join(', ')}, ${connector} ${array[array.length - 1]}`\n }\n}\n","import * as htmlFilters from './html'\nimport * as mathFilters from './math'\nimport * as urlFilters from './url'\nimport * as arrayFilters from './array'\nimport * as dateFilters from './date'\nimport * as stringFilters from './string'\nimport misc from './misc'\nimport { FilterImplOptions } from '../template'\n\nexport const filters: Record = {\n ...htmlFilters,\n ...mathFilters,\n ...urlFilters,\n ...arrayFilters,\n ...dateFilters,\n ...stringFilters,\n ...misc\n}\n","import { Value, Liquid, TopLevelToken, TagToken, Context, Tag } from '..'\nexport default class extends Tag {\n private key: string\n private value: Value\n\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.key = this.tokenizer.readIdentifier().content\n this.tokenizer.assert(this.key, 'expected variable name')\n\n this.tokenizer.skipBlank()\n this.tokenizer.assert(this.tokenizer.peek() === '=', 'expected \"=\"')\n\n this.tokenizer.advance()\n this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid)\n }\n * render (ctx: Context): Generator {\n ctx.bottom()[this.key] = yield this.value.value(ctx, this.liquid.options.lenientIf)\n }\n}\n","import { Hash, ValueToken, Liquid, Tag, evalToken, Emitter, TagToken, TopLevelToken, Context, Template, ParseStream } from '..'\nimport { toEnumerable } from '../util'\nimport { ForloopDrop } from '../drop/forloop-drop'\n\nconst MODIFIERS = ['offset', 'limit', 'reversed']\n\ntype valueof = T[keyof T]\n\nexport default class extends Tag {\n variable: string\n collection: ValueToken\n hash: Hash\n templates: Template[]\n elseTemplates: Template[]\n\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const variable = this.tokenizer.readIdentifier()\n const inStr = this.tokenizer.readIdentifier()\n const collection = this.tokenizer.readValue()\n if (!variable.size() || inStr.content !== 'in' || !collection) {\n throw new Error(`illegal tag: ${token.getText()}`)\n }\n\n this.variable = variable.content\n this.collection = collection\n this.hash = new Hash(this.tokenizer.remaining())\n this.templates = []\n this.elseTemplates = []\n\n let p\n const stream: ParseStream = this.liquid.parser.parseStream(remainTokens)\n .on('start', () => (p = this.templates))\n .on('tag:else', () => (p = this.elseTemplates))\n .on('tag:endfor', () => stream.stop())\n .on('template', (tpl: Template) => p.push(tpl))\n .on('end', () => {\n throw new Error(`tag ${token.getText()} not closed`)\n })\n\n stream.start()\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n let collection = toEnumerable(yield evalToken(this.collection, ctx))\n\n if (!collection.length) {\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n return\n }\n\n const continueKey = 'continue-' + this.variable + '-' + this.collection.getText()\n ctx.push({ continue: ctx.getRegister(continueKey) })\n const hash = yield this.hash.render(ctx)\n ctx.pop()\n\n const modifiers = this.liquid.options.orderedFilterParameters\n ? Object.keys(hash).filter(x => MODIFIERS.includes(x))\n : MODIFIERS.filter(x => hash[x] !== undefined)\n\n collection = modifiers.reduce((collection, modifier: valueof) => {\n if (modifier === 'offset') return offset(collection, hash['offset'])\n if (modifier === 'limit') return limit(collection, hash['limit'])\n return reversed(collection)\n }, collection)\n\n ctx.setRegister(continueKey, (hash['offset'] || 0) + collection.length)\n const scope = { forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) }\n ctx.push(scope)\n for (const item of collection) {\n scope[this.variable] = item\n yield r.renderTemplates(this.templates, ctx, emitter)\n if (emitter['break']) {\n emitter['break'] = false\n break\n }\n emitter['continue'] = false\n scope.forloop.next()\n }\n ctx.pop()\n }\n}\n\nfunction reversed (arr: Array) {\n return [...arr].reverse()\n}\n\nfunction offset (arr: Array, count: number) {\n return arr.slice(count)\n}\n\nfunction limit (arr: Array, count: number) {\n return arr.slice(0, count)\n}\n","import { Liquid, Tag, Template, Context, TagToken, TopLevelToken } from '..'\nimport { evalQuotedToken } from '../render'\nimport { isTagToken } from '../util'\n\nexport default class extends Tag {\n variable: string\n templates: Template[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n this.variable = this.readVariableName()\n\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endcapture') return\n this.templates.push(liquid.parser.parseToken(token, remainTokens))\n }\n throw new Error(`tag ${tagToken.getText()} not closed`)\n }\n * render (ctx: Context): Generator {\n const r = this.liquid.renderer\n const html = yield r.renderTemplates(this.templates, ctx)\n ctx.bottom()[this.variable] = html\n }\n private readVariableName () {\n const word = this.tokenizer.readIdentifier().content\n if (word) return word\n const quoted = this.tokenizer.readQuoted()\n if (quoted) return evalQuotedToken(quoted)\n throw this.tokenizer.error('invalid capture name')\n }\n}\n","import { ValueToken, Liquid, toValue, evalToken, Value, Emitter, TagToken, TopLevelToken, Context, Template, Tag, ParseStream } from '..'\nimport { equals } from '../render'\n\nexport default class extends Tag {\n value: Value\n branches: { values: ValueToken[], templates: Template[] }[] = []\n elseTemplates: Template[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid)\n this.elseTemplates = []\n\n let p: Template[] = []\n let elseCount = 0\n const stream: ParseStream = this.liquid.parser.parseStream(remainTokens)\n .on('tag:when', (token: TagToken) => {\n if (elseCount > 0) {\n return\n }\n\n p = []\n\n const values: ValueToken[] = []\n while (!token.tokenizer.end()) {\n values.push(token.tokenizer.readValueOrThrow())\n token.tokenizer.skipBlank()\n if (token.tokenizer.peek() === ',') {\n token.tokenizer.readTo(',')\n } else {\n token.tokenizer.readTo('or')\n }\n }\n this.branches.push({\n values,\n templates: p\n })\n })\n .on('tag:else', () => {\n elseCount++\n p = this.elseTemplates\n })\n .on('tag:endcase', () => stream.stop())\n .on('template', (tpl: Template) => {\n if (p !== this.elseTemplates || elseCount === 1) {\n p.push(tpl)\n }\n })\n .on('end', () => {\n throw new Error(`tag ${tagToken.getText()} not closed`)\n })\n\n stream.start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n const target = toValue(yield this.value.value(ctx, ctx.opts.lenientIf))\n let branchHit = false\n for (const branch of this.branches) {\n for (const valueToken of branch.values) {\n const value = yield evalToken(valueToken, ctx, ctx.opts.lenientIf)\n if (equals(target, value)) {\n yield r.renderTemplates(branch.templates, ctx, emitter)\n branchHit = true\n break\n }\n }\n }\n if (!branchHit) {\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n }\n }\n}\n","import { Liquid, TopLevelToken, TagToken, Tag } from '..'\nimport { isTagToken } from '../util'\n\nexport default class extends Tag {\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endcomment') return\n }\n throw new Error(`tag ${tagToken.getText()} not closed`)\n }\n render () {}\n}\n","import { __assign } from 'tslib'\nimport { ForloopDrop } from '../drop'\nimport { toEnumerable } from '../util'\nimport { TopLevelToken, assert, Liquid, Token, Template, evalQuotedToken, TypeGuards, Tokenizer, evalToken, Hash, Emitter, TagToken, Context, Tag } from '..'\n\nexport type ParsedFileName = Template[] | Token | string | undefined\n\nexport default class extends Tag {\n private file: ParsedFileName\n private currentFile?: string\n private hash: Hash\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const tokenizer = this.tokenizer\n this.file = parseFilePath(tokenizer, this.liquid)\n this.currentFile = token.file\n while (!tokenizer.end()) {\n tokenizer.skipBlank()\n const begin = tokenizer.p\n const keyword = tokenizer.readIdentifier()\n if (keyword.content === 'with' || keyword.content === 'for') {\n tokenizer.skipBlank()\n // can be normal key/value pair, like \"with: true\"\n if (tokenizer.peek() !== ':') {\n const value = tokenizer.readValue()\n // can be normal key, like \"with,\"\n if (value) {\n const beforeAs = tokenizer.p\n const asStr = tokenizer.readIdentifier()\n let alias\n if (asStr.content === 'as') alias = tokenizer.readIdentifier()\n else tokenizer.p = beforeAs\n\n this[keyword.content] = { value, alias: alias && alias.content }\n tokenizer.skipBlank()\n if (tokenizer.peek() === ',') tokenizer.advance()\n continue // matched!\n }\n }\n }\n /**\n * restore cursor if with/for not matched\n */\n tokenizer.p = begin\n break\n }\n this.hash = new Hash(tokenizer.remaining())\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const { liquid, hash } = this\n const filepath = (yield renderFilePath(this['file'], ctx, liquid)) as string\n assert(filepath, () => `illegal file path \"${filepath}\"`)\n\n const childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables })\n const scope = childCtx.bottom()\n __assign(scope, yield hash.render(ctx))\n if (this['with']) {\n const { value, alias } = this['with']\n scope[alias || filepath] = yield evalToken(value, ctx)\n }\n\n if (this['for']) {\n const { value, alias } = this['for']\n const collection = toEnumerable(yield evalToken(value, ctx))\n scope['forloop'] = new ForloopDrop(collection.length, value.getText(), alias)\n for (const item of collection) {\n scope[alias] = item\n const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])) as Template[]\n yield liquid.renderer.renderTemplates(templates, childCtx, emitter)\n scope['forloop'].next()\n }\n } else {\n const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])) as Template[]\n yield liquid.renderer.renderTemplates(templates, childCtx, emitter)\n }\n }\n}\n\n/**\n * @return null for \"none\",\n * @return Template[] for quoted with tags and/or filters\n * @return Token for expression (not quoted)\n * @throws TypeError if cannot read next token\n */\nexport function parseFilePath (tokenizer: Tokenizer, liquid: Liquid): ParsedFileName {\n if (liquid.options.dynamicPartials) {\n const file = tokenizer.readValue()\n tokenizer.assert(file, 'illegal file path')\n if (file!.getText() === 'none') return\n if (TypeGuards.isQuotedToken(file)) {\n // for filenames like \"files/{{file}}\", eval as liquid template\n const templates = liquid.parse(evalQuotedToken(file))\n return optimize(templates)\n }\n return file\n }\n const tokens = [...tokenizer.readFileNameTemplate(liquid.options)]\n const templates = optimize(liquid.parser.parseTokens(tokens))\n return templates === 'none' ? undefined : templates\n}\n\nfunction optimize (templates: Template[]): string | Template[] {\n // for filenames like \"files/file.liquid\", extract the string directly\n if (templates.length === 1 && TypeGuards.isHTMLToken(templates[0].token)) return templates[0].token.getContent()\n return templates\n}\n\nexport function * renderFilePath (file: ParsedFileName, ctx: Context, liquid: Liquid): IterableIterator {\n if (typeof file === 'string') return file\n if (Array.isArray(file)) return liquid.renderer.renderTemplates(file, ctx)\n return yield evalToken(file, ctx)\n}\n","import { Template, ValueToken, TopLevelToken, Liquid, Tag, assert, evalToken, Hash, Emitter, TagToken, Context } from '..'\nimport { BlockMode, Scope } from '../context'\nimport { parseFilePath, renderFilePath } from './render'\n\nexport default class extends Tag {\n private withVar?: ValueToken\n private hash: Hash\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const { tokenizer } = token\n this['file'] = parseFilePath(tokenizer, this.liquid)\n this['currentFile'] = token.file\n\n const begin = tokenizer.p\n const withStr = tokenizer.readIdentifier()\n if (withStr.content === 'with') {\n tokenizer.skipBlank()\n if (tokenizer.peek() !== ':') {\n this.withVar = tokenizer.readValue()\n } else tokenizer.p = begin\n } else tokenizer.p = begin\n\n this.hash = new Hash(tokenizer.remaining(), this.liquid.options.jekyllInclude)\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const { liquid, hash, withVar } = this\n const { renderer } = liquid\n const filepath = (yield renderFilePath(this['file'], ctx, liquid)) as string\n assert(filepath, () => `illegal file path \"${filepath}\"`)\n\n const saved = ctx.saveRegister('blocks', 'blockMode')\n ctx.setRegister('blocks', {})\n ctx.setRegister('blockMode', BlockMode.OUTPUT)\n const scope = (yield hash.render(ctx)) as Scope\n if (withVar) scope[filepath] = yield evalToken(withVar, ctx)\n const templates = (yield liquid._parsePartialFile(filepath, ctx.sync, this['currentFile'])) as Template[]\n ctx.push(ctx.opts.jekyllInclude ? { include: scope } : scope)\n yield renderer.renderTemplates(templates, ctx, emitter)\n ctx.pop()\n ctx.restoreRegister(saved)\n }\n}\n","import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..'\nimport { isNumber, stringify } from '../util'\n\nexport default class extends Tag {\n private variable: string\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.variable = this.tokenizer.readIdentifier().content\n }\n render (context: Context, emitter: Emitter) {\n const scope = context.environments\n if (!isNumber(scope[this.variable])) {\n scope[this.variable] = 0\n }\n emitter.write(stringify(--scope[this.variable]))\n }\n}\n","import { TopLevelToken, Liquid, ValueToken, evalToken, Emitter, TagToken, Context, Tag } from '..'\n\nexport default class extends Tag {\n private candidates: ValueToken[] = []\n private group?: ValueToken\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const group = this.tokenizer.readValue()\n this.tokenizer.skipBlank()\n\n if (group) {\n if (this.tokenizer.peek() === ':') {\n this.group = group\n this.tokenizer.advance()\n } else this.candidates.push(group)\n }\n\n while (!this.tokenizer.end()) {\n const value = this.tokenizer.readValue()\n if (value) this.candidates.push(value)\n this.tokenizer.readTo(',')\n }\n this.tokenizer.assert(this.candidates.length, () => `empty candidates: \"${token.getText()}\"`)\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const group = (yield evalToken(this.group, ctx)) as ValueToken\n const fingerprint = `cycle:${group}:` + this.candidates.join(',')\n const groups = ctx.getRegister('cycle')\n let idx = groups[fingerprint]\n\n if (idx === undefined) {\n idx = groups[fingerprint] = 0\n }\n\n const candidate = this.candidates[idx]\n idx = (idx + 1) % this.candidates.length\n groups[fingerprint] = idx\n return yield evalToken(candidate, ctx)\n }\n}\n","import { Liquid, Tag, Value, Emitter, isTruthy, TagToken, TopLevelToken, Context, Template } from '..'\n\nexport default class extends Tag {\n branches: { value: Value, templates: Template[] }[] = []\n elseTemplates: Template[] = []\n\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n let p: Template[] = []\n let elseCount = 0\n liquid.parser.parseStream(remainTokens)\n .on('start', () => this.branches.push({\n value: new Value(tagToken.args, this.liquid),\n templates: (p = [])\n }))\n .on('tag:elsif', (token: TagToken) => {\n if (elseCount > 0) {\n p = []\n return\n }\n this.branches.push({\n value: new Value(token.args, this.liquid),\n templates: (p = [])\n })\n })\n .on('tag:else', () => {\n elseCount++\n p = this.elseTemplates\n })\n .on('tag:endif', function () { this.stop() })\n .on('template', (tpl: Template) => {\n if (p !== this.elseTemplates || elseCount === 1) {\n p.push(tpl)\n }\n })\n .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`) })\n .start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n\n for (const { value, templates } of this.branches) {\n const v = yield value.value(ctx, ctx.opts.lenientIf)\n if (isTruthy(v, ctx)) {\n yield r.renderTemplates(templates, ctx, emitter)\n return\n }\n }\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n }\n}\n","import { isNumber, stringify } from '../util'\nimport { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..'\n\nexport default class extends Tag {\n private variable: string\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.variable = this.tokenizer.readIdentifier().content\n }\n render (context: Context, emitter: Emitter) {\n const scope = context.environments\n if (!isNumber(scope[this.variable])) {\n scope[this.variable] = 0\n }\n const val = scope[this.variable]\n scope[this.variable]++\n emitter.write(stringify(val))\n }\n}\n","import { Scope, Template, Liquid, Tag, assert, Emitter, Hash, TagToken, TopLevelToken, Context } from '..'\nimport { BlockMode } from '../context'\nimport { parseFilePath, renderFilePath, ParsedFileName } from './render'\nimport { BlankDrop } from '../drop'\n\nexport default class extends Tag {\n args: Hash\n templates: Template[]\n file?: ParsedFileName\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.file = parseFilePath(this.tokenizer, this.liquid)\n this['currentFile'] = token.file\n this.args = new Hash(this.tokenizer.remaining())\n this.templates = this.liquid.parser.parseTokens(remainTokens)\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const { liquid, args, file } = this\n const { renderer } = liquid\n if (file === undefined) {\n ctx.setRegister('blockMode', BlockMode.OUTPUT)\n yield renderer.renderTemplates(this.templates, ctx, emitter)\n return\n }\n const filepath = (yield renderFilePath(this.file, ctx, liquid)) as string\n assert(filepath, () => `illegal file path \"${filepath}\"`)\n const templates = (yield liquid._parseLayoutFile(filepath, ctx.sync, this['currentFile'])) as Template[]\n\n // render remaining contents and store rendered results\n ctx.setRegister('blockMode', BlockMode.STORE)\n const html = yield renderer.renderTemplates(this.templates, ctx)\n const blocks = ctx.getRegister('blocks')\n\n // set whole content to anonymous block if anonymous doesn't specified\n if (blocks[''] === undefined) blocks[''] = (parent: BlankDrop, emitter: Emitter) => emitter.write(html)\n ctx.setRegister('blockMode', BlockMode.OUTPUT)\n\n // render the layout file use stored blocks\n ctx.push((yield args.render(ctx)) as Scope)\n yield renderer.renderTemplates(templates, ctx, emitter)\n ctx.pop()\n }\n}\n","import { BlockMode } from '../context'\nimport { isTagToken } from '../util'\nimport { BlockDrop } from '../drop'\nimport { Liquid, TagToken, TopLevelToken, Template, Context, Emitter, Tag } from '..'\n\nexport default class extends Tag {\n block: string\n templates: Template[] = []\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const match = /\\w+/.exec(token.args)\n this.block = match ? match[0] : ''\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endblock') return\n const template = liquid.parser.parseToken(token, remainTokens)\n this.templates.push(template)\n }\n throw new Error(`tag ${token.getText()} not closed`)\n }\n\n * render (ctx: Context, emitter: Emitter) {\n const blockRender = this.getBlockRender(ctx)\n if (ctx.getRegister('blockMode') === BlockMode.STORE) {\n ctx.getRegister('blocks')[this.block] = blockRender\n } else {\n yield blockRender(new BlockDrop(), emitter)\n }\n }\n\n private getBlockRender (ctx: Context) {\n const { liquid, templates } = this\n const renderChild = ctx.getRegister('blocks')[this.block]\n const renderCurrent = function * (superBlock: BlockDrop, emitter: Emitter) {\n // add {{ block.super }} support when rendering\n ctx.push({ block: superBlock })\n yield liquid.renderer.renderTemplates(templates, ctx, emitter)\n ctx.pop()\n }\n return renderChild\n ? (superBlock: BlockDrop, emitter: Emitter) => renderChild(new BlockDrop(() => renderCurrent(superBlock, emitter)), emitter)\n : renderCurrent\n }\n}\n","import { Liquid, TagToken, TopLevelToken, Tag } from '..'\nimport { isTagToken } from '../util'\n\nexport default class extends Tag {\n private tokens: TopLevelToken[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endraw') return\n this.tokens.push(token)\n }\n throw new Error(`tag ${tagToken.getText()} not closed`)\n }\n render () {\n return this.tokens.map((token: TopLevelToken) => token.getText()).join('')\n }\n}\n","import { ForloopDrop } from './forloop-drop'\n\nexport class TablerowloopDrop extends ForloopDrop {\n private cols: number\n public constructor (length: number, cols: number, collection: string, variable: string) {\n super(length, collection, variable)\n this.length = length\n this.cols = cols\n }\n public row () {\n return Math.floor(this.i / this.cols) + 1\n }\n public col0 () {\n return (this.i % this.cols)\n }\n public col () {\n return this.col0() + 1\n }\n public col_first () { // eslint-disable-line\n return this.col0() === 0\n }\n public col_last () { // eslint-disable-line\n return this.col() === this.cols\n }\n}\n","import { toEnumerable } from '../util'\nimport { ValueToken, Liquid, Tag, evalToken, Emitter, Hash, TagToken, TopLevelToken, Context, Template, ParseStream } from '..'\nimport { TablerowloopDrop } from '../drop/tablerowloop-drop'\n\nexport default class extends Tag {\n variable: string\n args: Hash\n templates: Template[]\n collection: ValueToken\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n const variable = this.tokenizer.readIdentifier()\n this.tokenizer.skipBlank()\n\n const predicate = this.tokenizer.readIdentifier()\n const collectionToken = this.tokenizer.readValue()\n if (predicate.content !== 'in' || !collectionToken) {\n throw new Error(`illegal tag: ${tagToken.getText()}`)\n }\n\n this.variable = variable.content\n this.collection = collectionToken\n this.args = new Hash(this.tokenizer.remaining())\n this.templates = []\n\n let p\n const stream: ParseStream = this.liquid.parser.parseStream(remainTokens)\n .on('start', () => (p = this.templates))\n .on('tag:endtablerow', () => stream.stop())\n .on('template', (tpl: Template) => p.push(tpl))\n .on('end', () => {\n throw new Error(`tag ${tagToken.getText()} not closed`)\n })\n\n stream.start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n let collection = toEnumerable(yield evalToken(this.collection, ctx))\n const args = (yield this.args.render(ctx)) as Record\n const offset = args.offset || 0\n const limit = (args.limit === undefined) ? collection.length : args.limit\n\n collection = collection.slice(offset, offset + limit)\n const cols = args.cols || collection.length\n\n const r = this.liquid.renderer\n const tablerowloop = new TablerowloopDrop(collection.length, cols, this.collection.getText(), this.variable)\n const scope = { tablerowloop }\n ctx.push(scope)\n\n for (let idx = 0; idx < collection.length; idx++, tablerowloop.next()) {\n scope[this.variable] = collection[idx]\n if (tablerowloop.col0() === 0) {\n if (tablerowloop.row() !== 1) emitter.write('')\n emitter.write(``)\n }\n emitter.write(``)\n yield r.renderTemplates(this.templates, ctx, emitter)\n emitter.write('')\n }\n if (collection.length) emitter.write('')\n ctx.pop()\n }\n}\n","import { Liquid, Tag, Value, TopLevelToken, Template, Emitter, isTruthy, isFalsy, Context, TagToken } from '..'\n\nexport default class extends Tag {\n branches: { value: Value, test: (val: any, ctx: Context) => boolean, templates: Template[] }[] = []\n elseTemplates: Template[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n let p: Template[] = []\n let elseCount = 0\n this.liquid.parser.parseStream(remainTokens)\n .on('start', () => this.branches.push({\n value: new Value(tagToken.args, this.liquid),\n test: isFalsy,\n templates: (p = [])\n }))\n .on('tag:elsif', (token: TagToken) => {\n if (elseCount > 0) {\n p = []\n return\n }\n this.branches.push({\n value: new Value(token.args, this.liquid),\n test: isTruthy,\n templates: (p = [])\n })\n })\n .on('tag:else', () => {\n elseCount++\n p = this.elseTemplates\n })\n .on('tag:endunless', function () { this.stop() })\n .on('template', (tpl: Template) => {\n if (p !== this.elseTemplates || elseCount === 1) {\n p.push(tpl)\n }\n })\n .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`) })\n .start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n\n for (const { value, test, templates } of this.branches) {\n const v = yield value.value(ctx, ctx.opts.lenientIf)\n if (test(v, ctx)) {\n yield r.renderTemplates(templates, ctx, emitter)\n return\n }\n }\n\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n }\n}\n","import { Context, Emitter, Tag } from '..'\n\nexport default class extends Tag {\n render (ctx: Context, emitter: Emitter) {\n emitter['break'] = true\n }\n}\n","import { Tag, Emitter, Context } from '..'\n\nexport default class extends Tag {\n render (ctx: Context, emitter: Emitter) {\n emitter['continue'] = true\n }\n}\n","import { Liquid, TopLevelToken, Emitter, Value, TagToken, Context, Tag } from '..'\n\nexport default class extends Tag {\n private value?: Value\n\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.tokenizer.skipBlank()\n if (!this.tokenizer.end()) {\n this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid)\n }\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n if (!this.value) return\n const val = yield this.value.value(ctx, false)\n emitter.write(val)\n }\n}\n","import { Template, Emitter, Liquid, TopLevelToken, TagToken, Context, Tag } from '..'\n\nexport default class extends Tag {\n templates: Template[]\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const tokens = this.tokenizer.readLiquidTagTokens(this.liquid.options)\n this.templates = this.liquid.parser.parseTokens(tokens)\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n yield this.liquid.renderer.renderTemplates(this.templates, ctx, emitter)\n }\n}\n","import { TagToken, Liquid, TopLevelToken, Tag } from '..'\n\nexport default class extends Tag {\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n if (tagToken.args.search(/\\n\\s*[^#\\s]/g) !== -1) {\n throw new Error('every line of an inline comment must start with a \\'#\\' character')\n }\n }\n render () { }\n}\n","import AssignTag from './assign'\nimport ForTag from './for'\nimport CaptureTag from './capture'\nimport CaseTag from './case'\nimport CommentTag from './comment'\nimport IncludeTag from './include'\nimport RenderTag from './render'\nimport DecrementTag from './decrement'\nimport CycleTag from './cycle'\nimport IfTag from './if'\nimport IncrementTag from './increment'\nimport LayoutTag from './layout'\nimport BlockTag from './block'\nimport RawTag from './raw'\nimport TablerowTag from './tablerow'\nimport UnlessTag from './unless'\nimport BreakTag from './break'\nimport ContinueTag from './continue'\nimport EchoTag from './echo'\nimport LiquidTag from './liquid'\nimport InlineCommentTag from './inline-comment'\nimport type { TagClass } from '../template/tag'\n\nexport const tags: Record = {\n assign: AssignTag,\n 'for': ForTag,\n capture: CaptureTag,\n 'case': CaseTag,\n comment: CommentTag,\n include: IncludeTag,\n render: RenderTag,\n decrement: DecrementTag,\n increment: IncrementTag,\n cycle: CycleTag,\n 'if': IfTag,\n layout: LayoutTag,\n block: BlockTag,\n raw: RawTag,\n tablerow: TablerowTag,\n unless: UnlessTag,\n 'break': BreakTag,\n 'continue': ContinueTag,\n echo: EchoTag,\n liquid: LiquidTag,\n '#': InlineCommentTag\n}\n\nexport { AssignTag, ForTag, CaptureTag, CaseTag, CommentTag, IncludeTag, RenderTag, DecrementTag, IncrementTag, CycleTag, IfTag, LayoutTag, BlockTag, RawTag, TablerowTag, UnlessTag, BreakTag, ContinueTag, EchoTag, LiquidTag, InlineCommentTag }\n","import { Context } from './context'\nimport { toPromise, toValueSync, isFunction, forOwn } from './util'\nimport { TagClass, createTagClass, TagImplOptions, FilterImplOptions, Template, Value } from './template'\nimport { LookupType } from './fs/loader'\nimport { Render } from './render'\nimport { Parser } from './parser'\nimport { tags } from './tags'\nimport { filters } from './filters'\nimport { LiquidOptions, normalizeDirectoryList, NormalizedFullOptions, normalize, RenderOptions, RenderFileOptions } from './liquid-options'\n\nexport class Liquid {\n public readonly options: NormalizedFullOptions\n public readonly renderer = new Render()\n public readonly parser: Parser\n public readonly filters: Record = {}\n public readonly tags: Record = {}\n\n public constructor (opts: LiquidOptions = {}) {\n this.options = normalize(opts)\n this.parser = new Parser(this)\n forOwn(tags, (conf: TagClass, name: string) => this.registerTag(name, conf))\n forOwn(filters, (handler: FilterImplOptions, name: string) => this.registerFilter(name, handler))\n }\n public parse (html: string, filepath?: string): Template[] {\n return this.parser.parse(html, filepath)\n }\n\n public _render (tpl: Template[], scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator {\n const ctx = scope instanceof Context ? scope : new Context(scope, this.options, renderOptions)\n return this.renderer.renderTemplates(tpl, ctx)\n }\n public async render (tpl: Template[], scope?: object, renderOptions?: RenderOptions): Promise {\n return toPromise(this._render(tpl, scope, { ...renderOptions, sync: false }))\n }\n public renderSync (tpl: Template[], scope?: object, renderOptions?: RenderOptions): any {\n return toValueSync(this._render(tpl, scope, { ...renderOptions, sync: true }))\n }\n public renderToNodeStream (tpl: Template[], scope?: object, renderOptions: RenderOptions = {}): NodeJS.ReadableStream {\n const ctx = new Context(scope, this.options, renderOptions)\n return this.renderer.renderTemplatesToNodeStream(tpl, ctx)\n }\n\n public _parseAndRender (html: string, scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator {\n const tpl = this.parse(html)\n return this._render(tpl, scope, renderOptions)\n }\n public async parseAndRender (html: string, scope?: Context | object, renderOptions?: RenderOptions): Promise {\n return toPromise(this._parseAndRender(html, scope, { ...renderOptions, sync: false }))\n }\n public parseAndRenderSync (html: string, scope?: Context | object, renderOptions?: RenderOptions): any {\n return toValueSync(this._parseAndRender(html, scope, { ...renderOptions, sync: true }))\n }\n\n public _parsePartialFile (file: string, sync?: boolean, currentFile?: string) {\n return this.parser.parseFile(file, sync, LookupType.Partials, currentFile)\n }\n public _parseLayoutFile (file: string, sync?: boolean, currentFile?: string) {\n return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile)\n }\n public _parseFile (file: string, sync?: boolean, lookupType?: LookupType, currentFile?: string): Generator {\n return this.parser.parseFile(file, sync, lookupType, currentFile)\n }\n public async parseFile (file: string, lookupType?: LookupType): Promise {\n return toPromise(this.parser.parseFile(file, false, lookupType))\n }\n public parseFileSync (file: string, lookupType?: LookupType): Template[] {\n return toValueSync(this.parser.parseFile(file, true, lookupType))\n }\n public * _renderFile (file: string, ctx: Context | object | undefined, renderFileOptions: RenderFileOptions): Generator {\n const templates = (yield this._parseFile(file, renderFileOptions.sync, renderFileOptions.lookupType)) as Template[]\n return yield this._render(templates, ctx, renderFileOptions)\n }\n public async renderFile (file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions) {\n return toPromise(this._renderFile(file, ctx, { ...renderFileOptions, sync: false }))\n }\n public renderFileSync (file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions) {\n return toValueSync(this._renderFile(file, ctx, { ...renderFileOptions, sync: true }))\n }\n public async renderFileToNodeStream (file: string, scope?: object, renderOptions?: RenderOptions) {\n const templates = await this.parseFile(file)\n return this.renderToNodeStream(templates, scope, renderOptions)\n }\n\n public _evalValue (str: string, scope?: object | Context): IterableIterator {\n const value = new Value(str, this)\n const ctx = scope instanceof Context ? scope : new Context(scope, this.options)\n return value.value(ctx)\n }\n public async evalValue (str: string, scope?: object | Context): Promise {\n return toPromise(this._evalValue(str, scope))\n }\n public evalValueSync (str: string, scope?: object | Context): any {\n return toValueSync(this._evalValue(str, scope))\n }\n\n public registerFilter (name: string, filter: FilterImplOptions) {\n this.filters[name] = filter\n }\n public registerTag (name: string, tag: TagClass | TagImplOptions) {\n this.tags[name] = isFunction(tag) ? tag : createTagClass(tag)\n }\n public plugin (plugin: (this: Liquid, L: typeof Liquid) => void) {\n return plugin.call(this, Liquid)\n }\n public express () {\n const self = this // eslint-disable-line\n let firstCall = true\n\n return function (this: any, filePath: string, ctx: object, callback: (err: Error | null, rendered: string) => void) {\n if (firstCall) {\n firstCall = false\n const dirs = normalizeDirectoryList(this.root)\n self.options.root.unshift(...dirs)\n self.options.layouts.unshift(...dirs)\n self.options.partials.unshift(...dirs)\n }\n self.renderFile(filePath, ctx).then(html => callback(null, html) as any, callback as any)\n }\n }\n}\n","import { isFunction } from '../util'\nimport { Hash } from './hash'\nimport { Tag, TagClass, TagRenderReturn } from './tag'\nimport { TagToken, TopLevelToken } from '../tokens'\nimport { Emitter } from '../emitters'\nimport { Context } from '../context'\nimport type { Liquid } from '../liquid'\n\nexport interface TagImplOptions {\n [key: string]: any\n parse?: (this: Tag & TagImplOptions, token: TagToken, remainingTokens: TopLevelToken[]) => void;\n render: (this: Tag & TagImplOptions, ctx: Context, emitter: Emitter, hash: Record) => TagRenderReturn;\n}\n\nexport function createTagClass (options: TagImplOptions): TagClass {\n return class extends Tag {\n constructor (token: TagToken, tokens: TopLevelToken[], liquid: Liquid) {\n super(token, tokens, liquid)\n if (isFunction(options.parse)) {\n options.parse.call(this, token, tokens)\n }\n }\n * render (ctx: Context, emitter: Emitter): TagRenderReturn {\n const hash = (yield new Hash(this.token.args).render(ctx)) as Record\n return yield options.render.call(this, ctx, emitter, hash)\n }\n }\n}\n","/* istanbul ignore file */\nexport const version = '[VI]{version}[/VI]'\nexport * as TypeGuards from './util/type-guards'\nexport { toValue, TimezoneDate, createTrie, Trie, toPromise, toValueSync, assert, LiquidError, ParseError, RenderError, UndefinedVariableError, TokenizationError, AssertionError } from './util'\nexport { Drop } from './drop'\nexport { Emitter } from './emitters'\nexport { defaultOperators, Operators, evalToken, evalQuotedToken, Expression, isFalsy, isTruthy } from './render'\nexport { Context, Scope } from './context'\nexport { Value, Hash, Template, FilterImplOptions, Tag, Filter, Output } from './template'\nexport { Token, TopLevelToken, TagToken, ValueToken } from './tokens'\nexport { TokenKind, Tokenizer, ParseStream } from './parser'\nexport { filters } from './filters'\nexport * from './tags'\nexport { defaultOptions, LiquidOptions } from './liquid-options'\nexport { FS } from './fs'\nexport { Liquid } from './liquid'\n"],"names":["Token","this","input","slice","begin","end","_a","__read","row","col","i","kind","file","Drop","key","toString","Object","prototype","toLowerCase","String","hasOwnProperty","isString","value","isFunction","isIterator","val","next","throw","return","stringify","toValue","isNil","isArray","map","join","toEnumerable","length","isObject","Symbol","iterator","Array","from","keys","toArray","valueOf","isNumber","call","forOwn","obj","iteratee","k","last","arr","type","range","start","stop","step","push","padStart","str","ch","pad","add","n","identify","caseInsensitiveCompare","a","b","argumentsToValue","fn","_i","args","escapeRegExp","text","replace","TRAIT","__extends","Error","LiquidError","line","lines","msg","token","defineProperty","getPosition","split","Math","max","min","_\r\n .range","lineNumber","rowIndicator","num","_.padStart","colIndicator","enumerable","message","stack","context","originalError","err","_super","_this","name","update","RenderError","tpl","LiquidErrors","errors","s","variableName","TYPES","WORD","BLANK","INLINE_BLANK","isWord","char","code","charCodeAt","assert","predicate","AssertionError","NullDrop","EmptyDrop","BlankDrop","test","equals","ForloopDrop","JSON","collection","variable","BlockDrop","superBlockRender","isComparable","arg","gt","geq","lt","leq","nil","literalValues","true","false","null","empty","blank","createTrie","trie","_b","__values","entries","_d","name_1","data","node","c","needBoundary","toPromise","done","state","then","err_1","toValueSync","rFormat","monthNames","dayNames","monthNamesShort","abbr","dayNamesShort","daysInMonth","d","year","getFullYear","getDayOfYear","getMonth","getDate","getWeekOfYear","startDay","now","getDay","Date","floor","padWidths","e","H","I","j","l","L","m","M","S","U","W","padChars","A","B","p","P","getTimezoneOffset","opts","nOffset","abs","h","flags","formatCodes","toLocaleString","C","parseInt","substring","getHours","getMilliseconds","getMinutes","N","width","Number","q","date","includes","round","getTime","getSeconds","u","w","x","toLocaleDateString","X","toLocaleTimeString","y","Y","z","Z","getTimezoneName","Intl","DateTimeFormat","resolvedOptions","timeZone","t","%","strftime","formatStr","match","output","remaining","exec","index","_c","flagStr","modifier","conversion","convert","flagStr_1","flag","ret","padChar","padWidth","toUpperCase","__spreadArray","some","ISO8601_TIMEZONE_PATTERN","TimezoneDate","displayDate","locale","init","timezoneOffset","timezoneName","dateString","hours","offset","sign","minutes","localDateString","utcDateString","localDate","timezone","diff","time","DelimitedToken","contentRange","trimLeft","trimRight","contentBegin","contentEnd","tl","tr","r","TagToken","tokenizer","options","trimTagLeft","trimTagRight","tagDelimiterLeft","tagDelimiterRight","valueBegin","valueEnd","TokenKind","Tag","Tokenizer","operators","readTagName","skipBlank","trimOutputLeft","trimOutputRight","outputDelimiterLeft","outputDelimiterRight","valueRange","Output","HTMLToken","HTML","content","getText","IdentifierToken","allowSign","Word","Literal","literal","operatorPrecedences","==","!=",">","<",">=","<=","contains","not","and","or","operatorTypes","OperatorToken","Operator","operator","props","PropertyAccess","Filter","Hash","rHex","rOct","escapeChar","f","v","hexVal","Quoted","undefined","fromCharCode","lhs","rhs","Range","initial","filters","FilteredValue","SimpleEmitter","html","buffer","KeepingTypeEmitter","Render","templates","ctx","emitter","StreamedEmitter","Promise","resolve","renderTemplates","error","stream","keepOutputType","templates_1","render","write","is","e_1","catchAllErrors","Expression","lenient","operands","postfix","isOperatorToken","pop","result","_f","evalToken","tokens","ops","tokens_1","getPrecedence","isPropertyAccessToken","prop","_getFromScope","_get","e_3","UndefinedVariableError","isRangeToken","low","high","evalQuotedToken","isTruthy","isFalsy","jsTruthy","defaultOperators","indexOf","prev","LRU","cache","Node","head","size","ensureLimit","remove","tail","limit","domResolve","root","path","base","document","createElement","href","getElementsByTagName","insertBefore","firstChild","resolved","removeChild","filepath","ext","origin","url","reject","xhr","XMLHttpRequest","onload","status","responseText","statusText","onerror","open","send","json","space","default","defaultValue","Map","get","raw","handler","jsonify","to_integer","inspect","ancestors","_key","escapeMap","&","\"","'","unescapeMap","&","<",">",""","'","escape","defaultOptions","layouts","partials","relativeReference","jekyllInclude","extname","fs","dynamicPartials","dateFormat","greedy","preserveTimezones","strictFilters","strictVariables","ownPropertyOnly","lenientIf","globals","normalize","nameOrFunction","dirname","sep","console","warn","normalizeDirectoryList","outputEscape","misc","list","whiteSpaceCtrl","inRaw","isDelimitedToken","mask","isHTMLToken","isTagToken","charAt","readExpressionTokens","readOperator","operand","readValue","matchTrie","opTrie","info","peek","readExpression","valid","snapshot","readFilters","FilteredValueToken","filter","readFilter","readIdentifier","readFilterArg","FilterToken","readTopLevelToken","rawBeginAt","readEndrawOrRawContent","readTagToken","readOutputToken","readHTMLToken","stopStrings","readToDelimiter","delimiter","respectQuoted","peekType","readQuoted","rmatch","OutputToken","leftPos","readTo","readLiquidTagToken","LiquidTagToken","pos","TokenizationError","pred","id","jekyllStyle","hashes","hash","readHash","readNonEmptyIdentifier","HashToken","readLiteral","readRange","readNumber","readProperties","PropertyAccessToken","isBegin","decimalFound","digitFound","NumberToken","advance","literalTrie","LiteralToken","readValueOrThrow","RangeToken","escaped","QuotedToken","htmlStopStrings","htmlStopStringSet","Set","has","word","pattern","ParseStream","cb","handlers","event","template","trigger","stopRequested","shift","parseToken","TemplateImpl","remainTokens","liquid","_e","_g","markup","readHashes","argv","_j","apply","Value","evaluate","impl","readFilteredValue","getFilter","LookupType","getContent","Loader","sync","currentFile","dirs","candidates","Root","existsSync","exists","lookupError","enforceRoot","shouldLoadRelative","referenced","dirs_1","dir","dirs_2","fallback","roots","rRelativePath_1","RegExp","prefix","referencedFile","Parser","readTopLevelTokens","parseTokens","TagClass","tags","isOutputToken","ParseError","loader","read","tpls","task","_parseFile","taskOrTpl","lookup","parse","readFileSync","readFile","parseFile","_parseFileCached","getKind","Delimited","isQuotedToken","BlockMode","Context","registers","getRegister","keyValues","forEach","setRegister","environments","scopes","reduce","__assign","paths","getSync","scope","findScope","toLiquid","liquidMethodMissing","InternalUndefinedVariableError","candidate","env","renderOptions","at_least","at_most","ceil","divided_by","dividend","divisor","integerArithmetic","minus","modulo","times","amp","pow","rSlugifyDefault","rSlugifyReplacers","pretty","ascii","latin","none","decodeURIComponent","encodeURIComponent","encodeURI","mode","cased","replacer","arrayLast","first","reverse","concat","property","values","item","_h","sort","lvalue","rvalue","tuple","propertyString","compare","results","sum","isNaN","clone","unshift","expected","readScopeValue","arr_1","_","itemName","exp","filtered","keyTemplate","arr_2","set","items","count","shuffled","random","format","parseDate","stringify_date","month_type","style","createDateFixedToTimezone","rCJKWord","rNonCJKWord","arguments","chars","lastIndexOf","trim","replacement","arg1","arg2","o","words","array","connector","htmlFilters","mathFilters","urlFilters","arrayFilters","dateFilters","stringFilters","default_1","bottom","MODIFIERS","renderer","elseTemplates","continueKey","continue","modifiers","orderedFilterParameters","forloop","collection_1","inStr","parser","parseStream","on","quoted","tagToken","readVariableName","target","branchHit","branches","branch","elseCount","renderFilePath","_k","childCtx","alias","_parsePartialFile","parseFilePath","keyword","beforeAs","TypeGuards.isQuotedToken","optimize","readFileNameTemplate","TypeGuards.isHTMLToken","withVar","saved","saveRegister","OUTPUT","include","restoreRegister","group","fingerprint","groups","idx","_parseLayoutFile","STORE","blocks","parent","blockRender","getBlockRender","block","renderCurrent","superBlock","renderChild","token_1","TablerowloopDrop","cols","col0","tablerowloop","collectionToken","test_1","readLiquidTagTokens","search","assign","AssignTag","for","ForTag","capture","CaptureTag","case","CaseTag","comment","CommentTag","IncludeTag","RenderTag","decrement","DecrementTag","increment","IncrementTag","cycle","CycleTag","if","IfTag","layout","LayoutTag","BlockTag","RawTag","tablerow","TablerowTag","unless","UnlessTag","break","BreakTag","ContinueTag","echo","EchoTag","LiquidTag","#","InlineCommentTag","Liquid","_render","renderTemplatesToNodeStream","_parseAndRender","Partials","Layouts","lookupType","renderFileOptions","_renderFile","renderToNodeStream","_evalValue","tag","class_1","plugin","self","firstCall","filePath","callback","renderFile","conf","registerTag","registerFilter"],"mappings":"o5FAUSA,oBAAP,WACE,OAAOC,KAAKC,MAAMC,MAAMF,KAAKG,MAAOH,KAAKI,GAAG,GAEvCL,wBAAP,WAEE,IADI,IAAAM,EAAAC,EAAa,CAAC,EAAG,MAAhBC,OAAKC,OACDC,EAAI,EAAGA,EAAIT,KAAKG,MAAOM,CAAC,GACT,OAAlBT,KAAKC,MAAMQ,IACbF,CAAG,GACHC,EAAM,GACDA,CAAG,GAEZ,MAAO,CAACD,EAAKC,IAERT,iBAAP,WACE,OAAOC,KAAKI,IAAMJ,KAAKG,eArBzB,WACSO,EACAT,EACAE,EACAC,EACAO,GAJAX,UAAAU,EACAV,WAAAC,EACAD,WAAAG,EACAH,SA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,GAAS,SAAC8F,EAA4BnV,GAAiB,OAAAD,EAAK+uB,eAAe9uB,EAAMmV,CAAO,EAAC,m0BEpB7E"} \ No newline at end of file diff --git a/node_modules/liquidjs/dist/liquid.browser.umd.js b/node_modules/liquidjs/dist/liquid.browser.umd.js new file mode 100644 index 0000000..352a5a2 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid.browser.umd.js @@ -0,0 +1,5618 @@ +/* + * liquidjs@10.14.0, https://github.com/harttle/liquidjs + * (c) 2016-2024 harttle + * Released under the MIT License. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.liquidjs = {})); +}(this, (function (exports) { 'use strict'; + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + + function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + } + + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + var Token = /** @class */ (function () { + function Token(kind, input, begin, end, file) { + this.kind = kind; + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + } + Token.prototype.getText = function () { + return this.input.slice(this.begin, this.end); + }; + Token.prototype.getPosition = function () { + var _a = __read([1, 1], 2), row = _a[0], col = _a[1]; + for (var i = 0; i < this.begin; i++) { + if (this.input[i] === '\n') { + row++; + col = 1; + } + else + col++; + } + return [row, col]; + }; + Token.prototype.size = function () { + return this.end - this.begin; + }; + return Token; + }()); + + var Drop = /** @class */ (function () { + function Drop() { + } + Drop.prototype.liquidMethodMissing = function (key) { + return undefined; + }; + return Drop; + }()); + + var toString$1 = Object.prototype.toString; + var toLowerCase = String.prototype.toLowerCase; + var hasOwnProperty = Object.hasOwnProperty; + function isString(value) { + return typeof value === 'string'; + } + // eslint-disable-next-line @typescript-eslint/ban-types + function isFunction(value) { + return typeof value === 'function'; + } + function isPromise(val) { + return val && isFunction(val.then); + } + function isIterator(val) { + return val && isFunction(val.next) && isFunction(val.throw) && isFunction(val.return); + } + function escapeRegex(str) { + return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + function stringify(value) { + value = toValue(value); + if (isString(value)) + return value; + if (isNil(value)) + return ''; + if (isArray(value)) + return value.map(function (x) { return stringify(x); }).join(''); + return String(value); + } + function toEnumerable(val) { + val = toValue(val); + if (isArray(val)) + return val; + if (isString(val) && val.length > 0) + return [val]; + if (isIterable(val)) + return Array.from(val); + if (isObject(val)) + return Object.keys(val).map(function (key) { return [key, val[key]]; }); + return []; + } + function toArray(val) { + val = toValue(val); + if (isNil(val)) + return []; + if (isArray(val)) + return val; + return [val]; + } + function toValue(value) { + return (value instanceof Drop && isFunction(value.valueOf)) ? value.valueOf() : value; + } + function isNumber(value) { + return typeof value === 'number'; + } + function toLiquid(value) { + if (value && isFunction(value.toLiquid)) + return toLiquid(value.toLiquid()); + return value; + } + function isNil(value) { + return value == null; + } + function isUndefined(value) { + return value === undefined; + } + function isArray(value) { + // be compatible with IE 8 + return toString$1.call(value) === '[object Array]'; + } + function isIterable(value) { + return isObject(value) && Symbol.iterator in value; + } + /* + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * The iteratee is invoked with three arguments: (value, key, object). + * Iteratee functions may exit iteration early by explicitly returning false. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @return {Object} Returns object. + */ + function forOwn(obj, iteratee) { + obj = obj || {}; + for (var k in obj) { + if (hasOwnProperty.call(obj, k)) { + if (iteratee(obj[k], k, obj) === false) + break; + } + } + return obj; + } + function last(arr) { + return arr[arr.length - 1]; + } + /* + * Checks if value is the language type of Object. + * (e.g. arrays, functions, objects, regexes, new Number(0), and new String('')) + * @param {any} value The value to check. + * @return {Boolean} Returns true if value is an object, else false. + */ + function isObject(value) { + var type = typeof value; + return value !== null && (type === 'object' || type === 'function'); + } + function range(start, stop, step) { + if (step === void 0) { step = 1; } + var arr = []; + for (var i = start; i < stop; i += step) { + arr.push(i); + } + return arr; + } + function padStart(str, length, ch) { + if (ch === void 0) { ch = ' '; } + return pad(str, length, ch, function (str, ch) { return ch + str; }); + } + function padEnd(str, length, ch) { + if (ch === void 0) { ch = ' '; } + return pad(str, length, ch, function (str, ch) { return str + ch; }); + } + function pad(str, length, ch, add) { + str = String(str); + var n = length - str.length; + while (n-- > 0) + str = add(str, ch); + return str; + } + function identify(val) { + return val; + } + function changeCase(str) { + var hasLowerCase = __spreadArray([], __read(str), false).some(function (ch) { return ch >= 'a' && ch <= 'z'; }); + return hasLowerCase ? str.toUpperCase() : str.toLowerCase(); + } + function ellipsis(str, N) { + return str.length > N ? str.slice(0, N - 3) + '...' : str; + } + // compare string in case-insensitive way, undefined values to the tail + function caseInsensitiveCompare(a, b) { + if (a == null && b == null) + return 0; + if (a == null) + return 1; + if (b == null) + return -1; + a = toLowerCase.call(a); + b = toLowerCase.call(b); + if (a < b) + return -1; + if (a > b) + return 1; + return 0; + } + function argumentsToValue(fn) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fn.apply(void 0, __spreadArray([], __read(args.map(toValue)), false)); + }; + } + function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + } + + /** + * targeting ES5, extends Error won't create a proper prototype chain, need a trait to keep track of classes + */ + var TRAIT = '__liquidClass__'; + var LiquidError = /** @class */ (function (_super) { + __extends(LiquidError, _super); + function LiquidError(err, token) { + var _this = + /** + * note: for ES5 targeting, `this` will be replaced by return value of Error(), + * thus everything on `this` will be lost, avoid calling `LiquidError` methods here + */ + _super.call(this, typeof err === 'string' ? err : err.message) || this; + _this.context = ''; + if (typeof err !== 'string') + Object.defineProperty(_this, 'originalError', { value: err, enumerable: false }); + Object.defineProperty(_this, 'token', { value: token, enumerable: false }); + Object.defineProperty(_this, TRAIT, { value: 'LiquidError', enumerable: false }); + return _this; + } + LiquidError.prototype.update = function () { + Object.defineProperty(this, 'context', { value: mkContext(this.token), enumerable: false }); + this.message = mkMessage(this.message, this.token); + this.stack = this.message + '\n' + this.context + + '\n' + this.stack; + if (this.originalError) + this.stack += '\nFrom ' + this.originalError.stack; + }; + LiquidError.is = function (obj) { + return (obj === null || obj === void 0 ? void 0 : obj[TRAIT]) === 'LiquidError'; + }; + return LiquidError; + }(Error)); + var TokenizationError = /** @class */ (function (_super) { + __extends(TokenizationError, _super); + function TokenizationError(message, token) { + var _this = _super.call(this, message, token) || this; + _this.name = 'TokenizationError'; + _super.prototype.update.call(_this); + return _this; + } + return TokenizationError; + }(LiquidError)); + var ParseError = /** @class */ (function (_super) { + __extends(ParseError, _super); + function ParseError(err, token) { + var _this = _super.call(this, err, token) || this; + _this.name = 'ParseError'; + _this.message = err.message; + _super.prototype.update.call(_this); + return _this; + } + return ParseError; + }(LiquidError)); + var RenderError = /** @class */ (function (_super) { + __extends(RenderError, _super); + function RenderError(err, tpl) { + var _this = _super.call(this, err, tpl.token) || this; + _this.name = 'RenderError'; + _this.message = err.message; + _super.prototype.update.call(_this); + return _this; + } + RenderError.is = function (obj) { + return obj.name === 'RenderError'; + }; + return RenderError; + }(LiquidError)); + var LiquidErrors = /** @class */ (function (_super) { + __extends(LiquidErrors, _super); + function LiquidErrors(errors) { + var _this = _super.call(this, errors[0], errors[0].token) || this; + _this.errors = errors; + _this.name = 'LiquidErrors'; + var s = errors.length > 1 ? 's' : ''; + _this.message = "".concat(errors.length, " error").concat(s, " found"); + _super.prototype.update.call(_this); + return _this; + } + LiquidErrors.is = function (obj) { + return obj.name === 'LiquidErrors'; + }; + return LiquidErrors; + }(LiquidError)); + var UndefinedVariableError = /** @class */ (function (_super) { + __extends(UndefinedVariableError, _super); + function UndefinedVariableError(err, token) { + var _this = _super.call(this, err, token) || this; + _this.name = 'UndefinedVariableError'; + _this.message = err.message; + _super.prototype.update.call(_this); + return _this; + } + return UndefinedVariableError; + }(LiquidError)); + // only used internally; raised where we don't have token information, + // so it can't be an UndefinedVariableError. + var InternalUndefinedVariableError = /** @class */ (function (_super) { + __extends(InternalUndefinedVariableError, _super); + function InternalUndefinedVariableError(variableName) { + var _this = _super.call(this, "undefined variable: ".concat(variableName)) || this; + _this.name = 'InternalUndefinedVariableError'; + _this.variableName = variableName; + return _this; + } + return InternalUndefinedVariableError; + }(Error)); + var AssertionError = /** @class */ (function (_super) { + __extends(AssertionError, _super); + function AssertionError(message) { + var _this = _super.call(this, message) || this; + _this.name = 'AssertionError'; + _this.message = message + ''; + return _this; + } + return AssertionError; + }(Error)); + function mkContext(token) { + var _a = __read(token.getPosition(), 2), line = _a[0], col = _a[1]; + var lines = token.input.split('\n'); + var begin = Math.max(line - 2, 1); + var end = Math.min(line + 3, lines.length); + var context = range(begin, end + 1) + .map(function (lineNumber) { + var rowIndicator = (lineNumber === line) ? '>> ' : ' '; + var num = padStart(String(lineNumber), String(end).length); + var text = "".concat(rowIndicator).concat(num, "| "); + var colIndicator = lineNumber === line + ? '\n' + padStart('^', col + text.length) + : ''; + text += lines[lineNumber - 1]; + text += colIndicator; + return text; + }) + .join('\n'); + return context; + } + function mkMessage(msg, token) { + if (token.file) + msg += ", file:".concat(token.file); + var _a = __read(token.getPosition(), 2), line = _a[0], col = _a[1]; + msg += ", line:".concat(line, ", col:").concat(col); + return msg; + } + + // **DO NOT CHANGE THIS FILE** + // + // This file is generated by bin/character-gen.js + // bitmask character types to boost performance + var TYPES = [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 4, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 8, 0, 0, 0, 0, 8, 0, 0, 0, 64, 0, 65, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]; + var WORD = 1; + var BLANK = 4; + var QUOTE = 8; + var INLINE_BLANK = 16; + var NUMBER = 32; + var SIGN = 64; + var PUNCTUATION = 128; + function isWord(char) { + var code = char.charCodeAt(0); + return code >= 128 ? !TYPES[code] : !!(TYPES[code] & WORD); + } + TYPES[160] = TYPES[5760] = TYPES[6158] = TYPES[8192] = TYPES[8193] = TYPES[8194] = TYPES[8195] = TYPES[8196] = TYPES[8197] = TYPES[8198] = TYPES[8199] = TYPES[8200] = TYPES[8201] = TYPES[8202] = TYPES[8232] = TYPES[8233] = TYPES[8239] = TYPES[8287] = TYPES[12288] = BLANK; + TYPES[8220] = TYPES[8221] = PUNCTUATION; + + function assert(predicate, message) { + if (!predicate) { + var msg = typeof message === 'function' + ? message() + : (message || "expect ".concat(predicate, " to be true")); + throw new AssertionError(msg); + } + } + + var NullDrop = /** @class */ (function (_super) { + __extends(NullDrop, _super); + function NullDrop() { + return _super !== null && _super.apply(this, arguments) || this; + } + NullDrop.prototype.equals = function (value) { + return isNil(toValue(value)); + }; + NullDrop.prototype.gt = function () { + return false; + }; + NullDrop.prototype.geq = function () { + return false; + }; + NullDrop.prototype.lt = function () { + return false; + }; + NullDrop.prototype.leq = function () { + return false; + }; + NullDrop.prototype.valueOf = function () { + return null; + }; + return NullDrop; + }(Drop)); + + var EmptyDrop = /** @class */ (function (_super) { + __extends(EmptyDrop, _super); + function EmptyDrop() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmptyDrop.prototype.equals = function (value) { + if (value instanceof EmptyDrop) + return false; + value = toValue(value); + if (isString(value) || isArray(value)) + return value.length === 0; + if (isObject(value)) + return Object.keys(value).length === 0; + return false; + }; + EmptyDrop.prototype.gt = function () { + return false; + }; + EmptyDrop.prototype.geq = function () { + return false; + }; + EmptyDrop.prototype.lt = function () { + return false; + }; + EmptyDrop.prototype.leq = function () { + return false; + }; + EmptyDrop.prototype.valueOf = function () { + return ''; + }; + return EmptyDrop; + }(Drop)); + + var BlankDrop = /** @class */ (function (_super) { + __extends(BlankDrop, _super); + function BlankDrop() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlankDrop.prototype.equals = function (value) { + if (value === false) + return true; + if (isNil(toValue(value))) + return true; + if (isString(value)) + return /^\s*$/.test(value); + return _super.prototype.equals.call(this, value); + }; + return BlankDrop; + }(EmptyDrop)); + + var ForloopDrop = /** @class */ (function (_super) { + __extends(ForloopDrop, _super); + function ForloopDrop(length, collection, variable) { + var _this = _super.call(this) || this; + _this.i = 0; + _this.length = length; + _this.name = "".concat(variable, "-").concat(collection); + return _this; + } + ForloopDrop.prototype.next = function () { + this.i++; + }; + ForloopDrop.prototype.index0 = function () { + return this.i; + }; + ForloopDrop.prototype.index = function () { + return this.i + 1; + }; + ForloopDrop.prototype.first = function () { + return this.i === 0; + }; + ForloopDrop.prototype.last = function () { + return this.i === this.length - 1; + }; + ForloopDrop.prototype.rindex = function () { + return this.length - this.i; + }; + ForloopDrop.prototype.rindex0 = function () { + return this.length - this.i - 1; + }; + ForloopDrop.prototype.valueOf = function () { + return JSON.stringify(this); + }; + return ForloopDrop; + }(Drop)); + + var BlockDrop = /** @class */ (function (_super) { + __extends(BlockDrop, _super); + function BlockDrop( + // the block render from layout template + superBlockRender) { + if (superBlockRender === void 0) { superBlockRender = function () { return ''; }; } + var _this = _super.call(this) || this; + _this.superBlockRender = superBlockRender; + return _this; + } + /** + * Provide parent access in child block by + * {{ block.super }} + */ + BlockDrop.prototype.super = function () { + return this.superBlockRender(); + }; + return BlockDrop; + }(Drop)); + + function isComparable(arg) { + return (arg && + isFunction(arg.equals) && + isFunction(arg.gt) && + isFunction(arg.geq) && + isFunction(arg.lt) && + isFunction(arg.leq)); + } + + var nil = new NullDrop(); + var literalValues = { + 'true': true, + 'false': false, + 'nil': nil, + 'null': nil, + 'empty': new EmptyDrop(), + 'blank': new BlankDrop() + }; + + function createTrie(input) { + var e_1, _a; + var trie = {}; + try { + for (var _b = __values(Object.entries(input)), _c = _b.next(); !_c.done; _c = _b.next()) { + var _d = __read(_c.value, 2), name_1 = _d[0], data = _d[1]; + var node = trie; + for (var i = 0; i < name_1.length; i++) { + var c = name_1[i]; + node[c] = node[c] || {}; + if (i === name_1.length - 1 && isWord(name_1[i])) { + node[c].needBoundary = true; + } + node = node[c]; + } + node.data = data; + node.end = true; + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + return trie; + } + + // convert an async iterator to a Promise + function toPromise(val) { + return __awaiter(this, void 0, void 0, function () { + var value, done, next, state, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!isIterator(val)) + return [2 /*return*/, val]; + done = false; + next = 'next'; + _a.label = 1; + case 1: + state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + _a.label = 2; + case 2: + _a.trys.push([2, 5, , 6]); + if (isIterator(value)) + value = toPromise(value); + if (!isPromise(value)) return [3 /*break*/, 4]; + return [4 /*yield*/, value]; + case 3: + value = _a.sent(); + _a.label = 4; + case 4: return [3 /*break*/, 6]; + case 5: + err_1 = _a.sent(); + next = 'throw'; + value = err_1; + return [3 /*break*/, 6]; + case 6: + if (!done) return [3 /*break*/, 1]; + _a.label = 7; + case 7: return [2 /*return*/, value]; + } + }); + }); + } + // convert an async iterator to a value in a synchronous manner + function toValueSync(val) { + if (!isIterator(val)) + return val; + var value; + var done = false; + var next = 'next'; + do { + var state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + if (isIterator(value)) { + try { + value = toValueSync(value); + } + catch (err) { + next = 'throw'; + value = err; + } + } + } while (!done); + return value; + } + + var rFormat = /%([-_0^#:]+)?(\d+)?([EO])?(.)/; + var monthNames = [ + 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', + 'September', 'October', 'November', 'December' + ]; + var dayNames = [ + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + ]; + var monthNamesShort = monthNames.map(abbr); + var dayNamesShort = dayNames.map(abbr); + function abbr(str) { + return str.slice(0, 3); + } + // prototype extensions + function daysInMonth(d) { + var feb = isLeapYear(d) ? 29 : 28; + return [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + } + function getDayOfYear(d) { + var num = 0; + for (var i = 0; i < d.getMonth(); ++i) { + num += daysInMonth(d)[i]; + } + return num + d.getDate(); + } + function getWeekOfYear(d, startDay) { + // Skip to startDay of this week + var now = getDayOfYear(d) + (startDay - d.getDay()); + // Find the first startDay of the year + var jan1 = new Date(d.getFullYear(), 0, 1); + var then = (7 - jan1.getDay() + startDay); + return String(Math.floor((now - then) / 7) + 1); + } + function isLeapYear(d) { + var year = d.getFullYear(); + return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year))); + } + function ordinal(d) { + var date = d.getDate(); + if ([11, 12, 13].includes(date)) + return 'th'; + switch (date % 10) { + case 1: return 'st'; + case 2: return 'nd'; + case 3: return 'rd'; + default: return 'th'; + } + } + function century(d) { + return parseInt(d.getFullYear().toString().substring(0, 2), 10); + } + // default to 0 + var padWidths = { + d: 2, + e: 2, + H: 2, + I: 2, + j: 3, + k: 2, + l: 2, + L: 3, + m: 2, + M: 2, + S: 2, + U: 2, + W: 2 + }; + // default to '0' + var padChars = { + a: ' ', + A: ' ', + b: ' ', + B: ' ', + c: ' ', + e: ' ', + k: ' ', + l: ' ', + p: ' ', + P: ' ' + }; + function getTimezoneOffset(d, opts) { + var nOffset = Math.abs(d.getTimezoneOffset()); + var h = Math.floor(nOffset / 60); + var m = nOffset % 60; + return (d.getTimezoneOffset() > 0 ? '-' : '+') + + padStart(h, 2, '0') + + (opts.flags[':'] ? ':' : '') + + padStart(m, 2, '0'); + } + var formatCodes = { + a: function (d) { return dayNamesShort[d.getDay()]; }, + A: function (d) { return dayNames[d.getDay()]; }, + b: function (d) { return monthNamesShort[d.getMonth()]; }, + B: function (d) { return monthNames[d.getMonth()]; }, + c: function (d) { return d.toLocaleString(); }, + C: function (d) { return century(d); }, + d: function (d) { return d.getDate(); }, + e: function (d) { return d.getDate(); }, + H: function (d) { return d.getHours(); }, + I: function (d) { return String(d.getHours() % 12 || 12); }, + j: function (d) { return getDayOfYear(d); }, + k: function (d) { return d.getHours(); }, + l: function (d) { return String(d.getHours() % 12 || 12); }, + L: function (d) { return d.getMilliseconds(); }, + m: function (d) { return d.getMonth() + 1; }, + M: function (d) { return d.getMinutes(); }, + N: function (d, opts) { + var width = Number(opts.width) || 9; + var str = String(d.getMilliseconds()).slice(0, width); + return padEnd(str, width, '0'); + }, + p: function (d) { return (d.getHours() < 12 ? 'AM' : 'PM'); }, + P: function (d) { return (d.getHours() < 12 ? 'am' : 'pm'); }, + q: function (d) { return ordinal(d); }, + s: function (d) { return Math.round(d.getTime() / 1000); }, + S: function (d) { return d.getSeconds(); }, + u: function (d) { return d.getDay() || 7; }, + U: function (d) { return getWeekOfYear(d, 0); }, + w: function (d) { return d.getDay(); }, + W: function (d) { return getWeekOfYear(d, 1); }, + x: function (d) { return d.toLocaleDateString(); }, + X: function (d) { return d.toLocaleTimeString(); }, + y: function (d) { return d.getFullYear().toString().slice(2, 4); }, + Y: function (d) { return d.getFullYear(); }, + z: getTimezoneOffset, + Z: function (d, opts) { + if (d.getTimezoneName) { + return d.getTimezoneName() || getTimezoneOffset(d, opts); + } + return (typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : ''); + }, + 't': function () { return '\t'; }, + 'n': function () { return '\n'; }, + '%': function () { return '%'; } + }; + formatCodes.h = formatCodes.b; + function strftime(d, formatStr) { + var output = ''; + var remaining = formatStr; + var match; + while ((match = rFormat.exec(remaining))) { + output += remaining.slice(0, match.index); + remaining = remaining.slice(match.index + match[0].length); + output += format(d, match); + } + return output + remaining; + } + function format(d, match) { + var e_1, _a; + var _b = __read(match, 5), input = _b[0], _c = _b[1], flagStr = _c === void 0 ? '' : _c, width = _b[2], modifier = _b[3], conversion = _b[4]; + var convert = formatCodes[conversion]; + if (!convert) + return input; + var flags = {}; + try { + for (var flagStr_1 = __values(flagStr), flagStr_1_1 = flagStr_1.next(); !flagStr_1_1.done; flagStr_1_1 = flagStr_1.next()) { + var flag = flagStr_1_1.value; + flags[flag] = true; + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (flagStr_1_1 && !flagStr_1_1.done && (_a = flagStr_1.return)) _a.call(flagStr_1); + } + finally { if (e_1) throw e_1.error; } + } + var ret = String(convert(d, { flags: flags, width: width, modifier: modifier })); + var padChar = padChars[conversion] || '0'; + var padWidth = width || padWidths[conversion] || 0; + if (flags['^']) + ret = ret.toUpperCase(); + else if (flags['#']) + ret = changeCase(ret); + if (flags['_']) + padChar = ' '; + else if (flags['0']) + padChar = '0'; + if (flags['-']) + padWidth = 0; + return padStart(ret, padWidth, padChar); + } + + // one minute in milliseconds + var OneMinute = 60000; + var ISO8601_TIMEZONE_PATTERN = /([zZ]|([+-])(\d{2}):(\d{2}))$/; + /** + * A date implementation with timezone info, just like Ruby date + * + * Implementation: + * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods + * - rewrite getTimezoneOffset() to trick strftime + */ + var TimezoneDate = /** @class */ (function () { + function TimezoneDate(init, timezone) { + this.date = init instanceof TimezoneDate + ? init.date + : new Date(init); + this.timezoneOffset = isString(timezone) ? TimezoneDate.getTimezoneOffset(timezone, this.date) : timezone; + this.timezoneName = isString(timezone) ? timezone : ''; + var diff = (this.date.getTimezoneOffset() - this.timezoneOffset) * OneMinute; + var time = this.date.getTime() + diff; + this.displayDate = new Date(time); + } + TimezoneDate.prototype.getTime = function () { + return this.displayDate.getTime(); + }; + TimezoneDate.prototype.getMilliseconds = function () { + return this.displayDate.getMilliseconds(); + }; + TimezoneDate.prototype.getSeconds = function () { + return this.displayDate.getSeconds(); + }; + TimezoneDate.prototype.getMinutes = function () { + return this.displayDate.getMinutes(); + }; + TimezoneDate.prototype.getHours = function () { + return this.displayDate.getHours(); + }; + TimezoneDate.prototype.getDay = function () { + return this.displayDate.getDay(); + }; + TimezoneDate.prototype.getDate = function () { + return this.displayDate.getDate(); + }; + TimezoneDate.prototype.getMonth = function () { + return this.displayDate.getMonth(); + }; + TimezoneDate.prototype.getFullYear = function () { + return this.displayDate.getFullYear(); + }; + TimezoneDate.prototype.toLocaleString = function (locale, init) { + if (init === null || init === void 0 ? void 0 : init.timeZone) { + return this.date.toLocaleString(locale, init); + } + return this.displayDate.toLocaleString(locale, init); + }; + TimezoneDate.prototype.toLocaleTimeString = function (locale) { + return this.displayDate.toLocaleTimeString(locale); + }; + TimezoneDate.prototype.toLocaleDateString = function (locale) { + return this.displayDate.toLocaleDateString(locale); + }; + TimezoneDate.prototype.getTimezoneOffset = function () { + return this.timezoneOffset; + }; + TimezoneDate.prototype.getTimezoneName = function () { + return this.timezoneName; + }; + /** + * Create a Date object fixed to it's declared Timezone. Both + * - 2021-08-06T02:29:00.000Z and + * - 2021-08-06T02:29:00.000+08:00 + * will always be displayed as + * - 2021-08-06 02:29:00 + * regardless timezoneOffset in JavaScript realm + * + * The implementation hack: + * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`, + * we create a different Date to trick strftime, it's both simpler and more performant. + * Given that a template is expected to be parsed fewer times than rendered. + */ + TimezoneDate.createDateFixedToTimezone = function (dateString) { + var m = dateString.match(ISO8601_TIMEZONE_PATTERN); + // representing a UTC timestamp + if (m && m[1] === 'Z') { + return new TimezoneDate(+new Date(dateString), 0); + } + // has a timezone specified + if (m && m[2] && m[3] && m[4]) { + var _a = __read(m, 5), sign = _a[2], hours = _a[3], minutes = _a[4]; + var offset = (sign === '+' ? -1 : 1) * (parseInt(hours, 10) * 60 + parseInt(minutes, 10)); + return new TimezoneDate(+new Date(dateString), offset); + } + return new Date(dateString); + }; + TimezoneDate.getTimezoneOffset = function (timezoneName, date) { + if (date === void 0) { date = new Date(); } + var localDateString = date.toLocaleString('en-US', { timeZone: timezoneName }); + var utcDateString = date.toLocaleString('en-US', { timeZone: 'UTC' }); + var localDate = new Date(localDateString); + var utcDate = new Date(utcDateString); + return (+utcDate - +localDate) / (60 * 1000); + }; + return TimezoneDate; + }()); + + var DelimitedToken = /** @class */ (function (_super) { + __extends(DelimitedToken, _super); + function DelimitedToken(kind, _a, input, begin, end, trimLeft, trimRight, file) { + var _b = __read(_a, 2), contentBegin = _b[0], contentEnd = _b[1]; + var _this = _super.call(this, kind, input, begin, end, file) || this; + _this.trimLeft = false; + _this.trimRight = false; + var tl = input[contentBegin] === '-'; + var tr = input[contentEnd - 1] === '-'; + var l = tl ? contentBegin + 1 : contentBegin; + var r = tr ? contentEnd - 1 : contentEnd; + while (l < r && (TYPES[input.charCodeAt(l)] & BLANK)) + l++; + while (r > l && (TYPES[input.charCodeAt(r - 1)] & BLANK)) + r--; + _this.contentRange = [l, r]; + _this.trimLeft = tl || trimLeft; + _this.trimRight = tr || trimRight; + return _this; + } + Object.defineProperty(DelimitedToken.prototype, "content", { + get: function () { + return this.input.slice(this.contentRange[0], this.contentRange[1]); + }, + enumerable: false, + configurable: true + }); + return DelimitedToken; + }(Token)); + + var TagToken = /** @class */ (function (_super) { + __extends(TagToken, _super); + function TagToken(input, begin, end, options, file) { + var _this = this; + var trimTagLeft = options.trimTagLeft, trimTagRight = options.trimTagRight, tagDelimiterLeft = options.tagDelimiterLeft, tagDelimiterRight = options.tagDelimiterRight; + var _a = __read([begin + tagDelimiterLeft.length, end - tagDelimiterRight.length], 2), valueBegin = _a[0], valueEnd = _a[1]; + _this = _super.call(this, exports.TokenKind.Tag, [valueBegin, valueEnd], input, begin, end, trimTagLeft, trimTagRight, file) || this; + _this.tokenizer = new Tokenizer(input, options.operators, file, _this.contentRange); + _this.name = _this.tokenizer.readTagName(); + _this.tokenizer.assert(_this.name, "illegal tag syntax, tag name expected"); + _this.tokenizer.skipBlank(); + return _this; + } + Object.defineProperty(TagToken.prototype, "args", { + get: function () { + return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]); + }, + enumerable: false, + configurable: true + }); + return TagToken; + }(DelimitedToken)); + + var OutputToken = /** @class */ (function (_super) { + __extends(OutputToken, _super); + function OutputToken(input, begin, end, options, file) { + var trimOutputLeft = options.trimOutputLeft, trimOutputRight = options.trimOutputRight, outputDelimiterLeft = options.outputDelimiterLeft, outputDelimiterRight = options.outputDelimiterRight; + var valueRange = [begin + outputDelimiterLeft.length, end - outputDelimiterRight.length]; + return _super.call(this, exports.TokenKind.Output, valueRange, input, begin, end, trimOutputLeft, trimOutputRight, file) || this; + } + return OutputToken; + }(DelimitedToken)); + + var HTMLToken = /** @class */ (function (_super) { + __extends(HTMLToken, _super); + function HTMLToken(input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.HTML, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.file = file; + _this.trimLeft = 0; + _this.trimRight = 0; + return _this; + } + HTMLToken.prototype.getContent = function () { + return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight); + }; + return HTMLToken; + }(Token)); + + var NumberToken = /** @class */ (function (_super) { + __extends(NumberToken, _super); + function NumberToken(input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.Number, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.file = file; + _this.content = Number(_this.getText()); + return _this; + } + return NumberToken; + }(Token)); + + var IdentifierToken = /** @class */ (function (_super) { + __extends(IdentifierToken, _super); + function IdentifierToken(input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.Word, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.file = file; + _this.content = _this.getText(); + return _this; + } + IdentifierToken.prototype.isNumber = function (allowSign) { + if (allowSign === void 0) { allowSign = false; } + var begin = allowSign && TYPES[this.input.charCodeAt(this.begin)] & SIGN + ? this.begin + 1 + : this.begin; + for (var i = begin; i < this.end; i++) { + if (!(TYPES[this.input.charCodeAt(i)] & NUMBER)) + return false; + } + return true; + }; + return IdentifierToken; + }(Token)); + + var LiteralToken = /** @class */ (function (_super) { + __extends(LiteralToken, _super); + function LiteralToken(input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.Literal, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.file = file; + _this.literal = _this.getText(); + _this.content = literalValues[_this.literal]; + return _this; + } + return LiteralToken; + }(Token)); + + var operatorPrecedences = { + '==': 2, + '!=': 2, + '>': 2, + '<': 2, + '>=': 2, + '<=': 2, + 'contains': 2, + 'not': 1, + 'and': 0, + 'or': 0 + }; + var operatorTypes = { + '==': 0 /* OperatorType.Binary */, + '!=': 0 /* OperatorType.Binary */, + '>': 0 /* OperatorType.Binary */, + '<': 0 /* OperatorType.Binary */, + '>=': 0 /* OperatorType.Binary */, + '<=': 0 /* OperatorType.Binary */, + 'contains': 0 /* OperatorType.Binary */, + 'not': 1 /* OperatorType.Unary */, + 'and': 0 /* OperatorType.Binary */, + 'or': 0 /* OperatorType.Binary */ + }; + var OperatorToken = /** @class */ (function (_super) { + __extends(OperatorToken, _super); + function OperatorToken(input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.Operator, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.file = file; + _this.operator = _this.getText(); + return _this; + } + OperatorToken.prototype.getPrecedence = function () { + var key = this.getText(); + return key in operatorPrecedences ? operatorPrecedences[key] : 1; + }; + return OperatorToken; + }(Token)); + + var PropertyAccessToken = /** @class */ (function (_super) { + __extends(PropertyAccessToken, _super); + function PropertyAccessToken(variable, props, input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.PropertyAccess, input, begin, end, file) || this; + _this.variable = variable; + _this.props = props; + return _this; + } + return PropertyAccessToken; + }(Token)); + + var FilterToken = /** @class */ (function (_super) { + __extends(FilterToken, _super); + function FilterToken(name, args, input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.Filter, input, begin, end, file) || this; + _this.name = name; + _this.args = args; + return _this; + } + return FilterToken; + }(Token)); + + var HashToken = /** @class */ (function (_super) { + __extends(HashToken, _super); + function HashToken(input, begin, end, name, value, file) { + var _this = _super.call(this, exports.TokenKind.Hash, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.name = name; + _this.value = value; + _this.file = file; + return _this; + } + return HashToken; + }(Token)); + + var rHex = /[\da-fA-F]/; + var rOct = /[0-7]/; + var escapeChar = { + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t', + v: '\x0B' + }; + function hexVal(c) { + var code = c.charCodeAt(0); + if (code >= 97) + return code - 87; + if (code >= 65) + return code - 55; + return code - 48; + } + function parseStringLiteral(str) { + var ret = ''; + for (var i = 1; i < str.length - 1; i++) { + if (str[i] !== '\\') { + ret += str[i]; + continue; + } + if (escapeChar[str[i + 1]] !== undefined) { + ret += escapeChar[str[++i]]; + } + else if (str[i + 1] === 'u') { + var val = 0; + var j = i + 2; + while (j <= i + 5 && rHex.test(str[j])) { + val = val * 16 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + else if (!rOct.test(str[i + 1])) { + ret += str[++i]; + } + else { + var j = i + 1; + var val = 0; + while (j <= i + 3 && rOct.test(str[j])) { + val = val * 8 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + } + return ret; + } + + var QuotedToken = /** @class */ (function (_super) { + __extends(QuotedToken, _super); + function QuotedToken(input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.Quoted, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.file = file; + _this.content = parseStringLiteral(_this.getText()); + return _this; + } + return QuotedToken; + }(Token)); + + var RangeToken = /** @class */ (function (_super) { + __extends(RangeToken, _super); + function RangeToken(input, begin, end, lhs, rhs, file) { + var _this = _super.call(this, exports.TokenKind.Range, input, begin, end, file) || this; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.lhs = lhs; + _this.rhs = rhs; + _this.file = file; + return _this; + } + return RangeToken; + }(Token)); + + /** + * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}` + */ + var LiquidTagToken = /** @class */ (function (_super) { + __extends(LiquidTagToken, _super); + function LiquidTagToken(input, begin, end, options, file) { + var _this = _super.call(this, exports.TokenKind.Tag, [begin, end], input, begin, end, false, false, file) || this; + _this.tokenizer = new Tokenizer(input, options.operators, file, _this.contentRange); + _this.name = _this.tokenizer.readTagName(); + _this.tokenizer.assert(_this.name, 'illegal liquid tag syntax'); + _this.tokenizer.skipBlank(); + _this.args = _this.tokenizer.remaining(); + return _this; + } + return LiquidTagToken; + }(DelimitedToken)); + + /** + * value expression with optional filters + * e.g. + * {% assign foo="bar" | append: "coo" %} + */ + var FilteredValueToken = /** @class */ (function (_super) { + __extends(FilteredValueToken, _super); + function FilteredValueToken(initial, filters, input, begin, end, file) { + var _this = _super.call(this, exports.TokenKind.FilteredValue, input, begin, end, file) || this; + _this.initial = initial; + _this.filters = filters; + _this.input = input; + _this.begin = begin; + _this.end = end; + _this.file = file; + return _this; + } + return FilteredValueToken; + }(Token)); + + var SimpleEmitter = /** @class */ (function () { + function SimpleEmitter() { + this.buffer = ''; + } + SimpleEmitter.prototype.write = function (html) { + this.buffer += stringify(html); + }; + return SimpleEmitter; + }()); + + var StreamedEmitter = /** @class */ (function () { + function StreamedEmitter() { + this.buffer = ''; + this.stream = null; + throw new Error('streaming not supported in browser'); + } + return StreamedEmitter; + }()); + + var KeepingTypeEmitter = /** @class */ (function () { + function KeepingTypeEmitter() { + this.buffer = ''; + } + KeepingTypeEmitter.prototype.write = function (html) { + html = toValue(html); + // This will only preserve the type if the value is isolated. + // I.E: + // {{ my-port }} -> 42 + // {{ my-host }}:{{ my-port }} -> 'host:42' + if (typeof html !== 'string' && this.buffer === '') { + this.buffer = html; + } + else { + this.buffer = stringify(this.buffer) + stringify(html); + } + }; + return KeepingTypeEmitter; + }()); + + var Render = /** @class */ (function () { + function Render() { + } + Render.prototype.renderTemplatesToNodeStream = function (templates, ctx) { + var _this = this; + var emitter = new StreamedEmitter(); + Promise.resolve().then(function () { return toPromise(_this.renderTemplates(templates, ctx, emitter)); }) + .then(function () { return emitter.end(); }, function (err) { return emitter.error(err); }); + return emitter.stream; + }; + Render.prototype.renderTemplates = function (templates, ctx, emitter) { + var errors, templates_1, templates_1_1, tpl, html, e_1, err, e_2_1; + var e_2, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!emitter) { + emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter(); + } + errors = []; + _b.label = 1; + case 1: + _b.trys.push([1, 8, 9, 10]); + templates_1 = __values(templates), templates_1_1 = templates_1.next(); + _b.label = 2; + case 2: + if (!!templates_1_1.done) return [3 /*break*/, 7]; + tpl = templates_1_1.value; + _b.label = 3; + case 3: + _b.trys.push([3, 5, , 6]); + return [4 /*yield*/, tpl.render(ctx, emitter) + // if not, it'll return an `html`, write to the emitter for it + ]; + case 4: + html = _b.sent(); + // if not, it'll return an `html`, write to the emitter for it + html && emitter.write(html); + if (emitter['break'] || emitter['continue']) + return [3 /*break*/, 7]; + return [3 /*break*/, 6]; + case 5: + e_1 = _b.sent(); + err = LiquidError.is(e_1) ? e_1 : new RenderError(e_1, tpl); + if (ctx.opts.catchAllErrors) + errors.push(err); + else + throw err; + return [3 /*break*/, 6]; + case 6: + templates_1_1 = templates_1.next(); + return [3 /*break*/, 2]; + case 7: return [3 /*break*/, 10]; + case 8: + e_2_1 = _b.sent(); + e_2 = { error: e_2_1 }; + return [3 /*break*/, 10]; + case 9: + try { + if (templates_1_1 && !templates_1_1.done && (_a = templates_1.return)) _a.call(templates_1); + } + finally { if (e_2) throw e_2.error; } + return [7 /*endfinally*/]; + case 10: + if (errors.length) { + throw new LiquidErrors(errors); + } + return [2 /*return*/, emitter.buffer]; + } + }); + }; + return Render; + }()); + + var Expression = /** @class */ (function () { + function Expression(tokens) { + this.postfix = __spreadArray([], __read(toPostfix(tokens)), false); + } + Expression.prototype.evaluate = function (ctx, lenient) { + var operands, _a, _b, token, r, result, l, _c, _d, e_1_1; + var e_1, _e; + return __generator(this, function (_f) { + switch (_f.label) { + case 0: + assert(ctx, 'unable to evaluate: context not defined'); + operands = []; + _f.label = 1; + case 1: + _f.trys.push([1, 11, 12, 13]); + _a = __values(this.postfix), _b = _a.next(); + _f.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 10]; + token = _b.value; + if (!isOperatorToken(token)) return [3 /*break*/, 7]; + r = operands.pop(); + result = void 0; + if (!(operatorTypes[token.operator] === 1 /* OperatorType.Unary */)) return [3 /*break*/, 4]; + return [4 /*yield*/, ctx.opts.operators[token.operator](r, ctx)]; + case 3: + result = _f.sent(); + return [3 /*break*/, 6]; + case 4: + l = operands.pop(); + return [4 /*yield*/, ctx.opts.operators[token.operator](l, r, ctx)]; + case 5: + result = _f.sent(); + _f.label = 6; + case 6: + operands.push(result); + return [3 /*break*/, 9]; + case 7: + _d = (_c = operands).push; + return [4 /*yield*/, evalToken(token, ctx, lenient)]; + case 8: + _d.apply(_c, [_f.sent()]); + _f.label = 9; + case 9: + _b = _a.next(); + return [3 /*break*/, 2]; + case 10: return [3 /*break*/, 13]; + case 11: + e_1_1 = _f.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 13]; + case 12: + try { + if (_b && !_b.done && (_e = _a.return)) _e.call(_a); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 13: return [2 /*return*/, operands[0]]; + } + }); + }; + Expression.prototype.valid = function () { + return !!this.postfix.length; + }; + return Expression; + }()); + function evalToken(token, ctx, lenient) { + if (lenient === void 0) { lenient = false; } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!token) + return [2 /*return*/]; + if ('content' in token) + return [2 /*return*/, token.content]; + if (!isPropertyAccessToken(token)) return [3 /*break*/, 2]; + return [4 /*yield*/, evalPropertyAccessToken(token, ctx, lenient)]; + case 1: return [2 /*return*/, _a.sent()]; + case 2: + if (!isRangeToken(token)) return [3 /*break*/, 4]; + return [4 /*yield*/, evalRangeToken(token, ctx)]; + case 3: return [2 /*return*/, _a.sent()]; + case 4: return [2 /*return*/]; + } + }); + } + function evalPropertyAccessToken(token, ctx, lenient) { + var props, _a, _b, prop, _c, _d, e_2_1, variable, e_3; + var e_2, _e; + return __generator(this, function (_f) { + switch (_f.label) { + case 0: + props = []; + _f.label = 1; + case 1: + _f.trys.push([1, 6, 7, 8]); + _a = __values(token.props), _b = _a.next(); + _f.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 5]; + prop = _b.value; + _d = (_c = props).push; + return [4 /*yield*/, evalToken(prop, ctx, false)]; + case 3: + _d.apply(_c, [(_f.sent())]); + _f.label = 4; + case 4: + _b = _a.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_2_1 = _f.sent(); + e_2 = { error: e_2_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (_b && !_b.done && (_e = _a.return)) _e.call(_a); + } + finally { if (e_2) throw e_2.error; } + return [7 /*endfinally*/]; + case 8: + _f.trys.push([8, 14, , 15]); + if (!token.variable) return [3 /*break*/, 11]; + return [4 /*yield*/, evalToken(token.variable, ctx, lenient)]; + case 9: + variable = _f.sent(); + return [4 /*yield*/, ctx._getFromScope(variable, props)]; + case 10: return [2 /*return*/, _f.sent()]; + case 11: return [4 /*yield*/, ctx._get(props)]; + case 12: return [2 /*return*/, _f.sent()]; + case 13: return [3 /*break*/, 15]; + case 14: + e_3 = _f.sent(); + if (lenient && e_3.name === 'InternalUndefinedVariableError') + return [2 /*return*/, null]; + throw (new UndefinedVariableError(e_3, token)); + case 15: return [2 /*return*/]; + } + }); + } + function evalQuotedToken(token) { + return token.content; + } + function evalRangeToken(token, ctx) { + var low, high; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, evalToken(token.lhs, ctx)]; + case 1: + low = _a.sent(); + return [4 /*yield*/, evalToken(token.rhs, ctx)]; + case 2: + high = _a.sent(); + return [2 /*return*/, range(+low, +high + 1)]; + } + }); + } + function toPostfix(tokens) { + var ops, tokens_1, tokens_1_1, token, e_4_1; + var e_4, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + ops = []; + _b.label = 1; + case 1: + _b.trys.push([1, 10, 11, 12]); + tokens_1 = __values(tokens), tokens_1_1 = tokens_1.next(); + _b.label = 2; + case 2: + if (!!tokens_1_1.done) return [3 /*break*/, 9]; + token = tokens_1_1.value; + if (!isOperatorToken(token)) return [3 /*break*/, 6]; + _b.label = 3; + case 3: + if (!(ops.length && ops[ops.length - 1].getPrecedence() > token.getPrecedence())) return [3 /*break*/, 5]; + return [4 /*yield*/, ops.pop()]; + case 4: + _b.sent(); + return [3 /*break*/, 3]; + case 5: + ops.push(token); + return [3 /*break*/, 8]; + case 6: return [4 /*yield*/, token]; + case 7: + _b.sent(); + _b.label = 8; + case 8: + tokens_1_1 = tokens_1.next(); + return [3 /*break*/, 2]; + case 9: return [3 /*break*/, 12]; + case 10: + e_4_1 = _b.sent(); + e_4 = { error: e_4_1 }; + return [3 /*break*/, 12]; + case 11: + try { + if (tokens_1_1 && !tokens_1_1.done && (_a = tokens_1.return)) _a.call(tokens_1); + } + finally { if (e_4) throw e_4.error; } + return [7 /*endfinally*/]; + case 12: + if (!ops.length) return [3 /*break*/, 14]; + return [4 /*yield*/, ops.pop()]; + case 13: + _b.sent(); + return [3 /*break*/, 12]; + case 14: return [2 /*return*/]; + } + }); + } + + function isTruthy(val, ctx) { + return !isFalsy(val, ctx); + } + function isFalsy(val, ctx) { + val = toValue(val); + if (ctx.opts.jsTruthy) { + return !val; + } + else { + return val === false || undefined === val || val === null; + } + } + + var defaultOperators = { + '==': equals, + '!=': function (l, r) { return !equals(l, r); }, + '>': function (l, r) { + if (isComparable(l)) + return l.gt(r); + if (isComparable(r)) + return r.lt(l); + return toValue(l) > toValue(r); + }, + '<': function (l, r) { + if (isComparable(l)) + return l.lt(r); + if (isComparable(r)) + return r.gt(l); + return toValue(l) < toValue(r); + }, + '>=': function (l, r) { + if (isComparable(l)) + return l.geq(r); + if (isComparable(r)) + return r.leq(l); + return toValue(l) >= toValue(r); + }, + '<=': function (l, r) { + if (isComparable(l)) + return l.leq(r); + if (isComparable(r)) + return r.geq(l); + return toValue(l) <= toValue(r); + }, + 'contains': function (l, r) { + l = toValue(l); + if (isArray(l)) + return l.some(function (i) { return equals(i, r); }); + if (isFunction(l === null || l === void 0 ? void 0 : l.indexOf)) + return l.indexOf(toValue(r)) > -1; + return false; + }, + 'not': function (v, ctx) { return isFalsy(toValue(v), ctx); }, + 'and': function (l, r, ctx) { return isTruthy(toValue(l), ctx) && isTruthy(toValue(r), ctx); }, + 'or': function (l, r, ctx) { return isTruthy(toValue(l), ctx) || isTruthy(toValue(r), ctx); } + }; + function equals(lhs, rhs) { + if (isComparable(lhs)) + return lhs.equals(rhs); + if (isComparable(rhs)) + return rhs.equals(lhs); + lhs = toValue(lhs); + rhs = toValue(rhs); + if (isArray(lhs)) { + return isArray(rhs) && arrayEquals(lhs, rhs); + } + return lhs === rhs; + } + function arrayEquals(lhs, rhs) { + if (lhs.length !== rhs.length) + return false; + return !lhs.some(function (value, i) { return !equals(value, rhs[i]); }); + } + + var Node = /** @class */ (function () { + function Node(key, value, next, prev) { + this.key = key; + this.value = value; + this.next = next; + this.prev = prev; + } + return Node; + }()); + var LRU = /** @class */ (function () { + function LRU(limit, size) { + if (size === void 0) { size = 0; } + this.limit = limit; + this.size = size; + this.cache = {}; + this.head = new Node('HEAD', null, null, null); + this.tail = new Node('TAIL', null, null, null); + this.head.next = this.tail; + this.tail.prev = this.head; + } + LRU.prototype.write = function (key, value) { + if (this.cache[key]) { + this.cache[key].value = value; + } + else { + var node = new Node(key, value, this.head.next, this.head); + this.head.next.prev = node; + this.head.next = node; + this.cache[key] = node; + this.size++; + this.ensureLimit(); + } + }; + LRU.prototype.read = function (key) { + if (!this.cache[key]) + return; + var value = this.cache[key].value; + this.remove(key); + this.write(key, value); + return value; + }; + LRU.prototype.remove = function (key) { + var node = this.cache[key]; + node.prev.next = node.next; + node.next.prev = node.prev; + delete this.cache[key]; + this.size--; + }; + LRU.prototype.clear = function () { + this.head.next = this.tail; + this.tail.prev = this.head; + this.size = 0; + this.cache = {}; + }; + LRU.prototype.ensureLimit = function () { + if (this.size > this.limit) + this.remove(this.tail.prev.key); + }; + return LRU; + }()); + + function domResolve(root, path) { + var base = document.createElement('base'); + base.href = root; + var head = document.getElementsByTagName('head')[0]; + head.insertBefore(base, head.firstChild); + var a = document.createElement('a'); + a.href = path; + var resolved = a.href; + head.removeChild(base); + return resolved; + } + function resolve(root, filepath, ext) { + if (root.length && last(root) !== '/') + root += '/'; + var url = domResolve(root, filepath); + return url.replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/, function (str, origin, path) { + var last = path.split('/').pop(); + if (/\.\w+$/.test(last)) + return str; + return origin + path + ext; + }); + } + function readFile(url) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.onload = function () { + if (xhr.status >= 200 && xhr.status < 300) { + resolve(xhr.responseText); + } + else { + reject(new Error(xhr.statusText)); + } + }; + xhr.onerror = function () { + reject(new Error('An error occurred whilst receiving the response.')); + }; + xhr.open('GET', url); + xhr.send(); + })]; + }); + }); + } + function readFileSync(url) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.send(); + if (xhr.status < 200 || xhr.status >= 300) { + throw new Error(xhr.statusText); + } + return xhr.responseText; + } + function exists(filepath) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, true]; + }); + }); + } + function existsSync(filepath) { + return true; + } + function dirname(filepath) { + return domResolve(filepath, '.'); + } + var sep = '/'; + + var fs = /*#__PURE__*/Object.freeze({ + __proto__: null, + resolve: resolve, + readFile: readFile, + readFileSync: readFileSync, + exists: exists, + existsSync: existsSync, + dirname: dirname, + sep: sep + }); + + function defaultFilter(value, defaultValue) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + value = toValue(value); + if (isArray(value) || isString(value)) + return value.length ? value : defaultValue; + if (value === false && (new Map(args)).get('allow_false')) + return false; + return isFalsy(value, this.context) ? defaultValue : value; + } + function json(value, space) { + if (space === void 0) { space = 0; } + return JSON.stringify(value, null, space); + } + function inspect(value, space) { + if (space === void 0) { space = 0; } + var ancestors = []; + return JSON.stringify(value, function (_key, value) { + if (typeof value !== 'object' || value === null) + return value; + // `this` is the object that value is contained in, i.e., its direct parent. + while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) + ancestors.pop(); + if (ancestors.includes(value)) + return '[Circular]'; + ancestors.push(value); + return value; + }, space); + } + function to_integer(value) { + return Number(value); + } + var raw = { + raw: true, + handler: identify + }; + var misc = { + default: defaultFilter, + raw: raw, + jsonify: json, + to_integer: to_integer, + json: json, + inspect: inspect + }; + + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + var unescapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + function escape(str) { + return stringify(str).replace(/&|<|>|"|'/g, function (m) { return escapeMap[m]; }); + } + function xml_escape(str) { + return escape(str); + } + function unescape(str) { + return stringify(str).replace(/&(amp|lt|gt|#34|#39);/g, function (m) { return unescapeMap[m]; }); + } + function escape_once(str) { + return escape(unescape(stringify(str))); + } + function newline_to_br(v) { + return stringify(v).replace(/\r?\n/gm, '
    \n'); + } + function strip_html(v) { + return stringify(v).replace(/||<.*?>|/g, ''); + } + + var htmlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + escape: escape, + xml_escape: xml_escape, + escape_once: escape_once, + newline_to_br: newline_to_br, + strip_html: strip_html + }); + + var defaultOptions = { + root: ['.'], + layouts: ['.'], + partials: ['.'], + relativeReference: true, + jekyllInclude: false, + cache: undefined, + extname: '', + fs: fs, + dynamicPartials: true, + jsTruthy: false, + dateFormat: '%A, %B %-e, %Y at %-l:%M %P %z', + trimTagRight: false, + trimTagLeft: false, + trimOutputRight: false, + trimOutputLeft: false, + greedy: true, + tagDelimiterLeft: '{%', + tagDelimiterRight: '%}', + outputDelimiterLeft: '{{', + outputDelimiterRight: '}}', + preserveTimezones: false, + strictFilters: false, + strictVariables: false, + ownPropertyOnly: true, + lenientIf: false, + globals: {}, + keepOutputType: false, + operators: defaultOperators + }; + function normalize(options) { + if (options.hasOwnProperty('root')) { + if (!options.hasOwnProperty('partials')) + options.partials = options.root; + if (!options.hasOwnProperty('layouts')) + options.layouts = options.root; + } + if (options.hasOwnProperty('cache')) { + var cache = void 0; + if (typeof options.cache === 'number') + cache = options.cache > 0 ? new LRU(options.cache) : undefined; + else if (typeof options.cache === 'object') + cache = options.cache; + else + cache = options.cache ? new LRU(1024) : undefined; + options.cache = cache; + } + options = __assign(__assign(__assign({}, defaultOptions), (options.jekyllInclude ? { dynamicPartials: false } : {})), options); + if ((!options.fs.dirname || !options.fs.sep) && options.relativeReference) { + console.warn('[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning'); + options.relativeReference = false; + } + options.root = normalizeDirectoryList(options.root); + options.partials = normalizeDirectoryList(options.partials); + options.layouts = normalizeDirectoryList(options.layouts); + options.outputEscape = options.outputEscape && getOutputEscapeFunction(options.outputEscape); + return options; + } + function getOutputEscapeFunction(nameOrFunction) { + if (nameOrFunction === 'escape') + return escape; + if (nameOrFunction === 'json') + return misc.json; + assert(isFunction(nameOrFunction), '`outputEscape` need to be of type string or function'); + return nameOrFunction; + } + function normalizeDirectoryList(value) { + var list = []; + if (isArray(value)) + list = value; + if (isString(value)) + list = [value]; + return list; + } + + function whiteSpaceCtrl(tokens, options) { + var inRaw = false; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (!isDelimitedToken(token)) + continue; + if (!inRaw && token.trimLeft) { + trimLeft(tokens[i - 1], options.greedy); + } + if (isTagToken(token)) { + if (token.name === 'raw') + inRaw = true; + else if (token.name === 'endraw') + inRaw = false; + } + if (!inRaw && token.trimRight) { + trimRight(tokens[i + 1], options.greedy); + } + } + } + function trimLeft(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + var mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.end - 1 - token.trimRight)] & mask) + token.trimRight++; + } + function trimRight(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + var mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.begin + token.trimLeft)] & mask) + token.trimLeft++; + if (token.input.charAt(token.begin + token.trimLeft) === '\n') + token.trimLeft++; + } + + var Tokenizer = /** @class */ (function () { + function Tokenizer(input, operators, file, range) { + if (operators === void 0) { operators = defaultOptions.operators; } + this.input = input; + this.file = file; + this.rawBeginAt = -1; + this.p = range ? range[0] : 0; + this.N = range ? range[1] : input.length; + this.opTrie = createTrie(operators); + this.literalTrie = createTrie(literalValues); + } + Tokenizer.prototype.readExpression = function () { + return new Expression(this.readExpressionTokens()); + }; + Tokenizer.prototype.readExpressionTokens = function () { + var operator, operand; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.p < this.N)) return [3 /*break*/, 5]; + operator = this.readOperator(); + if (!operator) return [3 /*break*/, 2]; + return [4 /*yield*/, operator]; + case 1: + _a.sent(); + return [3 /*break*/, 0]; + case 2: + operand = this.readValue(); + if (!operand) return [3 /*break*/, 4]; + return [4 /*yield*/, operand]; + case 3: + _a.sent(); + return [3 /*break*/, 0]; + case 4: return [2 /*return*/]; + case 5: return [2 /*return*/]; + } + }); + }; + Tokenizer.prototype.readOperator = function () { + this.skipBlank(); + var end = this.matchTrie(this.opTrie); + if (end === -1) + return; + return new OperatorToken(this.input, this.p, (this.p = end), this.file); + }; + Tokenizer.prototype.matchTrie = function (trie) { + var node = trie; + var i = this.p; + var info; + while (node[this.input[i]] && i < this.N) { + node = node[this.input[i++]]; + if (node['end']) + info = node; + } + if (!info) + return -1; + if (info['needBoundary'] && isWord(this.peek(i - this.p))) + return -1; + return i; + }; + Tokenizer.prototype.readFilteredValue = function () { + var begin = this.p; + var initial = this.readExpression(); + this.assert(initial.valid(), "invalid value expression: ".concat(this.snapshot())); + var filters = this.readFilters(); + return new FilteredValueToken(initial, filters, this.input, begin, this.p, this.file); + }; + Tokenizer.prototype.readFilters = function () { + var filters = []; + while (true) { + var filter = this.readFilter(); + if (!filter) + return filters; + filters.push(filter); + } + }; + Tokenizer.prototype.readFilter = function () { + var _this = this; + this.skipBlank(); + if (this.end()) + return null; + this.assert(this.peek() === '|', "expected \"|\" before filter"); + this.p++; + var begin = this.p; + var name = this.readIdentifier(); + if (!name.size()) { + this.assert(this.end(), "expected filter name"); + return null; + } + var args = []; + this.skipBlank(); + if (this.peek() === ':') { + do { + ++this.p; + var arg = this.readFilterArg(); + arg && args.push(arg); + this.skipBlank(); + this.assert(this.end() || this.peek() === ',' || this.peek() === '|', function () { return "unexpected character ".concat(_this.snapshot()); }); + } while (this.peek() === ','); + } + else if (this.peek() === '|' || this.end()) ; + else { + throw this.error('expected ":" after filter name'); + } + return new FilterToken(name.getText(), args, this.input, begin, this.p, this.file); + }; + Tokenizer.prototype.readFilterArg = function () { + var key = this.readValue(); + if (!key) + return; + this.skipBlank(); + if (this.peek() !== ':') + return key; + ++this.p; + var value = this.readValue(); + return [key.getText(), value]; + }; + Tokenizer.prototype.readTopLevelTokens = function (options) { + if (options === void 0) { options = defaultOptions; } + var tokens = []; + while (this.p < this.N) { + var token = this.readTopLevelToken(options); + tokens.push(token); + } + whiteSpaceCtrl(tokens, options); + return tokens; + }; + Tokenizer.prototype.readTopLevelToken = function (options) { + var tagDelimiterLeft = options.tagDelimiterLeft, outputDelimiterLeft = options.outputDelimiterLeft; + if (this.rawBeginAt > -1) + return this.readEndrawOrRawContent(options); + if (this.match(tagDelimiterLeft)) + return this.readTagToken(options); + if (this.match(outputDelimiterLeft)) + return this.readOutputToken(options); + return this.readHTMLToken([tagDelimiterLeft, outputDelimiterLeft]); + }; + Tokenizer.prototype.readHTMLToken = function (stopStrings) { + var _this = this; + var begin = this.p; + while (this.p < this.N) { + if (stopStrings.some(function (str) { return _this.match(str); })) + break; + ++this.p; + } + return new HTMLToken(this.input, begin, this.p, this.file); + }; + Tokenizer.prototype.readTagToken = function (options) { + if (options === void 0) { options = defaultOptions; } + var _a = this, file = _a.file, input = _a.input; + var begin = this.p; + if (this.readToDelimiter(options.tagDelimiterRight) === -1) { + throw this.error("tag ".concat(this.snapshot(begin), " not closed"), begin); + } + var token = new TagToken(input, begin, this.p, options, file); + if (token.name === 'raw') + this.rawBeginAt = begin; + return token; + }; + Tokenizer.prototype.readToDelimiter = function (delimiter, respectQuoted) { + if (respectQuoted === void 0) { respectQuoted = false; } + this.skipBlank(); + while (this.p < this.N) { + if (respectQuoted && (this.peekType() & QUOTE)) { + this.readQuoted(); + continue; + } + ++this.p; + if (this.rmatch(delimiter)) + return this.p; + } + return -1; + }; + Tokenizer.prototype.readOutputToken = function (options) { + if (options === void 0) { options = defaultOptions; } + var _a = this, file = _a.file, input = _a.input; + var outputDelimiterRight = options.outputDelimiterRight; + var begin = this.p; + if (this.readToDelimiter(outputDelimiterRight, true) === -1) { + throw this.error("output ".concat(this.snapshot(begin), " not closed"), begin); + } + return new OutputToken(input, begin, this.p, options, file); + }; + Tokenizer.prototype.readEndrawOrRawContent = function (options) { + var tagDelimiterLeft = options.tagDelimiterLeft, tagDelimiterRight = options.tagDelimiterRight; + var begin = this.p; + var leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + while (this.p < this.N) { + if (this.readIdentifier().getText() !== 'endraw') { + leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + continue; + } + while (this.p <= this.N) { + if (this.rmatch(tagDelimiterRight)) { + var end = this.p; + if (begin === leftPos) { + this.rawBeginAt = -1; + return new TagToken(this.input, begin, end, options, this.file); + } + else { + this.p = leftPos; + return new HTMLToken(this.input, begin, leftPos, this.file); + } + } + if (this.rmatch(tagDelimiterLeft)) + break; + this.p++; + } + } + throw this.error("raw ".concat(this.snapshot(this.rawBeginAt), " not closed"), begin); + }; + Tokenizer.prototype.readLiquidTagTokens = function (options) { + if (options === void 0) { options = defaultOptions; } + var tokens = []; + while (this.p < this.N) { + var token = this.readLiquidTagToken(options); + token && tokens.push(token); + } + return tokens; + }; + Tokenizer.prototype.readLiquidTagToken = function (options) { + this.skipBlank(); + if (this.end()) + return; + var begin = this.p; + this.readToDelimiter('\n'); + var end = this.p; + return new LiquidTagToken(this.input, begin, end, options, this.file); + }; + Tokenizer.prototype.error = function (msg, pos) { + if (pos === void 0) { pos = this.p; } + return new TokenizationError(msg, new IdentifierToken(this.input, pos, this.N, this.file)); + }; + Tokenizer.prototype.assert = function (pred, msg, pos) { + if (!pred) + throw this.error(typeof msg === 'function' ? msg() : msg, pos); + }; + Tokenizer.prototype.snapshot = function (begin) { + if (begin === void 0) { begin = this.p; } + return JSON.stringify(ellipsis(this.input.slice(begin, this.N), 32)); + }; + /** + * @deprecated use #readIdentifier instead + */ + Tokenizer.prototype.readWord = function () { + return this.readIdentifier(); + }; + Tokenizer.prototype.readIdentifier = function () { + this.skipBlank(); + var begin = this.p; + while (!this.end() && isWord(this.peek())) + ++this.p; + return new IdentifierToken(this.input, begin, this.p, this.file); + }; + Tokenizer.prototype.readNonEmptyIdentifier = function () { + var id = this.readIdentifier(); + return id.size() ? id : undefined; + }; + Tokenizer.prototype.readTagName = function () { + this.skipBlank(); + // Handle inline comment tags + if (this.input[this.p] === '#') + return this.input.slice(this.p, ++this.p); + return this.readIdentifier().getText(); + }; + Tokenizer.prototype.readHashes = function (jekyllStyle) { + var hashes = []; + while (true) { + var hash = this.readHash(jekyllStyle); + if (!hash) + return hashes; + hashes.push(hash); + } + }; + Tokenizer.prototype.readHash = function (jekyllStyle) { + this.skipBlank(); + if (this.peek() === ',') + ++this.p; + var begin = this.p; + var name = this.readNonEmptyIdentifier(); + if (!name) + return; + var value; + this.skipBlank(); + var sep = jekyllStyle ? '=' : ':'; + if (this.peek() === sep) { + ++this.p; + value = this.readValue(); + } + return new HashToken(this.input, begin, this.p, name, value, this.file); + }; + Tokenizer.prototype.remaining = function () { + return this.input.slice(this.p, this.N); + }; + Tokenizer.prototype.advance = function (step) { + if (step === void 0) { step = 1; } + this.p += step; + }; + Tokenizer.prototype.end = function () { + return this.p >= this.N; + }; + Tokenizer.prototype.readTo = function (end) { + while (this.p < this.N) { + ++this.p; + if (this.rmatch(end)) + return this.p; + } + return -1; + }; + Tokenizer.prototype.readValue = function () { + this.skipBlank(); + var begin = this.p; + var variable = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber(); + var props = this.readProperties(!variable); + if (!props.length) + return variable; + return new PropertyAccessToken(variable, props, this.input, begin, this.p); + }; + Tokenizer.prototype.readScopeValue = function () { + this.skipBlank(); + var begin = this.p; + var props = this.readProperties(); + if (!props.length) + return undefined; + return new PropertyAccessToken(undefined, props, this.input, begin, this.p); + }; + Tokenizer.prototype.readProperties = function (isBegin) { + if (isBegin === void 0) { isBegin = true; } + var props = []; + while (true) { + if (this.peek() === '[') { + this.p++; + var prop = this.readValue() || new IdentifierToken(this.input, this.p, this.p, this.file); + this.assert(this.readTo(']') !== -1, '[ not closed'); + props.push(prop); + continue; + } + if (isBegin && !props.length) { + var prop = this.readNonEmptyIdentifier(); + if (prop) { + props.push(prop); + continue; + } + } + if (this.peek() === '.' && this.peek(1) !== '.') { // skip range syntax + this.p++; + var prop = this.readNonEmptyIdentifier(); + if (!prop) + break; + props.push(prop); + continue; + } + break; + } + return props; + }; + Tokenizer.prototype.readNumber = function () { + this.skipBlank(); + var decimalFound = false; + var digitFound = false; + var n = 0; + if (this.peekType() & SIGN) + n++; + while (this.p + n <= this.N) { + if (this.peekType(n) & NUMBER) { + digitFound = true; + n++; + } + else if (this.peek(n) === '.' && this.peek(n + 1) !== '.') { + if (decimalFound || !digitFound) + return; + decimalFound = true; + n++; + } + else + break; + } + if (digitFound && !isWord(this.peek(n))) { + var num = new NumberToken(this.input, this.p, this.p + n, this.file); + this.advance(n); + return num; + } + }; + Tokenizer.prototype.readLiteral = function () { + this.skipBlank(); + var end = this.matchTrie(this.literalTrie); + if (end === -1) + return; + var literal = new LiteralToken(this.input, this.p, end, this.file); + this.p = end; + return literal; + }; + Tokenizer.prototype.readRange = function () { + this.skipBlank(); + var begin = this.p; + if (this.peek() !== '(') + return; + ++this.p; + var lhs = this.readValueOrThrow(); + this.p += 2; + var rhs = this.readValueOrThrow(); + ++this.p; + return new RangeToken(this.input, begin, this.p, lhs, rhs, this.file); + }; + Tokenizer.prototype.readValueOrThrow = function () { + var _this = this; + var value = this.readValue(); + this.assert(value, function () { return "unexpected token ".concat(_this.snapshot(), ", value expected"); }); + return value; + }; + Tokenizer.prototype.readQuoted = function () { + this.skipBlank(); + var begin = this.p; + if (!(this.peekType() & QUOTE)) + return; + ++this.p; + var escaped = false; + while (this.p < this.N) { + ++this.p; + if (this.input[this.p - 1] === this.input[begin] && !escaped) + break; + if (escaped) + escaped = false; + else if (this.input[this.p - 1] === '\\') + escaped = true; + } + return new QuotedToken(this.input, begin, this.p, this.file); + }; + Tokenizer.prototype.readFileNameTemplate = function (options) { + var outputDelimiterLeft, htmlStopStrings, htmlStopStringSet; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + outputDelimiterLeft = options.outputDelimiterLeft; + htmlStopStrings = [',', ' ', outputDelimiterLeft]; + htmlStopStringSet = new Set(htmlStopStrings); + _a.label = 1; + case 1: + if (!(this.p < this.N && !htmlStopStringSet.has(this.peek()))) return [3 /*break*/, 3]; + return [4 /*yield*/, this.match(outputDelimiterLeft) + ? this.readOutputToken(options) + : this.readHTMLToken(htmlStopStrings)]; + case 2: + _a.sent(); + return [3 /*break*/, 1]; + case 3: return [2 /*return*/]; + } + }); + }; + Tokenizer.prototype.match = function (word) { + for (var i = 0; i < word.length; i++) { + if (word[i] !== this.input[this.p + i]) + return false; + } + return true; + }; + Tokenizer.prototype.rmatch = function (pattern) { + for (var i = 0; i < pattern.length; i++) { + if (pattern[pattern.length - 1 - i] !== this.input[this.p - 1 - i]) + return false; + } + return true; + }; + Tokenizer.prototype.peekType = function (n) { + if (n === void 0) { n = 0; } + return this.p + n >= this.N ? 0 : TYPES[this.input.charCodeAt(this.p + n)]; + }; + Tokenizer.prototype.peek = function (n) { + if (n === void 0) { n = 0; } + return this.p + n >= this.N ? '' : this.input[this.p + n]; + }; + Tokenizer.prototype.skipBlank = function () { + while (this.peekType() & BLANK) + ++this.p; + }; + return Tokenizer; + }()); + + var ParseStream = /** @class */ (function () { + function ParseStream(tokens, parseToken) { + this.handlers = {}; + this.stopRequested = false; + this.tokens = tokens; + this.parseToken = parseToken; + } + ParseStream.prototype.on = function (name, cb) { + this.handlers[name] = cb; + return this; + }; + ParseStream.prototype.trigger = function (event, arg) { + var h = this.handlers[event]; + return h ? (h.call(this, arg), true) : false; + }; + ParseStream.prototype.start = function () { + this.trigger('start'); + var token; + while (!this.stopRequested && (token = this.tokens.shift())) { + if (this.trigger('token', token)) + continue; + if (isTagToken(token) && this.trigger("tag:".concat(token.name), token)) { + continue; + } + var template = this.parseToken(token, this.tokens); + this.trigger('template', template); + } + if (!this.stopRequested) + this.trigger('end'); + return this; + }; + ParseStream.prototype.stop = function () { + this.stopRequested = true; + return this; + }; + return ParseStream; + }()); + + var TemplateImpl = /** @class */ (function () { + function TemplateImpl(token) { + this.token = token; + } + return TemplateImpl; + }()); + + var Tag = /** @class */ (function (_super) { + __extends(Tag, _super); + function Tag(token, remainTokens, liquid) { + var _this = _super.call(this, token) || this; + _this.name = token.name; + _this.liquid = liquid; + _this.tokenizer = token.tokenizer; + return _this; + } + return Tag; + }(TemplateImpl)); + + /** + * Key-Value Pairs Representing Tag Arguments + * Example: + * For the markup `, foo:'bar', coo:2 reversed %}`, + * hash['foo'] === 'bar' + * hash['coo'] === 2 + * hash['reversed'] === undefined + */ + var Hash = /** @class */ (function () { + function Hash(markup, jekyllStyle) { + var e_1, _a; + this.hash = {}; + var tokenizer = new Tokenizer(markup, {}); + try { + for (var _b = __values(tokenizer.readHashes(jekyllStyle)), _c = _b.next(); !_c.done; _c = _b.next()) { + var hash = _c.value; + this.hash[hash.name.content] = hash.value; + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + } + Hash.prototype.render = function (ctx) { + var hash, _a, _b, key, _c, _d, _e, e_2_1; + var e_2, _f; + return __generator(this, function (_g) { + switch (_g.label) { + case 0: + hash = {}; + _g.label = 1; + case 1: + _g.trys.push([1, 8, 9, 10]); + _a = __values(Object.keys(this.hash)), _b = _a.next(); + _g.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 7]; + key = _b.value; + _c = hash; + _d = key; + if (!(this.hash[key] === undefined)) return [3 /*break*/, 3]; + _e = true; + return [3 /*break*/, 5]; + case 3: return [4 /*yield*/, evalToken(this.hash[key], ctx)]; + case 4: + _e = _g.sent(); + _g.label = 5; + case 5: + _c[_d] = _e; + _g.label = 6; + case 6: + _b = _a.next(); + return [3 /*break*/, 2]; + case 7: return [3 /*break*/, 10]; + case 8: + e_2_1 = _g.sent(); + e_2 = { error: e_2_1 }; + return [3 /*break*/, 10]; + case 9: + try { + if (_b && !_b.done && (_f = _a.return)) _f.call(_a); + } + finally { if (e_2) throw e_2.error; } + return [7 /*endfinally*/]; + case 10: return [2 /*return*/, hash]; + } + }); + }; + return Hash; + }()); + + function createTagClass(options) { + return /** @class */ (function (_super) { + __extends(class_1, _super); + function class_1(token, tokens, liquid) { + var _this = _super.call(this, token, tokens, liquid) || this; + if (isFunction(options.parse)) { + options.parse.call(_this, token, tokens); + } + return _this; + } + class_1.prototype.render = function (ctx, emitter) { + var hash; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, new Hash(this.token.args).render(ctx)]; + case 1: + hash = (_a.sent()); + return [4 /*yield*/, options.render.call(this, ctx, emitter, hash)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }; + return class_1; + }(Tag)); + } + + function isKeyValuePair(arr) { + return isArray(arr); + } + + var Filter = /** @class */ (function () { + function Filter(name, options, args, liquid) { + this.name = name; + this.handler = isFunction(options) + ? options + : (isFunction(options === null || options === void 0 ? void 0 : options.handler) ? options.handler : identify); + this.raw = !isFunction(options) && !!(options === null || options === void 0 ? void 0 : options.raw); + this.args = args; + this.liquid = liquid; + } + Filter.prototype.render = function (value, context) { + var argv, _a, _b, arg, _c, _d, _e, _f, _g, e_1_1; + var e_1, _h; + return __generator(this, function (_j) { + switch (_j.label) { + case 0: + argv = []; + _j.label = 1; + case 1: + _j.trys.push([1, 8, 9, 10]); + _a = __values(this.args), _b = _a.next(); + _j.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 7]; + arg = _b.value; + if (!isKeyValuePair(arg)) return [3 /*break*/, 4]; + _d = (_c = argv).push; + _e = [arg[0]]; + return [4 /*yield*/, evalToken(arg[1], context)]; + case 3: + _d.apply(_c, [_e.concat([_j.sent()])]); + return [3 /*break*/, 6]; + case 4: + _g = (_f = argv).push; + return [4 /*yield*/, evalToken(arg, context)]; + case 5: + _g.apply(_f, [_j.sent()]); + _j.label = 6; + case 6: + _b = _a.next(); + return [3 /*break*/, 2]; + case 7: return [3 /*break*/, 10]; + case 8: + e_1_1 = _j.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 9: + try { + if (_b && !_b.done && (_h = _a.return)) _h.call(_a); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 10: return [4 /*yield*/, this.handler.apply({ context: context, liquid: this.liquid }, __spreadArray([value], __read(argv), false))]; + case 11: return [2 /*return*/, _j.sent()]; + } + }); + }; + return Filter; + }()); + + var Value = /** @class */ (function () { + /** + * @param str the value to be valuated, eg.: "foobar" | truncate: 3 + */ + function Value(input, liquid) { + var _this = this; + this.filters = []; + var token = typeof input === 'string' + ? new Tokenizer(input, liquid.options.operators).readFilteredValue() + : input; + this.initial = token.initial; + this.filters = token.filters.map(function (_a) { + var name = _a.name, args = _a.args; + return new Filter(name, _this.getFilter(liquid, name), args, liquid); + }); + } + Value.prototype.value = function (ctx, lenient) { + var val, _a, _b, filter, e_1_1; + var e_1, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default'); + return [4 /*yield*/, this.initial.evaluate(ctx, lenient)]; + case 1: + val = _d.sent(); + _d.label = 2; + case 2: + _d.trys.push([2, 7, 8, 9]); + _a = __values(this.filters), _b = _a.next(); + _d.label = 3; + case 3: + if (!!_b.done) return [3 /*break*/, 6]; + filter = _b.value; + return [4 /*yield*/, filter.render(val, ctx)]; + case 4: + val = _d.sent(); + _d.label = 5; + case 5: + _b = _a.next(); + return [3 /*break*/, 3]; + case 6: return [3 /*break*/, 9]; + case 7: + e_1_1 = _d.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 9]; + case 8: + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 9: return [2 /*return*/, val]; + } + }); + }; + Value.prototype.getFilter = function (liquid, name) { + var impl = liquid.filters[name]; + assert(impl || !liquid.options.strictFilters, function () { return "undefined filter: ".concat(name); }); + return impl; + }; + return Value; + }()); + + var Output = /** @class */ (function (_super) { + __extends(Output, _super); + function Output(token, liquid) { + var _this = this; + var _a; + _this = _super.call(this, token) || this; + var tokenizer = new Tokenizer(token.input, liquid.options.operators, token.file, token.contentRange); + _this.value = new Value(tokenizer.readFilteredValue(), liquid); + var filters = _this.value.filters; + var outputEscape = liquid.options.outputEscape; + if (!((_a = filters[filters.length - 1]) === null || _a === void 0 ? void 0 : _a.raw) && outputEscape) { + filters.push(new Filter(toString.call(outputEscape), outputEscape, [], liquid)); + } + return _this; + } + Output.prototype.render = function (ctx, emitter) { + var val; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.value.value(ctx, false)]; + case 1: + val = _a.sent(); + emitter.write(val); + return [2 /*return*/]; + } + }); + }; + return Output; + }(TemplateImpl)); + + var HTML = /** @class */ (function (_super) { + __extends(HTML, _super); + function HTML(token) { + var _this = _super.call(this, token) || this; + _this.str = token.getContent(); + return _this; + } + HTML.prototype.render = function (ctx, emitter) { + return __generator(this, function (_a) { + emitter.write(this.str); + return [2 /*return*/]; + }); + }; + return HTML; + }(TemplateImpl)); + + var LookupType; + (function (LookupType) { + LookupType["Partials"] = "partials"; + LookupType["Layouts"] = "layouts"; + LookupType["Root"] = "root"; + })(LookupType || (LookupType = {})); + var Loader = /** @class */ (function () { + function Loader(options) { + this.options = options; + if (options.relativeReference) { + var sep = options.fs.sep; + assert(sep, '`fs.sep` is required for relative reference'); + var rRelativePath_1 = new RegExp(['.' + sep, '..' + sep, './', '../'].map(function (prefix) { return escapeRegex(prefix); }).join('|')); + this.shouldLoadRelative = function (referencedFile) { return rRelativePath_1.test(referencedFile); }; + } + else { + this.shouldLoadRelative = function (referencedFile) { return false; }; + } + this.contains = this.options.fs.contains || (function () { return true; }); + } + Loader.prototype.lookup = function (file, type, sync, currentFile) { + var fs, dirs, _a, _b, filepath, _c, e_1_1; + var e_1, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + fs = this.options.fs; + dirs = this.options[type]; + _e.label = 1; + case 1: + _e.trys.push([1, 8, 9, 10]); + _a = __values(this.candidates(file, dirs, currentFile, type !== LookupType.Root)), _b = _a.next(); + _e.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 7]; + filepath = _b.value; + if (!sync) return [3 /*break*/, 3]; + _c = fs.existsSync(filepath); + return [3 /*break*/, 5]; + case 3: return [4 /*yield*/, fs.exists(filepath)]; + case 4: + _c = _e.sent(); + _e.label = 5; + case 5: + if (_c) + return [2 /*return*/, filepath]; + _e.label = 6; + case 6: + _b = _a.next(); + return [3 /*break*/, 2]; + case 7: return [3 /*break*/, 10]; + case 8: + e_1_1 = _e.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 9: + try { + if (_b && !_b.done && (_d = _a.return)) _d.call(_a); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 10: throw this.lookupError(file, dirs); + } + }); + }; + Loader.prototype.candidates = function (file, dirs, currentFile, enforceRoot) { + var _a, fs, extname, referenced, dirs_1, dirs_1_1, dir, e_2_1, dirs_2, dirs_2_1, dir, referenced, e_3_1, filepath; + var e_2, _b, e_3, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _a = this.options, fs = _a.fs, extname = _a.extname; + if (!(this.shouldLoadRelative(file) && currentFile)) return [3 /*break*/, 8]; + referenced = fs.resolve(this.dirname(currentFile), file, extname); + _d.label = 1; + case 1: + _d.trys.push([1, 6, 7, 8]); + dirs_1 = __values(dirs), dirs_1_1 = dirs_1.next(); + _d.label = 2; + case 2: + if (!!dirs_1_1.done) return [3 /*break*/, 5]; + dir = dirs_1_1.value; + if (!(!enforceRoot || this.contains(dir, referenced))) return [3 /*break*/, 4]; + // the relatively referenced file is within one of root dirs + return [4 /*yield*/, referenced]; + case 3: + // the relatively referenced file is within one of root dirs + _d.sent(); + return [3 /*break*/, 5]; + case 4: + dirs_1_1 = dirs_1.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_2_1 = _d.sent(); + e_2 = { error: e_2_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (dirs_1_1 && !dirs_1_1.done && (_b = dirs_1.return)) _b.call(dirs_1); + } + finally { if (e_2) throw e_2.error; } + return [7 /*endfinally*/]; + case 8: + _d.trys.push([8, 13, 14, 15]); + dirs_2 = __values(dirs), dirs_2_1 = dirs_2.next(); + _d.label = 9; + case 9: + if (!!dirs_2_1.done) return [3 /*break*/, 12]; + dir = dirs_2_1.value; + referenced = fs.resolve(dir, file, extname); + if (!(!enforceRoot || this.contains(dir, referenced))) return [3 /*break*/, 11]; + return [4 /*yield*/, referenced]; + case 10: + _d.sent(); + _d.label = 11; + case 11: + dirs_2_1 = dirs_2.next(); + return [3 /*break*/, 9]; + case 12: return [3 /*break*/, 15]; + case 13: + e_3_1 = _d.sent(); + e_3 = { error: e_3_1 }; + return [3 /*break*/, 15]; + case 14: + try { + if (dirs_2_1 && !dirs_2_1.done && (_c = dirs_2.return)) _c.call(dirs_2); + } + finally { if (e_3) throw e_3.error; } + return [7 /*endfinally*/]; + case 15: + if (!(fs.fallback !== undefined)) return [3 /*break*/, 17]; + filepath = fs.fallback(file); + if (!(filepath !== undefined)) return [3 /*break*/, 17]; + return [4 /*yield*/, filepath]; + case 16: + _d.sent(); + _d.label = 17; + case 17: return [2 /*return*/]; + } + }); + }; + Loader.prototype.dirname = function (path) { + var fs = this.options.fs; + assert(fs.dirname, '`fs.dirname` is required for relative reference'); + return fs.dirname(path); + }; + Loader.prototype.lookupError = function (file, roots) { + var err = new Error('ENOENT'); + err.message = "ENOENT: Failed to lookup \"".concat(file, "\" in \"").concat(roots, "\""); + err.code = 'ENOENT'; + return err; + }; + return Loader; + }()); + + var Parser = /** @class */ (function () { + function Parser(liquid) { + this.liquid = liquid; + this.cache = this.liquid.options.cache; + this.fs = this.liquid.options.fs; + this.parseFile = this.cache ? this._parseFileCached : this._parseFile; + this.loader = new Loader(this.liquid.options); + } + Parser.prototype.parse = function (html, filepath) { + var tokenizer = new Tokenizer(html, this.liquid.options.operators, filepath); + var tokens = tokenizer.readTopLevelTokens(this.liquid.options); + return this.parseTokens(tokens); + }; + Parser.prototype.parseTokens = function (tokens) { + var token; + var templates = []; + var errors = []; + while ((token = tokens.shift())) { + try { + templates.push(this.parseToken(token, tokens)); + } + catch (err) { + if (this.liquid.options.catchAllErrors) + errors.push(err); + else + throw err; + } + } + if (errors.length) + throw new LiquidErrors(errors); + return templates; + }; + Parser.prototype.parseToken = function (token, remainTokens) { + try { + if (isTagToken(token)) { + var TagClass = this.liquid.tags[token.name]; + assert(TagClass, "tag \"".concat(token.name, "\" not found")); + return new TagClass(token, remainTokens, this.liquid); + } + if (isOutputToken(token)) { + return new Output(token, this.liquid); + } + return new HTML(token); + } + catch (e) { + if (LiquidError.is(e)) + throw e; + throw new ParseError(e, token); + } + }; + Parser.prototype.parseStream = function (tokens) { + var _this = this; + return new ParseStream(tokens, function (token, tokens) { return _this.parseToken(token, tokens); }); + }; + Parser.prototype._parseFileCached = function (file, sync, type, currentFile) { + var cache, key, tpls, task, taskOrTpl, _a, err_1; + if (type === void 0) { type = LookupType.Root; } + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + cache = this.cache; + key = this.loader.shouldLoadRelative(file) ? currentFile + ',' + file : type + ':' + file; + return [4 /*yield*/, cache.read(key)]; + case 1: + tpls = _b.sent(); + if (tpls) + return [2 /*return*/, tpls]; + task = this._parseFile(file, sync, type, currentFile); + if (!sync) return [3 /*break*/, 3]; + return [4 /*yield*/, task]; + case 2: + _a = _b.sent(); + return [3 /*break*/, 4]; + case 3: + _a = toPromise(task); + _b.label = 4; + case 4: + taskOrTpl = _a; + cache.write(key, taskOrTpl); + _b.label = 5; + case 5: + _b.trys.push([5, 7, , 8]); + return [4 /*yield*/, taskOrTpl]; + case 6: return [2 /*return*/, _b.sent()]; + case 7: + err_1 = _b.sent(); + cache.remove(key); + throw err_1; + case 8: return [2 /*return*/]; + } + }); + }; + Parser.prototype._parseFile = function (file, sync, type, currentFile) { + var filepath, _a, _b, _c; + if (type === void 0) { type = LookupType.Root; } + return __generator(this, function (_d) { + switch (_d.label) { + case 0: return [4 /*yield*/, this.loader.lookup(file, type, sync, currentFile)]; + case 1: + filepath = _d.sent(); + _b = (_a = this.liquid).parse; + if (!sync) return [3 /*break*/, 2]; + _c = this.fs.readFileSync(filepath); + return [3 /*break*/, 4]; + case 2: return [4 /*yield*/, this.fs.readFile(filepath)]; + case 3: + _c = _d.sent(); + _d.label = 4; + case 4: return [2 /*return*/, _b.apply(_a, [_c, filepath])]; + } + }); + }; + return Parser; + }()); + + (function (TokenKind) { + TokenKind[TokenKind["Number"] = 1] = "Number"; + TokenKind[TokenKind["Literal"] = 2] = "Literal"; + TokenKind[TokenKind["Tag"] = 4] = "Tag"; + TokenKind[TokenKind["Output"] = 8] = "Output"; + TokenKind[TokenKind["HTML"] = 16] = "HTML"; + TokenKind[TokenKind["Filter"] = 32] = "Filter"; + TokenKind[TokenKind["Hash"] = 64] = "Hash"; + TokenKind[TokenKind["PropertyAccess"] = 128] = "PropertyAccess"; + TokenKind[TokenKind["Word"] = 256] = "Word"; + TokenKind[TokenKind["Range"] = 512] = "Range"; + TokenKind[TokenKind["Quoted"] = 1024] = "Quoted"; + TokenKind[TokenKind["Operator"] = 2048] = "Operator"; + TokenKind[TokenKind["FilteredValue"] = 4096] = "FilteredValue"; + TokenKind[TokenKind["Delimited"] = 12] = "Delimited"; + })(exports.TokenKind || (exports.TokenKind = {})); + + function isDelimitedToken(val) { + return !!(getKind(val) & exports.TokenKind.Delimited); + } + function isOperatorToken(val) { + return getKind(val) === exports.TokenKind.Operator; + } + function isHTMLToken(val) { + return getKind(val) === exports.TokenKind.HTML; + } + function isOutputToken(val) { + return getKind(val) === exports.TokenKind.Output; + } + function isTagToken(val) { + return getKind(val) === exports.TokenKind.Tag; + } + function isQuotedToken(val) { + return getKind(val) === exports.TokenKind.Quoted; + } + function isLiteralToken(val) { + return getKind(val) === exports.TokenKind.Literal; + } + function isNumberToken(val) { + return getKind(val) === exports.TokenKind.Number; + } + function isPropertyAccessToken(val) { + return getKind(val) === exports.TokenKind.PropertyAccess; + } + function isWordToken(val) { + return getKind(val) === exports.TokenKind.Word; + } + function isRangeToken(val) { + return getKind(val) === exports.TokenKind.Range; + } + function getKind(val) { + return val ? val.kind : -1; + } + + var typeGuards = /*#__PURE__*/Object.freeze({ + __proto__: null, + isDelimitedToken: isDelimitedToken, + isOperatorToken: isOperatorToken, + isHTMLToken: isHTMLToken, + isOutputToken: isOutputToken, + isTagToken: isTagToken, + isQuotedToken: isQuotedToken, + isLiteralToken: isLiteralToken, + isNumberToken: isNumberToken, + isPropertyAccessToken: isPropertyAccessToken, + isWordToken: isWordToken, + isRangeToken: isRangeToken + }); + + var Context = /** @class */ (function () { + function Context(env, opts, renderOptions) { + if (env === void 0) { env = {}; } + if (opts === void 0) { opts = defaultOptions; } + if (renderOptions === void 0) { renderOptions = {}; } + var _a, _b, _c; + /** + * insert a Context-level empty scope, + * for tags like `{% capture %}` `{% assign %}` to operate + */ + this.scopes = [{}]; + this.registers = {}; + this.sync = !!renderOptions.sync; + this.opts = opts; + this.globals = (_a = renderOptions.globals) !== null && _a !== void 0 ? _a : opts.globals; + this.environments = isObject(env) ? env : Object(env); + this.strictVariables = (_b = renderOptions.strictVariables) !== null && _b !== void 0 ? _b : this.opts.strictVariables; + this.ownPropertyOnly = (_c = renderOptions.ownPropertyOnly) !== null && _c !== void 0 ? _c : opts.ownPropertyOnly; + } + Context.prototype.getRegister = function (key) { + return (this.registers[key] = this.registers[key] || {}); + }; + Context.prototype.setRegister = function (key, value) { + return (this.registers[key] = value); + }; + Context.prototype.saveRegister = function () { + var _this = this; + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + return keys.map(function (key) { return [key, _this.getRegister(key)]; }); + }; + Context.prototype.restoreRegister = function (keyValues) { + var _this = this; + return keyValues.forEach(function (_a) { + var _b = __read(_a, 2), key = _b[0], value = _b[1]; + return _this.setRegister(key, value); + }); + }; + Context.prototype.getAll = function () { + return __spreadArray([this.globals, this.environments], __read(this.scopes), false).reduce(function (ctx, val) { return __assign(ctx, val); }, {}); + }; + /** + * @deprecated use `_get()` or `getSync()` instead + */ + Context.prototype.get = function (paths) { + return this.getSync(paths); + }; + Context.prototype.getSync = function (paths) { + return toValueSync(this._get(paths)); + }; + Context.prototype._get = function (paths) { + var scope; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + scope = this.findScope(paths[0]); + return [4 /*yield*/, this._getFromScope(scope, paths)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }; + /** + * @deprecated use `_get()` instead + */ + Context.prototype.getFromScope = function (scope, paths) { + return toValueSync(this._getFromScope(scope, paths)); + }; + Context.prototype._getFromScope = function (scope, paths, strictVariables) { + var i; + if (strictVariables === void 0) { strictVariables = this.strictVariables; } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (isString(paths)) + paths = paths.split('.'); + i = 0; + _a.label = 1; + case 1: + if (!(i < paths.length)) return [3 /*break*/, 4]; + return [4 /*yield*/, readProperty(scope, paths[i], this.ownPropertyOnly)]; + case 2: + scope = _a.sent(); + if (strictVariables && isUndefined(scope)) { + throw new InternalUndefinedVariableError(paths.slice(0, i + 1).join('.')); + } + _a.label = 3; + case 3: + i++; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/, scope]; + } + }); + }; + Context.prototype.push = function (ctx) { + return this.scopes.push(ctx); + }; + Context.prototype.pop = function () { + return this.scopes.pop(); + }; + Context.prototype.bottom = function () { + return this.scopes[0]; + }; + Context.prototype.findScope = function (key) { + for (var i = this.scopes.length - 1; i >= 0; i--) { + var candidate = this.scopes[i]; + if (key in candidate) + return candidate; + } + if (key in this.environments) + return this.environments; + return this.globals; + }; + return Context; + }()); + function readProperty(obj, key, ownPropertyOnly) { + obj = toLiquid(obj); + if (isNil(obj)) + return obj; + if (isArray(obj) && key < 0) + return obj[obj.length + +key]; + var value = readJSProperty(obj, key, ownPropertyOnly); + if (value === undefined && obj instanceof Drop) + return obj.liquidMethodMissing(key); + if (isFunction(value)) + return value.call(obj); + if (key === 'size') + return readSize(obj); + else if (key === 'first') + return readFirst(obj); + else if (key === 'last') + return readLast(obj); + return value; + } + function readJSProperty(obj, key, ownPropertyOnly) { + if (ownPropertyOnly && !Object.hasOwnProperty.call(obj, key) && !(obj instanceof Drop)) + return undefined; + return obj[key]; + } + function readFirst(obj) { + if (isArray(obj)) + return obj[0]; + return obj['first']; + } + function readLast(obj) { + if (isArray(obj)) + return obj[obj.length - 1]; + return obj['last']; + } + function readSize(obj) { + if (obj.hasOwnProperty('size') || obj['size'] !== undefined) + return obj['size']; + if (isArray(obj) || isString(obj)) + return obj.length; + if (typeof obj === 'object') + return Object.keys(obj).length; + } + + var BlockMode; + (function (BlockMode) { + /* store rendered html into blocks */ + BlockMode[BlockMode["OUTPUT"] = 0] = "OUTPUT"; + /* output rendered html directly */ + BlockMode[BlockMode["STORE"] = 1] = "STORE"; + })(BlockMode || (BlockMode = {})); + + var abs = argumentsToValue(Math.abs); + var at_least = argumentsToValue(Math.max); + var at_most = argumentsToValue(Math.min); + var ceil = argumentsToValue(Math.ceil); + var divided_by = argumentsToValue(function (dividend, divisor, integerArithmetic) { + if (integerArithmetic === void 0) { integerArithmetic = false; } + return integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor; + }); + var floor = argumentsToValue(Math.floor); + var minus = argumentsToValue(function (v, arg) { return v - arg; }); + var modulo = argumentsToValue(function (v, arg) { return v % arg; }); + var times = argumentsToValue(function (v, arg) { return v * arg; }); + function round(v, arg) { + if (arg === void 0) { arg = 0; } + v = toValue(v); + arg = toValue(arg); + var amp = Math.pow(10, arg); + return Math.round(v * amp) / amp; + } + function plus(v, arg) { + v = toValue(v); + arg = toValue(arg); + return Number(v) + Number(arg); + } + + var mathFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + abs: abs, + at_least: at_least, + at_most: at_most, + ceil: ceil, + divided_by: divided_by, + floor: floor, + minus: minus, + modulo: modulo, + times: times, + round: round, + plus: plus + }); + + var url_decode = function (x) { return decodeURIComponent(stringify(x)).replace(/\+/g, ' '); }; + var url_encode = function (x) { return encodeURIComponent(stringify(x)).replace(/%20/g, '+'); }; + var cgi_escape = function (x) { return encodeURIComponent(stringify(x)) + .replace(/%20/g, '+') + .replace(/[!'()*]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase(); }); }; + var uri_escape = function (x) { return encodeURI(stringify(x)) + .replace(/%5B/g, '[') + .replace(/%5D/g, ']'); }; + var rSlugifyDefault = /[^\p{M}\p{L}\p{Nd}]+/ug; + var rSlugifyReplacers = { + 'raw': /\s+/g, + 'default': rSlugifyDefault, + 'pretty': /[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/ug, + 'ascii': /[^A-Za-z0-9]+/g, + 'latin': rSlugifyDefault, + 'none': null + }; + function slugify(str, mode, cased) { + if (mode === void 0) { mode = 'default'; } + if (cased === void 0) { cased = false; } + str = stringify(str); + var replacer = rSlugifyReplacers[mode]; + if (replacer) { + if (mode === 'latin') + str = removeAccents(str); + str = str.replace(replacer, '-').replace(/^-|-$/g, ''); + } + return cased ? str : str.toLowerCase(); + } + function removeAccents(str) { + return str.replace(/[àáâãäå]/g, 'a') + .replace(/[æ]/g, 'ae') + .replace(/[ç]/g, 'c') + .replace(/[èéêë]/g, 'e') + .replace(/[ìíîï]/g, 'i') + .replace(/[ð]/g, 'd') + .replace(/[ñ]/g, 'n') + .replace(/[òóôõöø]/g, 'o') + .replace(/[ùúûü]/g, 'u') + .replace(/[ýÿ]/g, 'y') + .replace(/[ß]/g, 'ss') + .replace(/[œ]/g, 'oe') + .replace(/[þ]/g, 'th') + .replace(/[ẞ]/g, 'SS') + .replace(/[Œ]/g, 'OE') + .replace(/[Þ]/g, 'TH'); + } + + var urlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + url_decode: url_decode, + url_encode: url_encode, + cgi_escape: cgi_escape, + uri_escape: uri_escape, + slugify: slugify + }); + + var join = argumentsToValue(function (v, arg) { return toArray(v).join(arg === undefined ? ' ' : arg); }); + var last$1 = argumentsToValue(function (v) { return isArray(v) ? last(v) : ''; }); + var first = argumentsToValue(function (v) { return isArray(v) ? v[0] : ''; }); + var reverse = argumentsToValue(function (v) { return __spreadArray([], __read(toArray(v)), false).reverse(); }); + function sort(arr, property) { + var values, _a, _b, item, _c, _d, _e, _f, e_1_1; + var e_1, _g; + return __generator(this, function (_h) { + switch (_h.label) { + case 0: + values = []; + _h.label = 1; + case 1: + _h.trys.push([1, 8, 9, 10]); + _a = __values(toArray(arr)), _b = _a.next(); + _h.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 7]; + item = _b.value; + _d = (_c = values).push; + _e = [item]; + if (!property) return [3 /*break*/, 4]; + return [4 /*yield*/, this.context._getFromScope(item, stringify(property).split('.'), false)]; + case 3: + _f = _h.sent(); + return [3 /*break*/, 5]; + case 4: + _f = item; + _h.label = 5; + case 5: + _d.apply(_c, [_e.concat([ + _f + ])]); + _h.label = 6; + case 6: + _b = _a.next(); + return [3 /*break*/, 2]; + case 7: return [3 /*break*/, 10]; + case 8: + e_1_1 = _h.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 9: + try { + if (_b && !_b.done && (_g = _a.return)) _g.call(_a); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 10: return [2 /*return*/, values.sort(function (lhs, rhs) { + var lvalue = lhs[1]; + var rvalue = rhs[1]; + return lvalue < rvalue ? -1 : (lvalue > rvalue ? 1 : 0); + }).map(function (tuple) { return tuple[0]; })]; + } + }); + } + function sort_natural(input, property) { + var propertyString = stringify(property); + var compare = property === undefined + ? caseInsensitiveCompare + : function (lhs, rhs) { return caseInsensitiveCompare(lhs[propertyString], rhs[propertyString]); }; + return __spreadArray([], __read(toArray(input)), false).sort(compare); + } + var size = function (v) { return (v && v.length) || 0; }; + function map(arr, property) { + var results, _a, _b, item, _c, _d, e_2_1; + var e_2, _e; + return __generator(this, function (_f) { + switch (_f.label) { + case 0: + results = []; + _f.label = 1; + case 1: + _f.trys.push([1, 6, 7, 8]); + _a = __values(toArray(arr)), _b = _a.next(); + _f.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 5]; + item = _b.value; + _d = (_c = results).push; + return [4 /*yield*/, this.context._getFromScope(item, stringify(property), false)]; + case 3: + _d.apply(_c, [_f.sent()]); + _f.label = 4; + case 4: + _b = _a.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_2_1 = _f.sent(); + e_2 = { error: e_2_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (_b && !_b.done && (_e = _a.return)) _e.call(_a); + } + finally { if (e_2) throw e_2.error; } + return [7 /*endfinally*/]; + case 8: return [2 /*return*/, results]; + } + }); + } + function sum(arr, property) { + var sum, _a, _b, item, data, _c, _d, e_3_1; + var e_3, _e; + return __generator(this, function (_f) { + switch (_f.label) { + case 0: + sum = 0; + _f.label = 1; + case 1: + _f.trys.push([1, 8, 9, 10]); + _a = __values(toArray(arr)), _b = _a.next(); + _f.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 7]; + item = _b.value; + _c = Number; + if (!property) return [3 /*break*/, 4]; + return [4 /*yield*/, this.context._getFromScope(item, stringify(property), false)]; + case 3: + _d = _f.sent(); + return [3 /*break*/, 5]; + case 4: + _d = item; + _f.label = 5; + case 5: + data = _c.apply(void 0, [_d]); + sum += Number.isNaN(data) ? 0 : data; + _f.label = 6; + case 6: + _b = _a.next(); + return [3 /*break*/, 2]; + case 7: return [3 /*break*/, 10]; + case 8: + e_3_1 = _f.sent(); + e_3 = { error: e_3_1 }; + return [3 /*break*/, 10]; + case 9: + try { + if (_b && !_b.done && (_e = _a.return)) _e.call(_a); + } + finally { if (e_3) throw e_3.error; } + return [7 /*endfinally*/]; + case 10: return [2 /*return*/, sum]; + } + }); + } + function compact(arr) { + return toArray(arr).filter(function (x) { return !isNil(toValue(x)); }); + } + function concat(v, arg) { + if (arg === void 0) { arg = []; } + return toArray(v).concat(toArray(arg)); + } + function push(v, arg) { + return concat(v, [arg]); + } + function unshift(v, arg) { + var clone = __spreadArray([], __read(toArray(v)), false); + clone.unshift(arg); + return clone; + } + function pop(v) { + var clone = __spreadArray([], __read(toArray(v)), false); + clone.pop(); + return clone; + } + function shift(v) { + var clone = __spreadArray([], __read(toArray(v)), false); + clone.shift(); + return clone; + } + function slice(v, begin, length) { + if (length === void 0) { length = 1; } + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + begin = begin < 0 ? v.length + begin : begin; + return v.slice(begin, begin + length); + } + function where(arr, property, expected) { + var values, token, arr_1, arr_1_1, item, _a, _b, e_4_1; + var e_4, _c; + var _this = this; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + values = []; + arr = toArray(arr); + token = new Tokenizer(stringify(property)).readScopeValue(); + _d.label = 1; + case 1: + _d.trys.push([1, 6, 7, 8]); + arr_1 = __values(arr), arr_1_1 = arr_1.next(); + _d.label = 2; + case 2: + if (!!arr_1_1.done) return [3 /*break*/, 5]; + item = arr_1_1.value; + _b = (_a = values).push; + return [4 /*yield*/, evalToken(token, new Context(item))]; + case 3: + _b.apply(_a, [_d.sent()]); + _d.label = 4; + case 4: + arr_1_1 = arr_1.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_4_1 = _d.sent(); + e_4 = { error: e_4_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (arr_1_1 && !arr_1_1.done && (_c = arr_1.return)) _c.call(arr_1); + } + finally { if (e_4) throw e_4.error; } + return [7 /*endfinally*/]; + case 8: return [2 /*return*/, arr.filter(function (_, i) { + if (expected === undefined) + return isTruthy(values[i], _this.context); + return equals(values[i], expected); + })]; + } + }); + } + function where_exp(arr, itemName, exp) { + var filtered, keyTemplate, _a, _b, item, value, e_5_1; + var e_5, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + filtered = []; + keyTemplate = new Value(stringify(exp), this.liquid); + _e.label = 1; + case 1: + _e.trys.push([1, 6, 7, 8]); + _a = __values(toArray(arr)), _b = _a.next(); + _e.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 5]; + item = _b.value; + return [4 /*yield*/, keyTemplate.value(new Context((_d = {}, _d[itemName] = item, _d)))]; + case 3: + value = _e.sent(); + if (value) + filtered.push(item); + _e.label = 4; + case 4: + _b = _a.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_5_1 = _e.sent(); + e_5 = { error: e_5_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_5) throw e_5.error; } + return [7 /*endfinally*/]; + case 8: return [2 /*return*/, filtered]; + } + }); + } + function group_by(arr, property) { + var map, token, arr_2, arr_2_1, item, key, e_6_1; + var e_6, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + map = new Map(); + arr = toArray(arr); + token = new Tokenizer(stringify(property)).readScopeValue(); + _b.label = 1; + case 1: + _b.trys.push([1, 6, 7, 8]); + arr_2 = __values(arr), arr_2_1 = arr_2.next(); + _b.label = 2; + case 2: + if (!!arr_2_1.done) return [3 /*break*/, 5]; + item = arr_2_1.value; + return [4 /*yield*/, evalToken(token, new Context(item))]; + case 3: + key = _b.sent(); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + _b.label = 4; + case 4: + arr_2_1 = arr_2.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_6_1 = _b.sent(); + e_6 = { error: e_6_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (arr_2_1 && !arr_2_1.done && (_a = arr_2.return)) _a.call(arr_2); + } + finally { if (e_6) throw e_6.error; } + return [7 /*endfinally*/]; + case 8: return [2 /*return*/, __spreadArray([], __read(map.entries()), false).map(function (_a) { + var _b = __read(_a, 2), name = _b[0], items = _b[1]; + return ({ name: name, items: items }); + })]; + } + }); + } + function group_by_exp(arr, itemName, exp) { + var map, keyTemplate, _a, _b, item, key, e_7_1; + var e_7, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + map = new Map(); + keyTemplate = new Value(stringify(exp), this.liquid); + _e.label = 1; + case 1: + _e.trys.push([1, 6, 7, 8]); + _a = __values(toArray(arr)), _b = _a.next(); + _e.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 5]; + item = _b.value; + return [4 /*yield*/, keyTemplate.value(new Context((_d = {}, _d[itemName] = item, _d)))]; + case 3: + key = _e.sent(); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + _e.label = 4; + case 4: + _b = _a.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_7_1 = _e.sent(); + e_7 = { error: e_7_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_7) throw e_7.error; } + return [7 /*endfinally*/]; + case 8: return [2 /*return*/, __spreadArray([], __read(map.entries()), false).map(function (_a) { + var _b = __read(_a, 2), name = _b[0], items = _b[1]; + return ({ name: name, items: items }); + })]; + } + }); + } + function find(arr, property, expected) { + var token, _a, _b, item, value, e_8_1; + var e_8, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + token = new Tokenizer(stringify(property)).readScopeValue(); + _d.label = 1; + case 1: + _d.trys.push([1, 6, 7, 8]); + _a = __values(toArray(arr)), _b = _a.next(); + _d.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 5]; + item = _b.value; + return [4 /*yield*/, evalToken(token, new Context(item))]; + case 3: + value = _d.sent(); + if (equals(value, expected)) + return [2 /*return*/, item]; + _d.label = 4; + case 4: + _b = _a.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_8_1 = _d.sent(); + e_8 = { error: e_8_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_8) throw e_8.error; } + return [7 /*endfinally*/]; + case 8: return [2 /*return*/, null]; + } + }); + } + function find_exp(arr, itemName, exp) { + var predicate, _a, _b, item, value, e_9_1; + var e_9, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + predicate = new Value(stringify(exp), this.liquid); + _e.label = 1; + case 1: + _e.trys.push([1, 6, 7, 8]); + _a = __values(toArray(arr)), _b = _a.next(); + _e.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 5]; + item = _b.value; + return [4 /*yield*/, predicate.value(new Context((_d = {}, _d[itemName] = item, _d)))]; + case 3: + value = _e.sent(); + if (value) + return [2 /*return*/, item]; + _e.label = 4; + case 4: + _b = _a.next(); + return [3 /*break*/, 2]; + case 5: return [3 /*break*/, 8]; + case 6: + e_9_1 = _e.sent(); + e_9 = { error: e_9_1 }; + return [3 /*break*/, 8]; + case 7: + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_9) throw e_9.error; } + return [7 /*endfinally*/]; + case 8: return [2 /*return*/, null]; + } + }); + } + function uniq(arr) { + arr = toValue(arr); + var u = {}; + return (arr || []).filter(function (val) { + if (hasOwnProperty.call(u, String(val))) + return false; + u[String(val)] = true; + return true; + }); + } + function sample(v, count) { + if (count === void 0) { count = 1; } + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + var shuffled = __spreadArray([], __read(v), false).sort(function () { return Math.random() - 0.5; }); + if (count === 1) + return shuffled[0]; + return shuffled.slice(0, count); + } + + var arrayFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + join: join, + last: last$1, + first: first, + reverse: reverse, + sort: sort, + sort_natural: sort_natural, + size: size, + map: map, + sum: sum, + compact: compact, + concat: concat, + push: push, + unshift: unshift, + pop: pop, + shift: shift, + slice: slice, + where: where, + where_exp: where_exp, + group_by: group_by, + group_by_exp: group_by_exp, + find: find, + find_exp: find_exp, + uniq: uniq, + sample: sample + }); + + function date(v, format, timezoneOffset) { + var date = parseDate(v, this.context.opts, timezoneOffset); + if (!date) + return v; + format = toValue(format); + format = isNil(format) ? this.context.opts.dateFormat : stringify(format); + return strftime(date, format); + } + function date_to_xmlschema(v) { + return date.call(this, v, '%Y-%m-%dT%H:%M:%S%:z'); + } + function date_to_rfc822(v) { + return date.call(this, v, '%a, %d %b %Y %H:%M:%S %z'); + } + function date_to_string(v, type, style) { + return stringify_date.call(this, v, '%b', type, style); + } + function date_to_long_string(v, type, style) { + return stringify_date.call(this, v, '%B', type, style); + } + function stringify_date(v, month_type, type, style) { + var date = parseDate(v, this.context.opts); + if (!date) + return v; + if (type === 'ordinal') { + var d = date.getDate(); + return style === 'US' + ? strftime(date, "".concat(month_type, " ").concat(d, "%q, %Y")) + : strftime(date, "".concat(d, "%q ").concat(month_type, " %Y")); + } + return strftime(date, "%d ".concat(month_type, " %Y")); + } + function parseDate(v, opts, timezoneOffset) { + var date; + v = toValue(v); + if (v === 'now' || v === 'today') { + date = new Date(); + } + else if (isNumber(v)) { + date = new Date(v * 1000); + } + else if (isString(v)) { + if (/^\d+$/.test(v)) { + date = new Date(+v * 1000); + } + else if (opts.preserveTimezones) { + date = TimezoneDate.createDateFixedToTimezone(v); + } + else { + date = new Date(v); + } + } + else { + date = v; + } + if (!isValidDate(date)) + return; + if (timezoneOffset !== undefined) { + date = new TimezoneDate(date, timezoneOffset); + } + else if (!(date instanceof TimezoneDate) && opts.timezoneOffset !== undefined) { + date = new TimezoneDate(date, opts.timezoneOffset); + } + return date; + } + function isValidDate(date) { + return (date instanceof Date || date instanceof TimezoneDate) && !isNaN(date.getTime()); + } + + var dateFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + date: date, + date_to_xmlschema: date_to_xmlschema, + date_to_rfc822: date_to_rfc822, + date_to_string: date_to_string, + date_to_long_string: date_to_long_string + }); + + /** + * String related filters + * + * * prefer stringify() to String() since `undefined`, `null` should eval '' + */ + var rCJKWord = /[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu; + // Word boundary followed by word characters (for detecting words) + var rNonCJKWord = /[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu; + function append(v, arg) { + assert(arguments.length === 2, 'append expect 2 arguments'); + return stringify(v) + stringify(arg); + } + function prepend(v, arg) { + assert(arguments.length === 2, 'prepend expect 2 arguments'); + return stringify(arg) + stringify(v); + } + function lstrip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v).replace(new RegExp("^[".concat(chars, "]+"), 'g'), ''); + } + return stringify(v).replace(/^\s+/, ''); + } + function downcase(v) { + return stringify(v).toLowerCase(); + } + function upcase(str) { + return stringify(str).toUpperCase(); + } + function remove(v, arg) { + return stringify(v).split(stringify(arg)).join(''); + } + function remove_first(v, l) { + return stringify(v).replace(stringify(l), ''); + } + function remove_last(v, l) { + var str = stringify(v); + var pattern = stringify(l); + var index = str.lastIndexOf(pattern); + if (index === -1) + return str; + return str.substring(0, index) + str.substring(index + pattern.length); + } + function rstrip(str, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(str).replace(new RegExp("[".concat(chars, "]+$"), 'g'), ''); + } + return stringify(str).replace(/\s+$/, ''); + } + function split(v, arg) { + var arr = stringify(v).split(stringify(arg)); + // align to ruby split, which is the behavior of shopify/liquid + // see: https://ruby-doc.org/core-2.4.0/String.html#method-i-split + while (arr.length && arr[arr.length - 1] === '') + arr.pop(); + return arr; + } + function strip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v) + .replace(new RegExp("^[".concat(chars, "]+"), 'g'), '') + .replace(new RegExp("[".concat(chars, "]+$"), 'g'), ''); + } + return stringify(v).trim(); + } + function strip_newlines(v) { + return stringify(v).replace(/\r?\n/gm, ''); + } + function capitalize(str) { + str = stringify(str); + return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); + } + function replace(v, pattern, replacement) { + return stringify(v).split(stringify(pattern)).join(replacement); + } + function replace_first(v, arg1, arg2) { + return stringify(v).replace(stringify(arg1), arg2); + } + function replace_last(v, arg1, arg2) { + var str = stringify(v); + var pattern = stringify(arg1); + var index = str.lastIndexOf(pattern); + if (index === -1) + return str; + var replacement = stringify(arg2); + return str.substring(0, index) + replacement + str.substring(index + pattern.length); + } + function truncate(v, l, o) { + if (l === void 0) { l = 50; } + if (o === void 0) { o = '...'; } + v = stringify(v); + if (v.length <= l) + return v; + return v.substring(0, l - o.length) + o; + } + function truncatewords(v, words, o) { + if (words === void 0) { words = 15; } + if (o === void 0) { o = '...'; } + var arr = stringify(v).split(/\s+/); + if (words <= 0) + words = 1; + var ret = arr.slice(0, words).join(' '); + if (arr.length >= words) + ret += o; + return ret; + } + function normalize_whitespace(v) { + v = stringify(v); + return v.replace(/\s+/g, ' '); + } + function number_of_words(input, mode) { + input = stringify(input).trim(); + if (!input) + return 0; + switch (mode) { + case 'cjk': + // Count CJK characters and words + return (input.match(rCJKWord) || []).length + (input.match(rNonCJKWord) || []).length; + case 'auto': + // Count CJK characters, if none, count words + return rCJKWord.test(input) + ? input.match(rCJKWord).length + (input.match(rNonCJKWord) || []).length + : input.split(/\s+/).length; + default: + // Count words only + return input.split(/\s+/).length; + } + } + function array_to_sentence_string(array, connector) { + if (connector === void 0) { connector = 'and'; } + switch (array.length) { + case 0: + return ''; + case 1: + return array[0]; + case 2: + return "".concat(array[0], " ").concat(connector, " ").concat(array[1]); + default: + return "".concat(array.slice(0, -1).join(', '), ", ").concat(connector, " ").concat(array[array.length - 1]); + } + } + + var stringFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + append: append, + prepend: prepend, + lstrip: lstrip, + downcase: downcase, + upcase: upcase, + remove: remove, + remove_first: remove_first, + remove_last: remove_last, + rstrip: rstrip, + split: split, + strip: strip, + strip_newlines: strip_newlines, + capitalize: capitalize, + replace: replace, + replace_first: replace_first, + replace_last: replace_last, + truncate: truncate, + truncatewords: truncatewords, + normalize_whitespace: normalize_whitespace, + number_of_words: number_of_words, + array_to_sentence_string: array_to_sentence_string + }); + + var filters = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, htmlFilters), mathFilters), urlFilters), arrayFilters), dateFilters), stringFilters), misc); + + var default_1 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + _this.key = _this.tokenizer.readIdentifier().content; + _this.tokenizer.assert(_this.key, 'expected variable name'); + _this.tokenizer.skipBlank(); + _this.tokenizer.assert(_this.tokenizer.peek() === '=', 'expected "="'); + _this.tokenizer.advance(); + _this.value = new Value(_this.tokenizer.readFilteredValue(), _this.liquid); + return _this; + } + default_1.prototype.render = function (ctx) { + var _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _a = ctx.bottom(); + _b = this.key; + return [4 /*yield*/, this.value.value(ctx, this.liquid.options.lenientIf)]; + case 1: + _a[_b] = _c.sent(); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var MODIFIERS = ['offset', 'limit', 'reversed']; + var default_1$1 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + var variable = _this.tokenizer.readIdentifier(); + var inStr = _this.tokenizer.readIdentifier(); + var collection = _this.tokenizer.readValue(); + if (!variable.size() || inStr.content !== 'in' || !collection) { + throw new Error("illegal tag: ".concat(token.getText())); + } + _this.variable = variable.content; + _this.collection = collection; + _this.hash = new Hash(_this.tokenizer.remaining()); + _this.templates = []; + _this.elseTemplates = []; + var p; + var stream = _this.liquid.parser.parseStream(remainTokens) + .on('start', function () { return (p = _this.templates); }) + .on('tag:else', function () { return (p = _this.elseTemplates); }) + .on('tag:endfor', function () { return stream.stop(); }) + .on('template', function (tpl) { return p.push(tpl); }) + .on('end', function () { + throw new Error("tag ".concat(token.getText(), " not closed")); + }); + stream.start(); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var r, collection, _a, continueKey, hash, modifiers, scope, collection_1, collection_1_1, item, e_1_1; + var e_1, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + r = this.liquid.renderer; + _a = toEnumerable; + return [4 /*yield*/, evalToken(this.collection, ctx)]; + case 1: + collection = _a.apply(void 0, [_c.sent()]); + if (!!collection.length) return [3 /*break*/, 3]; + return [4 /*yield*/, r.renderTemplates(this.elseTemplates, ctx, emitter)]; + case 2: + _c.sent(); + return [2 /*return*/]; + case 3: + continueKey = 'continue-' + this.variable + '-' + this.collection.getText(); + ctx.push({ continue: ctx.getRegister(continueKey) }); + return [4 /*yield*/, this.hash.render(ctx)]; + case 4: + hash = _c.sent(); + ctx.pop(); + modifiers = this.liquid.options.orderedFilterParameters + ? Object.keys(hash).filter(function (x) { return MODIFIERS.includes(x); }) + : MODIFIERS.filter(function (x) { return hash[x] !== undefined; }); + collection = modifiers.reduce(function (collection, modifier) { + if (modifier === 'offset') + return offset(collection, hash['offset']); + if (modifier === 'limit') + return limit(collection, hash['limit']); + return reversed(collection); + }, collection); + ctx.setRegister(continueKey, (hash['offset'] || 0) + collection.length); + scope = { forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) }; + ctx.push(scope); + _c.label = 5; + case 5: + _c.trys.push([5, 10, 11, 12]); + collection_1 = __values(collection), collection_1_1 = collection_1.next(); + _c.label = 6; + case 6: + if (!!collection_1_1.done) return [3 /*break*/, 9]; + item = collection_1_1.value; + scope[this.variable] = item; + return [4 /*yield*/, r.renderTemplates(this.templates, ctx, emitter)]; + case 7: + _c.sent(); + if (emitter['break']) { + emitter['break'] = false; + return [3 /*break*/, 9]; + } + emitter['continue'] = false; + scope.forloop.next(); + _c.label = 8; + case 8: + collection_1_1 = collection_1.next(); + return [3 /*break*/, 6]; + case 9: return [3 /*break*/, 12]; + case 10: + e_1_1 = _c.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 12]; + case 11: + try { + if (collection_1_1 && !collection_1_1.done && (_b = collection_1.return)) _b.call(collection_1); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 12: + ctx.pop(); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + function reversed(arr) { + return __spreadArray([], __read(arr), false).reverse(); + } + function offset(arr, count) { + return arr.slice(count); + } + function limit(arr, count) { + return arr.slice(0, count); + } + + var default_1$2 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + _this.templates = []; + _this.variable = _this.readVariableName(); + while (remainTokens.length) { + var token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcapture') + return _this; + _this.templates.push(liquid.parser.parseToken(token, remainTokens)); + } + throw new Error("tag ".concat(tagToken.getText(), " not closed")); + } + default_1.prototype.render = function (ctx) { + var r, html; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + r = this.liquid.renderer; + return [4 /*yield*/, r.renderTemplates(this.templates, ctx)]; + case 1: + html = _a.sent(); + ctx.bottom()[this.variable] = html; + return [2 /*return*/]; + } + }); + }; + default_1.prototype.readVariableName = function () { + var word = this.tokenizer.readIdentifier().content; + if (word) + return word; + var quoted = this.tokenizer.readQuoted(); + if (quoted) + return evalQuotedToken(quoted); + throw this.tokenizer.error('invalid capture name'); + }; + return default_1; + }(Tag)); + + var default_1$3 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + _this.branches = []; + _this.elseTemplates = []; + _this.value = new Value(_this.tokenizer.readFilteredValue(), _this.liquid); + _this.elseTemplates = []; + var p = []; + var elseCount = 0; + var stream = _this.liquid.parser.parseStream(remainTokens) + .on('tag:when', function (token) { + if (elseCount > 0) { + return; + } + p = []; + var values = []; + while (!token.tokenizer.end()) { + values.push(token.tokenizer.readValueOrThrow()); + token.tokenizer.skipBlank(); + if (token.tokenizer.peek() === ',') { + token.tokenizer.readTo(','); + } + else { + token.tokenizer.readTo('or'); + } + } + _this.branches.push({ + values: values, + templates: p + }); + }) + .on('tag:else', function () { + elseCount++; + p = _this.elseTemplates; + }) + .on('tag:endcase', function () { return stream.stop(); }) + .on('template', function (tpl) { + if (p !== _this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', function () { + throw new Error("tag ".concat(tagToken.getText(), " not closed")); + }); + stream.start(); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var r, target, _a, branchHit, _b, _c, branch, _d, _e, valueToken, value, e_1_1, e_2_1; + var e_2, _f, e_1, _g; + return __generator(this, function (_h) { + switch (_h.label) { + case 0: + r = this.liquid.renderer; + _a = toValue; + return [4 /*yield*/, this.value.value(ctx, ctx.opts.lenientIf)]; + case 1: + target = _a.apply(void 0, [_h.sent()]); + branchHit = false; + _h.label = 2; + case 2: + _h.trys.push([2, 14, 15, 16]); + _b = __values(this.branches), _c = _b.next(); + _h.label = 3; + case 3: + if (!!_c.done) return [3 /*break*/, 13]; + branch = _c.value; + _h.label = 4; + case 4: + _h.trys.push([4, 10, 11, 12]); + _d = (e_1 = void 0, __values(branch.values)), _e = _d.next(); + _h.label = 5; + case 5: + if (!!_e.done) return [3 /*break*/, 9]; + valueToken = _e.value; + return [4 /*yield*/, evalToken(valueToken, ctx, ctx.opts.lenientIf)]; + case 6: + value = _h.sent(); + if (!equals(target, value)) return [3 /*break*/, 8]; + return [4 /*yield*/, r.renderTemplates(branch.templates, ctx, emitter)]; + case 7: + _h.sent(); + branchHit = true; + return [3 /*break*/, 9]; + case 8: + _e = _d.next(); + return [3 /*break*/, 5]; + case 9: return [3 /*break*/, 12]; + case 10: + e_1_1 = _h.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 12]; + case 11: + try { + if (_e && !_e.done && (_g = _d.return)) _g.call(_d); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 12: + _c = _b.next(); + return [3 /*break*/, 3]; + case 13: return [3 /*break*/, 16]; + case 14: + e_2_1 = _h.sent(); + e_2 = { error: e_2_1 }; + return [3 /*break*/, 16]; + case 15: + try { + if (_c && !_c.done && (_f = _b.return)) _f.call(_b); + } + finally { if (e_2) throw e_2.error; } + return [7 /*endfinally*/]; + case 16: + if (!!branchHit) return [3 /*break*/, 18]; + return [4 /*yield*/, r.renderTemplates(this.elseTemplates, ctx, emitter)]; + case 17: + _h.sent(); + _h.label = 18; + case 18: return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$4 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + while (remainTokens.length) { + var token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcomment') + return _this; + } + throw new Error("tag ".concat(tagToken.getText(), " not closed")); + } + default_1.prototype.render = function () { }; + return default_1; + }(Tag)); + + var default_1$5 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + var tokenizer = _this.tokenizer; + _this.file = parseFilePath(tokenizer, _this.liquid); + _this.currentFile = token.file; + while (!tokenizer.end()) { + tokenizer.skipBlank(); + var begin = tokenizer.p; + var keyword = tokenizer.readIdentifier(); + if (keyword.content === 'with' || keyword.content === 'for') { + tokenizer.skipBlank(); + // can be normal key/value pair, like "with: true" + if (tokenizer.peek() !== ':') { + var value = tokenizer.readValue(); + // can be normal key, like "with," + if (value) { + var beforeAs = tokenizer.p; + var asStr = tokenizer.readIdentifier(); + var alias = void 0; + if (asStr.content === 'as') + alias = tokenizer.readIdentifier(); + else + tokenizer.p = beforeAs; + _this[keyword.content] = { value: value, alias: alias && alias.content }; + tokenizer.skipBlank(); + if (tokenizer.peek() === ',') + tokenizer.advance(); + continue; // matched! + } + } + } + /** + * restore cursor if with/for not matched + */ + tokenizer.p = begin; + break; + } + _this.hash = new Hash(tokenizer.remaining()); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var _a, liquid, hash, filepath, childCtx, scope, _b, _c, _d, value, alias, _e, _f, _g, value, alias, collection, _h, collection_1, collection_1_1, item, templates, e_1_1, templates; + var e_1, _j; + return __generator(this, function (_k) { + switch (_k.label) { + case 0: + _a = this, liquid = _a.liquid, hash = _a.hash; + return [4 /*yield*/, renderFilePath(this['file'], ctx, liquid)]; + case 1: + filepath = (_k.sent()); + assert(filepath, function () { return "illegal file path \"".concat(filepath, "\""); }); + childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables }); + scope = childCtx.bottom(); + _b = __assign; + _c = [scope]; + return [4 /*yield*/, hash.render(ctx)]; + case 2: + _b.apply(void 0, _c.concat([_k.sent()])); + if (!this['with']) return [3 /*break*/, 4]; + _d = this['with'], value = _d.value, alias = _d.alias; + _e = scope; + _f = alias || filepath; + return [4 /*yield*/, evalToken(value, ctx)]; + case 3: + _e[_f] = _k.sent(); + _k.label = 4; + case 4: + if (!this['for']) return [3 /*break*/, 15]; + _g = this['for'], value = _g.value, alias = _g.alias; + _h = toEnumerable; + return [4 /*yield*/, evalToken(value, ctx)]; + case 5: + collection = _h.apply(void 0, [_k.sent()]); + scope['forloop'] = new ForloopDrop(collection.length, value.getText(), alias); + _k.label = 6; + case 6: + _k.trys.push([6, 12, 13, 14]); + collection_1 = __values(collection), collection_1_1 = collection_1.next(); + _k.label = 7; + case 7: + if (!!collection_1_1.done) return [3 /*break*/, 11]; + item = collection_1_1.value; + scope[alias] = item; + return [4 /*yield*/, liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])]; + case 8: + templates = (_k.sent()); + return [4 /*yield*/, liquid.renderer.renderTemplates(templates, childCtx, emitter)]; + case 9: + _k.sent(); + scope['forloop'].next(); + _k.label = 10; + case 10: + collection_1_1 = collection_1.next(); + return [3 /*break*/, 7]; + case 11: return [3 /*break*/, 14]; + case 12: + e_1_1 = _k.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 14]; + case 13: + try { + if (collection_1_1 && !collection_1_1.done && (_j = collection_1.return)) _j.call(collection_1); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 14: return [3 /*break*/, 18]; + case 15: return [4 /*yield*/, liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])]; + case 16: + templates = (_k.sent()); + return [4 /*yield*/, liquid.renderer.renderTemplates(templates, childCtx, emitter)]; + case 17: + _k.sent(); + _k.label = 18; + case 18: return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + /** + * @return null for "none", + * @return Template[] for quoted with tags and/or filters + * @return Token for expression (not quoted) + * @throws TypeError if cannot read next token + */ + function parseFilePath(tokenizer, liquid) { + if (liquid.options.dynamicPartials) { + var file = tokenizer.readValue(); + tokenizer.assert(file, 'illegal file path'); + if (file.getText() === 'none') + return; + if (isQuotedToken(file)) { + // for filenames like "files/{{file}}", eval as liquid template + var templates_1 = liquid.parse(evalQuotedToken(file)); + return optimize(templates_1); + } + return file; + } + var tokens = __spreadArray([], __read(tokenizer.readFileNameTemplate(liquid.options)), false); + var templates = optimize(liquid.parser.parseTokens(tokens)); + return templates === 'none' ? undefined : templates; + } + function optimize(templates) { + // for filenames like "files/file.liquid", extract the string directly + if (templates.length === 1 && isHTMLToken(templates[0].token)) + return templates[0].token.getContent(); + return templates; + } + function renderFilePath(file, ctx, liquid) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (typeof file === 'string') + return [2 /*return*/, file]; + if (Array.isArray(file)) + return [2 /*return*/, liquid.renderer.renderTemplates(file, ctx)]; + return [4 /*yield*/, evalToken(file, ctx)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + } + + var default_1$6 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + var tokenizer = token.tokenizer; + _this['file'] = parseFilePath(tokenizer, _this.liquid); + _this['currentFile'] = token.file; + var begin = tokenizer.p; + var withStr = tokenizer.readIdentifier(); + if (withStr.content === 'with') { + tokenizer.skipBlank(); + if (tokenizer.peek() !== ':') { + _this.withVar = tokenizer.readValue(); + } + else + tokenizer.p = begin; + } + else + tokenizer.p = begin; + _this.hash = new Hash(tokenizer.remaining(), _this.liquid.options.jekyllInclude); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var _a, liquid, hash, withVar, renderer, filepath, saved, scope, _b, _c, templates; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _a = this, liquid = _a.liquid, hash = _a.hash, withVar = _a.withVar; + renderer = liquid.renderer; + return [4 /*yield*/, renderFilePath(this['file'], ctx, liquid)]; + case 1: + filepath = (_d.sent()); + assert(filepath, function () { return "illegal file path \"".concat(filepath, "\""); }); + saved = ctx.saveRegister('blocks', 'blockMode'); + ctx.setRegister('blocks', {}); + ctx.setRegister('blockMode', BlockMode.OUTPUT); + return [4 /*yield*/, hash.render(ctx)]; + case 2: + scope = (_d.sent()); + if (!withVar) return [3 /*break*/, 4]; + _b = scope; + _c = filepath; + return [4 /*yield*/, evalToken(withVar, ctx)]; + case 3: + _b[_c] = _d.sent(); + _d.label = 4; + case 4: return [4 /*yield*/, liquid._parsePartialFile(filepath, ctx.sync, this['currentFile'])]; + case 5: + templates = (_d.sent()); + ctx.push(ctx.opts.jekyllInclude ? { include: scope } : scope); + return [4 /*yield*/, renderer.renderTemplates(templates, ctx, emitter)]; + case 6: + _d.sent(); + ctx.pop(); + ctx.restoreRegister(saved); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$7 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + _this.variable = _this.tokenizer.readIdentifier().content; + return _this; + } + default_1.prototype.render = function (context, emitter) { + var scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + emitter.write(stringify(--scope[this.variable])); + }; + return default_1; + }(Tag)); + + var default_1$8 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + _this.candidates = []; + var group = _this.tokenizer.readValue(); + _this.tokenizer.skipBlank(); + if (group) { + if (_this.tokenizer.peek() === ':') { + _this.group = group; + _this.tokenizer.advance(); + } + else + _this.candidates.push(group); + } + while (!_this.tokenizer.end()) { + var value = _this.tokenizer.readValue(); + if (value) + _this.candidates.push(value); + _this.tokenizer.readTo(','); + } + _this.tokenizer.assert(_this.candidates.length, function () { return "empty candidates: \"".concat(token.getText(), "\""); }); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var group, fingerprint, groups, idx, candidate; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, evalToken(this.group, ctx)]; + case 1: + group = (_a.sent()); + fingerprint = "cycle:".concat(group, ":") + this.candidates.join(','); + groups = ctx.getRegister('cycle'); + idx = groups[fingerprint]; + if (idx === undefined) { + idx = groups[fingerprint] = 0; + } + candidate = this.candidates[idx]; + idx = (idx + 1) % this.candidates.length; + groups[fingerprint] = idx; + return [4 /*yield*/, evalToken(candidate, ctx)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$9 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + _this.branches = []; + _this.elseTemplates = []; + var p = []; + var elseCount = 0; + liquid.parser.parseStream(remainTokens) + .on('start', function () { return _this.branches.push({ + value: new Value(tagToken.args, _this.liquid), + templates: (p = []) + }); }) + .on('tag:elsif', function (token) { + if (elseCount > 0) { + p = []; + return; + } + _this.branches.push({ + value: new Value(token.args, _this.liquid), + templates: (p = []) + }); + }) + .on('tag:else', function () { + elseCount++; + p = _this.elseTemplates; + }) + .on('tag:endif', function () { this.stop(); }) + .on('template', function (tpl) { + if (p !== _this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', function () { throw new Error("tag ".concat(tagToken.getText(), " not closed")); }) + .start(); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var r, _a, _b, _c, value, templates, v, e_1_1; + var e_1, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + r = this.liquid.renderer; + _e.label = 1; + case 1: + _e.trys.push([1, 7, 8, 9]); + _a = __values(this.branches), _b = _a.next(); + _e.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 6]; + _c = _b.value, value = _c.value, templates = _c.templates; + return [4 /*yield*/, value.value(ctx, ctx.opts.lenientIf)]; + case 3: + v = _e.sent(); + if (!isTruthy(v, ctx)) return [3 /*break*/, 5]; + return [4 /*yield*/, r.renderTemplates(templates, ctx, emitter)]; + case 4: + _e.sent(); + return [2 /*return*/]; + case 5: + _b = _a.next(); + return [3 /*break*/, 2]; + case 6: return [3 /*break*/, 9]; + case 7: + e_1_1 = _e.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 9]; + case 8: + try { + if (_b && !_b.done && (_d = _a.return)) _d.call(_a); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 9: return [4 /*yield*/, r.renderTemplates(this.elseTemplates, ctx, emitter)]; + case 10: + _e.sent(); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$a = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + _this.variable = _this.tokenizer.readIdentifier().content; + return _this; + } + default_1.prototype.render = function (context, emitter) { + var scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + var val = scope[this.variable]; + scope[this.variable]++; + emitter.write(stringify(val)); + }; + return default_1; + }(Tag)); + + var default_1$b = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + _this.file = parseFilePath(_this.tokenizer, _this.liquid); + _this['currentFile'] = token.file; + _this.args = new Hash(_this.tokenizer.remaining()); + _this.templates = _this.liquid.parser.parseTokens(remainTokens); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var _a, liquid, args, file, renderer, filepath, templates, html, blocks, _b, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _a = this, liquid = _a.liquid, args = _a.args, file = _a.file; + renderer = liquid.renderer; + if (!(file === undefined)) return [3 /*break*/, 2]; + ctx.setRegister('blockMode', BlockMode.OUTPUT); + return [4 /*yield*/, renderer.renderTemplates(this.templates, ctx, emitter)]; + case 1: + _d.sent(); + return [2 /*return*/]; + case 2: return [4 /*yield*/, renderFilePath(this.file, ctx, liquid)]; + case 3: + filepath = (_d.sent()); + assert(filepath, function () { return "illegal file path \"".concat(filepath, "\""); }); + return [4 /*yield*/, liquid._parseLayoutFile(filepath, ctx.sync, this['currentFile'])]; + case 4: + templates = (_d.sent()); + // render remaining contents and store rendered results + ctx.setRegister('blockMode', BlockMode.STORE); + return [4 /*yield*/, renderer.renderTemplates(this.templates, ctx)]; + case 5: + html = _d.sent(); + blocks = ctx.getRegister('blocks'); + // set whole content to anonymous block if anonymous doesn't specified + if (blocks[''] === undefined) + blocks[''] = function (parent, emitter) { return emitter.write(html); }; + ctx.setRegister('blockMode', BlockMode.OUTPUT); + // render the layout file use stored blocks + _c = (_b = ctx).push; + return [4 /*yield*/, args.render(ctx)]; + case 6: + // render the layout file use stored blocks + _c.apply(_b, [(_d.sent())]); + return [4 /*yield*/, renderer.renderTemplates(templates, ctx, emitter)]; + case 7: + _d.sent(); + ctx.pop(); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$c = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + _this.templates = []; + var match = /\w+/.exec(token.args); + _this.block = match ? match[0] : ''; + while (remainTokens.length) { + var token_1 = remainTokens.shift(); + if (isTagToken(token_1) && token_1.name === 'endblock') + return _this; + var template = liquid.parser.parseToken(token_1, remainTokens); + _this.templates.push(template); + } + throw new Error("tag ".concat(token.getText(), " not closed")); + } + default_1.prototype.render = function (ctx, emitter) { + var blockRender; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + blockRender = this.getBlockRender(ctx); + if (!(ctx.getRegister('blockMode') === BlockMode.STORE)) return [3 /*break*/, 1]; + ctx.getRegister('blocks')[this.block] = blockRender; + return [3 /*break*/, 3]; + case 1: return [4 /*yield*/, blockRender(new BlockDrop(), emitter)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2 /*return*/]; + } + }); + }; + default_1.prototype.getBlockRender = function (ctx) { + var _a = this, liquid = _a.liquid, templates = _a.templates; + var renderChild = ctx.getRegister('blocks')[this.block]; + var renderCurrent = function (superBlock, emitter) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + // add {{ block.super }} support when rendering + ctx.push({ block: superBlock }); + return [4 /*yield*/, liquid.renderer.renderTemplates(templates, ctx, emitter)]; + case 1: + _a.sent(); + ctx.pop(); + return [2 /*return*/]; + } + }); + }; + return renderChild + ? function (superBlock, emitter) { return renderChild(new BlockDrop(function () { return renderCurrent(superBlock, emitter); }), emitter); } + : renderCurrent; + }; + return default_1; + }(Tag)); + + var default_1$d = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + _this.tokens = []; + while (remainTokens.length) { + var token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endraw') + return _this; + _this.tokens.push(token); + } + throw new Error("tag ".concat(tagToken.getText(), " not closed")); + } + default_1.prototype.render = function () { + return this.tokens.map(function (token) { return token.getText(); }).join(''); + }; + return default_1; + }(Tag)); + + var TablerowloopDrop = /** @class */ (function (_super) { + __extends(TablerowloopDrop, _super); + function TablerowloopDrop(length, cols, collection, variable) { + var _this = _super.call(this, length, collection, variable) || this; + _this.length = length; + _this.cols = cols; + return _this; + } + TablerowloopDrop.prototype.row = function () { + return Math.floor(this.i / this.cols) + 1; + }; + TablerowloopDrop.prototype.col0 = function () { + return (this.i % this.cols); + }; + TablerowloopDrop.prototype.col = function () { + return this.col0() + 1; + }; + TablerowloopDrop.prototype.col_first = function () { + return this.col0() === 0; + }; + TablerowloopDrop.prototype.col_last = function () { + return this.col() === this.cols; + }; + return TablerowloopDrop; + }(ForloopDrop)); + + var default_1$e = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + var variable = _this.tokenizer.readIdentifier(); + _this.tokenizer.skipBlank(); + var predicate = _this.tokenizer.readIdentifier(); + var collectionToken = _this.tokenizer.readValue(); + if (predicate.content !== 'in' || !collectionToken) { + throw new Error("illegal tag: ".concat(tagToken.getText())); + } + _this.variable = variable.content; + _this.collection = collectionToken; + _this.args = new Hash(_this.tokenizer.remaining()); + _this.templates = []; + var p; + var stream = _this.liquid.parser.parseStream(remainTokens) + .on('start', function () { return (p = _this.templates); }) + .on('tag:endtablerow', function () { return stream.stop(); }) + .on('template', function (tpl) { return p.push(tpl); }) + .on('end', function () { + throw new Error("tag ".concat(tagToken.getText(), " not closed")); + }); + stream.start(); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var collection, _a, args, offset, limit, cols, r, tablerowloop, scope, idx; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = toEnumerable; + return [4 /*yield*/, evalToken(this.collection, ctx)]; + case 1: + collection = _a.apply(void 0, [_b.sent()]); + return [4 /*yield*/, this.args.render(ctx)]; + case 2: + args = (_b.sent()); + offset = args.offset || 0; + limit = (args.limit === undefined) ? collection.length : args.limit; + collection = collection.slice(offset, offset + limit); + cols = args.cols || collection.length; + r = this.liquid.renderer; + tablerowloop = new TablerowloopDrop(collection.length, cols, this.collection.getText(), this.variable); + scope = { tablerowloop: tablerowloop }; + ctx.push(scope); + idx = 0; + _b.label = 3; + case 3: + if (!(idx < collection.length)) return [3 /*break*/, 6]; + scope[this.variable] = collection[idx]; + if (tablerowloop.col0() === 0) { + if (tablerowloop.row() !== 1) + emitter.write(''); + emitter.write("")); + } + emitter.write("")); + return [4 /*yield*/, r.renderTemplates(this.templates, ctx, emitter)]; + case 4: + _b.sent(); + emitter.write(''); + _b.label = 5; + case 5: + idx++, tablerowloop.next(); + return [3 /*break*/, 3]; + case 6: + if (collection.length) + emitter.write(''); + ctx.pop(); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$f = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + _this.branches = []; + _this.elseTemplates = []; + var p = []; + var elseCount = 0; + _this.liquid.parser.parseStream(remainTokens) + .on('start', function () { return _this.branches.push({ + value: new Value(tagToken.args, _this.liquid), + test: isFalsy, + templates: (p = []) + }); }) + .on('tag:elsif', function (token) { + if (elseCount > 0) { + p = []; + return; + } + _this.branches.push({ + value: new Value(token.args, _this.liquid), + test: isTruthy, + templates: (p = []) + }); + }) + .on('tag:else', function () { + elseCount++; + p = _this.elseTemplates; + }) + .on('tag:endunless', function () { this.stop(); }) + .on('template', function (tpl) { + if (p !== _this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', function () { throw new Error("tag ".concat(tagToken.getText(), " not closed")); }) + .start(); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var r, _a, _b, _c, value, test_1, templates, v, e_1_1; + var e_1, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + r = this.liquid.renderer; + _e.label = 1; + case 1: + _e.trys.push([1, 7, 8, 9]); + _a = __values(this.branches), _b = _a.next(); + _e.label = 2; + case 2: + if (!!_b.done) return [3 /*break*/, 6]; + _c = _b.value, value = _c.value, test_1 = _c.test, templates = _c.templates; + return [4 /*yield*/, value.value(ctx, ctx.opts.lenientIf)]; + case 3: + v = _e.sent(); + if (!test_1(v, ctx)) return [3 /*break*/, 5]; + return [4 /*yield*/, r.renderTemplates(templates, ctx, emitter)]; + case 4: + _e.sent(); + return [2 /*return*/]; + case 5: + _b = _a.next(); + return [3 /*break*/, 2]; + case 6: return [3 /*break*/, 9]; + case 7: + e_1_1 = _e.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 9]; + case 8: + try { + if (_b && !_b.done && (_d = _a.return)) _d.call(_a); + } + finally { if (e_1) throw e_1.error; } + return [7 /*endfinally*/]; + case 9: return [4 /*yield*/, r.renderTemplates(this.elseTemplates, ctx, emitter)]; + case 10: + _e.sent(); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$g = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1() { + return _super !== null && _super.apply(this, arguments) || this; + } + default_1.prototype.render = function (ctx, emitter) { + emitter['break'] = true; + }; + return default_1; + }(Tag)); + + var default_1$h = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1() { + return _super !== null && _super.apply(this, arguments) || this; + } + default_1.prototype.render = function (ctx, emitter) { + emitter['continue'] = true; + }; + return default_1; + }(Tag)); + + var default_1$i = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + _this.tokenizer.skipBlank(); + if (!_this.tokenizer.end()) { + _this.value = new Value(_this.tokenizer.readFilteredValue(), _this.liquid); + } + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + var val; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.value) + return [2 /*return*/]; + return [4 /*yield*/, this.value.value(ctx, false)]; + case 1: + val = _a.sent(); + emitter.write(val); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$j = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(token, remainTokens, liquid) { + var _this = _super.call(this, token, remainTokens, liquid) || this; + var tokens = _this.tokenizer.readLiquidTagTokens(_this.liquid.options); + _this.templates = _this.liquid.parser.parseTokens(tokens); + return _this; + } + default_1.prototype.render = function (ctx, emitter) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.liquid.renderer.renderTemplates(this.templates, ctx, emitter)]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }; + return default_1; + }(Tag)); + + var default_1$k = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1(tagToken, remainTokens, liquid) { + var _this = _super.call(this, tagToken, remainTokens, liquid) || this; + if (tagToken.args.search(/\n\s*[^#\s]/g) !== -1) { + throw new Error('every line of an inline comment must start with a \'#\' character'); + } + return _this; + } + default_1.prototype.render = function () { }; + return default_1; + }(Tag)); + + var tags = { + assign: default_1, + 'for': default_1$1, + capture: default_1$2, + 'case': default_1$3, + comment: default_1$4, + include: default_1$6, + render: default_1$5, + decrement: default_1$7, + increment: default_1$a, + cycle: default_1$8, + 'if': default_1$9, + layout: default_1$b, + block: default_1$c, + raw: default_1$d, + tablerow: default_1$e, + unless: default_1$f, + 'break': default_1$g, + 'continue': default_1$h, + echo: default_1$i, + liquid: default_1$j, + '#': default_1$k + }; + + var Liquid = /** @class */ (function () { + function Liquid(opts) { + if (opts === void 0) { opts = {}; } + var _this = this; + this.renderer = new Render(); + this.filters = {}; + this.tags = {}; + this.options = normalize(opts); + this.parser = new Parser(this); + forOwn(tags, function (conf, name) { return _this.registerTag(name, conf); }); + forOwn(filters, function (handler, name) { return _this.registerFilter(name, handler); }); + } + Liquid.prototype.parse = function (html, filepath) { + return this.parser.parse(html, filepath); + }; + Liquid.prototype._render = function (tpl, scope, renderOptions) { + var ctx = scope instanceof Context ? scope : new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplates(tpl, ctx); + }; + Liquid.prototype.render = function (tpl, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, toPromise(this._render(tpl, scope, __assign(__assign({}, renderOptions), { sync: false })))]; + }); + }); + }; + Liquid.prototype.renderSync = function (tpl, scope, renderOptions) { + return toValueSync(this._render(tpl, scope, __assign(__assign({}, renderOptions), { sync: true }))); + }; + Liquid.prototype.renderToNodeStream = function (tpl, scope, renderOptions) { + if (renderOptions === void 0) { renderOptions = {}; } + var ctx = new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplatesToNodeStream(tpl, ctx); + }; + Liquid.prototype._parseAndRender = function (html, scope, renderOptions) { + var tpl = this.parse(html); + return this._render(tpl, scope, renderOptions); + }; + Liquid.prototype.parseAndRender = function (html, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, toPromise(this._parseAndRender(html, scope, __assign(__assign({}, renderOptions), { sync: false })))]; + }); + }); + }; + Liquid.prototype.parseAndRenderSync = function (html, scope, renderOptions) { + return toValueSync(this._parseAndRender(html, scope, __assign(__assign({}, renderOptions), { sync: true }))); + }; + Liquid.prototype._parsePartialFile = function (file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Partials, currentFile); + }; + Liquid.prototype._parseLayoutFile = function (file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile); + }; + Liquid.prototype._parseFile = function (file, sync, lookupType, currentFile) { + return this.parser.parseFile(file, sync, lookupType, currentFile); + }; + Liquid.prototype.parseFile = function (file, lookupType) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, toPromise(this.parser.parseFile(file, false, lookupType))]; + }); + }); + }; + Liquid.prototype.parseFileSync = function (file, lookupType) { + return toValueSync(this.parser.parseFile(file, true, lookupType)); + }; + Liquid.prototype._renderFile = function (file, ctx, renderFileOptions) { + var templates; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this._parseFile(file, renderFileOptions.sync, renderFileOptions.lookupType)]; + case 1: + templates = (_a.sent()); + return [4 /*yield*/, this._render(templates, ctx, renderFileOptions)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }; + Liquid.prototype.renderFile = function (file, ctx, renderFileOptions) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, toPromise(this._renderFile(file, ctx, __assign(__assign({}, renderFileOptions), { sync: false })))]; + }); + }); + }; + Liquid.prototype.renderFileSync = function (file, ctx, renderFileOptions) { + return toValueSync(this._renderFile(file, ctx, __assign(__assign({}, renderFileOptions), { sync: true }))); + }; + Liquid.prototype.renderFileToNodeStream = function (file, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function () { + var templates; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.parseFile(file)]; + case 1: + templates = _a.sent(); + return [2 /*return*/, this.renderToNodeStream(templates, scope, renderOptions)]; + } + }); + }); + }; + Liquid.prototype._evalValue = function (str, scope) { + var value = new Value(str, this); + var ctx = scope instanceof Context ? scope : new Context(scope, this.options); + return value.value(ctx); + }; + Liquid.prototype.evalValue = function (str, scope) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, toPromise(this._evalValue(str, scope))]; + }); + }); + }; + Liquid.prototype.evalValueSync = function (str, scope) { + return toValueSync(this._evalValue(str, scope)); + }; + Liquid.prototype.registerFilter = function (name, filter) { + this.filters[name] = filter; + }; + Liquid.prototype.registerTag = function (name, tag) { + this.tags[name] = isFunction(tag) ? tag : createTagClass(tag); + }; + Liquid.prototype.plugin = function (plugin) { + return plugin.call(this, Liquid); + }; + Liquid.prototype.express = function () { + var self = this; // eslint-disable-line + var firstCall = true; + return function (filePath, ctx, callback) { + var _a, _b, _c; + if (firstCall) { + firstCall = false; + var dirs = normalizeDirectoryList(this.root); + (_a = self.options.root).unshift.apply(_a, __spreadArray([], __read(dirs), false)); + (_b = self.options.layouts).unshift.apply(_b, __spreadArray([], __read(dirs), false)); + (_c = self.options.partials).unshift.apply(_c, __spreadArray([], __read(dirs), false)); + } + self.renderFile(filePath, ctx).then(function (html) { return callback(null, html); }, callback); + }; + }; + return Liquid; + }()); + + /* istanbul ignore file */ + var version = '10.14.0'; + + exports.AssertionError = AssertionError; + exports.AssignTag = default_1; + exports.BlockTag = default_1$c; + exports.BreakTag = default_1$g; + exports.CaptureTag = default_1$2; + exports.CaseTag = default_1$3; + exports.CommentTag = default_1$4; + exports.Context = Context; + exports.ContinueTag = default_1$h; + exports.CycleTag = default_1$8; + exports.DecrementTag = default_1$7; + exports.Drop = Drop; + exports.EchoTag = default_1$i; + exports.Expression = Expression; + exports.Filter = Filter; + exports.ForTag = default_1$1; + exports.Hash = Hash; + exports.IfTag = default_1$9; + exports.IncludeTag = default_1$6; + exports.IncrementTag = default_1$a; + exports.InlineCommentTag = default_1$k; + exports.LayoutTag = default_1$b; + exports.Liquid = Liquid; + exports.LiquidError = LiquidError; + exports.LiquidTag = default_1$j; + exports.Output = Output; + exports.ParseError = ParseError; + exports.ParseStream = ParseStream; + exports.RawTag = default_1$d; + exports.RenderError = RenderError; + exports.RenderTag = default_1$5; + exports.TablerowTag = default_1$e; + exports.Tag = Tag; + exports.TagToken = TagToken; + exports.TimezoneDate = TimezoneDate; + exports.Token = Token; + exports.TokenizationError = TokenizationError; + exports.Tokenizer = Tokenizer; + exports.TypeGuards = typeGuards; + exports.UndefinedVariableError = UndefinedVariableError; + exports.UnlessTag = default_1$f; + exports.Value = Value; + exports.assert = assert; + exports.createTrie = createTrie; + exports.defaultOperators = defaultOperators; + exports.defaultOptions = defaultOptions; + exports.evalQuotedToken = evalQuotedToken; + exports.evalToken = evalToken; + exports.filters = filters; + exports.isFalsy = isFalsy; + exports.isTruthy = isTruthy; + exports.tags = tags; + exports.toPromise = toPromise; + exports.toValue = toValue; + exports.toValueSync = toValueSync; + exports.version = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=liquid.browser.umd.js.map diff --git a/node_modules/liquidjs/dist/liquid.browser.umd.js.map b/node_modules/liquidjs/dist/liquid.browser.umd.js.map new file mode 100644 index 0000000..da6db72 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid.browser.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"liquid.browser.umd.js","sources":["../src/tokens/token.ts","../src/drop/drop.ts","../src/util/underscore.ts","../src/util/error.ts","../src/util/character.ts","../src/util/assert.ts","../src/drop/null-drop.ts","../src/drop/empty-drop.ts","../src/drop/blank-drop.ts","../src/drop/forloop-drop.ts","../src/drop/block-drop.ts","../src/drop/comparable.ts","../src/util/literal.ts","../src/util/operator-trie.ts","../src/util/async.ts","../src/util/strftime.ts","../src/util/timezone-date.ts","../src/tokens/delimited-token.ts","../src/tokens/tag-token.ts","../src/tokens/output-token.ts","../src/tokens/html-token.ts","../src/tokens/number-token.ts","../src/tokens/identifier-token.ts","../src/tokens/literal-token.ts","../src/tokens/operator-token.ts","../src/tokens/property-access-token.ts","../src/tokens/filter-token.ts","../src/tokens/hash-token.ts","../src/render/string.ts","../src/tokens/quoted-token.ts","../src/tokens/range-token.ts","../src/tokens/liquid-tag-token.ts","../src/tokens/filtered-value-token.ts","../src/emitters/simple-emitter.ts","../src/build/streamed-emitter-browser.ts","../src/emitters/keeping-type-emitter.ts","../src/render/render.ts","../src/render/expression.ts","../src/render/boolean.ts","../src/render/operator.ts","../src/cache/lru.ts","../src/build/fs-impl-browser.ts","../src/filters/misc.ts","../src/filters/html.ts","../src/liquid-options.ts","../src/parser/whitespace-ctrl.ts","../src/parser/tokenizer.ts","../src/parser/parse-stream.ts","../src/template/template-impl.ts","../src/template/tag.ts","../src/template/hash.ts","../src/template/tag-options-adapter.ts","../src/parser/filter-arg.ts","../src/template/filter.ts","../src/template/value.ts","../src/template/output.ts","../src/template/html.ts","../src/fs/loader.ts","../src/parser/parser.ts","../src/parser/token-kind.ts","../src/util/type-guards.ts","../src/context/context.ts","../src/context/block-mode.ts","../src/filters/math.ts","../src/filters/url.ts","../src/filters/array.ts","../src/filters/date.ts","../src/filters/string.ts","../src/filters/index.ts","../src/tags/assign.ts","../src/tags/for.ts","../src/tags/capture.ts","../src/tags/case.ts","../src/tags/comment.ts","../src/tags/render.ts","../src/tags/include.ts","../src/tags/decrement.ts","../src/tags/cycle.ts","../src/tags/if.ts","../src/tags/increment.ts","../src/tags/layout.ts","../src/tags/block.ts","../src/tags/raw.ts","../src/drop/tablerowloop-drop.ts","../src/tags/tablerow.ts","../src/tags/unless.ts","../src/tags/break.ts","../src/tags/continue.ts","../src/tags/echo.ts","../src/tags/liquid.ts","../src/tags/inline-comment.ts","../src/tags/index.ts","../src/liquid.ts","../src/index.ts"],"sourcesContent":["import { TokenKind } from '../parser'\n\nexport abstract class Token {\n public constructor (\n public kind: TokenKind,\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {}\n public getText () {\n return this.input.slice(this.begin, this.end)\n }\n public getPosition () {\n let [row, col] = [1, 1]\n for (let i = 0; i < this.begin; i++) {\n if (this.input[i] === '\\n') {\n row++\n col = 1\n } else col++\n }\n return [row, col]\n }\n public size () {\n return this.end - this.begin\n }\n}\n","export abstract class Drop {\n public liquidMethodMissing (key: string | number): Promise | any {\n return undefined\n }\n}\n","import { Drop } from '../drop/drop'\n\nexport const toString = Object.prototype.toString\nconst toLowerCase = String.prototype.toLowerCase\n\nexport const hasOwnProperty = Object.hasOwnProperty\n\nexport function isString (value: any): value is string {\n return typeof value === 'string'\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isFunction (value: any): value is Function {\n return typeof value === 'function'\n}\n\nexport function isPromise (val: any): val is Promise {\n return val && isFunction(val.then)\n}\n\nexport function isIterator (val: any): val is IterableIterator {\n return val && isFunction(val.next) && isFunction(val.throw) && isFunction(val.return)\n}\n\nexport function escapeRegex (str: string) {\n return str.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n}\n\nexport function promisify (fn: (arg1: T1, cb: (err: Error | null, result: T2) => void) => void): (arg1: T1) => Promise;\nexport function promisify (fn: (arg1: T1, arg2: T2, cb: (err: Error | null, result: T3) => void) => void): (arg1: T1, arg2: T2) => Promise;\nexport function promisify (fn: any) {\n return function (...args: any[]) {\n return new Promise((resolve, reject) => {\n fn(...args, (err: Error, result: any) => {\n err ? reject(err) : resolve(result)\n })\n })\n }\n}\n\nexport function stringify (value: any): string {\n value = toValue(value)\n if (isString(value)) return value\n if (isNil(value)) return ''\n if (isArray(value)) return value.map(x => stringify(x)).join('')\n return String(value)\n}\n\nexport function toEnumerable (val: any): T[] {\n val = toValue(val)\n if (isArray(val)) return val\n if (isString(val) && val.length > 0) return [val] as unknown as T[]\n if (isIterable(val)) return Array.from(val)\n if (isObject(val)) return Object.keys(val).map((key) => [key, val[key]]) as unknown as T[]\n return []\n}\n\nexport function toArray (val: any) {\n val = toValue(val)\n if (isNil(val)) return []\n if (isArray(val)) return val\n return [ val ]\n}\n\nexport function toValue (value: any): any {\n return (value instanceof Drop && isFunction(value.valueOf)) ? value.valueOf() : value\n}\n\nexport function isNumber (value: any): value is number {\n return typeof value === 'number'\n}\n\nexport function toLiquid (value: any): any {\n if (value && isFunction(value.toLiquid)) return toLiquid(value.toLiquid())\n return value\n}\n\nexport function isNil (value: any): boolean {\n return value == null\n}\n\nexport function isUndefined (value: any): boolean {\n return value === undefined\n}\n\nexport function isArray (value: any): value is any[] {\n // be compatible with IE 8\n return toString.call(value) === '[object Array]'\n}\n\nexport function isIterable (value: any): value is Iterable {\n return isObject(value) && Symbol.iterator in value\n}\n\n/*\n * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property.\n * The iteratee is invoked with three arguments: (value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning false.\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @return {Object} Returns object.\n */\nexport function forOwn (\n obj: Record | undefined,\n iteratee: ((val: T, key: string, obj: {[key: string]: T}) => boolean | void)\n) {\n obj = obj || {}\n for (const k in obj) {\n if (hasOwnProperty.call(obj, k)) {\n if (iteratee(obj[k], k, obj) === false) break\n }\n }\n return obj\n}\n\nexport function last (arr: T[]): T;\nexport function last (arr: string): string;\nexport function last (arr: any[] | string): any | string {\n return arr[arr.length - 1]\n}\n\n/*\n * Checks if value is the language type of Object.\n * (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))\n * @param {any} value The value to check.\n * @return {Boolean} Returns true if value is an object, else false.\n */\nexport function isObject (value: any): value is object {\n const type = typeof value\n return value !== null && (type === 'object' || type === 'function')\n}\n\nexport function range (start: number, stop: number, step = 1) {\n const arr: number[] = []\n for (let i = start; i < stop; i += step) {\n arr.push(i)\n }\n return arr\n}\n\nexport function padStart (str: any, length: number, ch = ' ') {\n return pad(str, length, ch, (str, ch) => ch + str)\n}\n\nexport function padEnd (str: any, length: number, ch = ' ') {\n return pad(str, length, ch, (str, ch) => str + ch)\n}\n\nexport function pad (str: any, length: number, ch: string, add: (str: string, ch: string) => string) {\n str = String(str)\n let n = length - str.length\n while (n-- > 0) str = add(str, ch)\n return str\n}\n\nexport function identify (val: T): T {\n return val\n}\n\nexport function changeCase (str: string): string {\n const hasLowerCase = [...str].some(ch => ch >= 'a' && ch <= 'z')\n return hasLowerCase ? str.toUpperCase() : str.toLowerCase()\n}\n\nexport function ellipsis (str: string, N: number): string {\n return str.length > N ? str.slice(0, N - 3) + '...' : str\n}\n\n// compare string in case-insensitive way, undefined values to the tail\nexport function caseInsensitiveCompare (a: any, b: any) {\n if (a == null && b == null) return 0\n if (a == null) return 1\n if (b == null) return -1\n a = toLowerCase.call(a)\n b = toLowerCase.call(b)\n if (a < b) return -1\n if (a > b) return 1\n return 0\n}\n\nexport function argumentsToValue any> (fn: F) {\n return (...args: Parameters) => fn(...args.map(toValue))\n}\n\nexport function escapeRegExp (text: string) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","import * as _ from './underscore'\nimport { Token } from '../tokens/token'\nimport { Template } from '../template/template'\n\n/**\n * targeting ES5, extends Error won't create a proper prototype chain, need a trait to keep track of classes\n */\nconst TRAIT = '__liquidClass__'\n\nexport abstract class LiquidError extends Error {\n public token!: Token\n public context = ''\n private originalError?: Error\n public constructor (err: Error | string, token: Token) {\n /**\n * note: for ES5 targeting, `this` will be replaced by return value of Error(),\n * thus everything on `this` will be lost, avoid calling `LiquidError` methods here\n */\n super(typeof err === 'string' ? err : err.message)\n if (typeof err !== 'string') Object.defineProperty(this, 'originalError', { value: err, enumerable: false })\n Object.defineProperty(this, 'token', { value: token, enumerable: false })\n Object.defineProperty(this, TRAIT, { value: 'LiquidError', enumerable: false })\n }\n protected update () {\n Object.defineProperty(this, 'context', { value: mkContext(this.token), enumerable: false })\n this.message = mkMessage(this.message, this.token)\n this.stack = this.message + '\\n' + this.context +\n '\\n' + this.stack\n if (this.originalError) this.stack += '\\nFrom ' + this.originalError.stack\n }\n static is (obj: unknown): obj is LiquidError {\n return obj?.[TRAIT] === 'LiquidError'\n }\n}\n\nexport class TokenizationError extends LiquidError {\n public constructor (message: string, token: Token) {\n super(message, token)\n this.name = 'TokenizationError'\n super.update()\n }\n}\n\nexport class ParseError extends LiquidError {\n public constructor (err: Error, token: Token) {\n super(err, token)\n this.name = 'ParseError'\n this.message = err.message\n super.update()\n }\n}\n\nexport class RenderError extends LiquidError {\n public constructor (err: Error, tpl: Template) {\n super(err, tpl.token)\n this.name = 'RenderError'\n this.message = err.message\n super.update()\n }\n public static is (obj: any): obj is RenderError {\n return obj.name === 'RenderError'\n }\n}\n\nexport class LiquidErrors extends LiquidError {\n public constructor (public errors: RenderError[]) {\n super(errors[0], errors[0].token)\n this.name = 'LiquidErrors'\n const s = errors.length > 1 ? 's' : ''\n this.message = `${errors.length} error${s} found`\n super.update()\n }\n public static is (obj: any): obj is LiquidErrors {\n return obj.name === 'LiquidErrors'\n }\n}\n\nexport class UndefinedVariableError extends LiquidError {\n public constructor (err: Error, token: Token) {\n super(err, token)\n this.name = 'UndefinedVariableError'\n this.message = err.message\n super.update()\n }\n}\n\n// only used internally; raised where we don't have token information,\n// so it can't be an UndefinedVariableError.\nexport class InternalUndefinedVariableError extends Error {\n variableName: string\n\n public constructor (variableName: string) {\n super(`undefined variable: ${variableName}`)\n this.name = 'InternalUndefinedVariableError'\n this.variableName = variableName\n }\n}\n\nexport class AssertionError extends Error {\n public constructor (message: string) {\n super(message)\n this.name = 'AssertionError'\n this.message = message + ''\n }\n}\n\nfunction mkContext (token: Token) {\n const [line, col] = token.getPosition()\n const lines = token.input.split('\\n')\n const begin = Math.max(line - 2, 1)\n const end = Math.min(line + 3, lines.length)\n\n const context = _\n .range(begin, end + 1)\n .map(lineNumber => {\n const rowIndicator = (lineNumber === line) ? '>> ' : ' '\n const num = _.padStart(String(lineNumber), String(end).length)\n let text = `${rowIndicator}${num}| `\n\n const colIndicator = lineNumber === line\n ? '\\n' + _.padStart('^', col + text.length)\n : ''\n\n text += lines[lineNumber - 1]\n text += colIndicator\n return text\n })\n .join('\\n')\n\n return context\n}\n\nfunction mkMessage (msg: string, token: Token) {\n if (token.file) msg += `, file:${token.file}`\n const [line, col] = token.getPosition()\n msg += `, line:${line}, col:${col}`\n return msg\n}\n","// **DO NOT CHANGE THIS FILE**\n//\n// This file is generated by bin/character-gen.js\n// bitmask character types to boost performance\nexport const TYPES = [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 4, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 8, 0, 0, 0, 0, 8, 0, 0, 0, 64, 0, 65, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]\nexport const WORD = 1\nexport const OPERATOR = 2\nexport const BLANK = 4\nexport const QUOTE = 8\nexport const INLINE_BLANK = 16\nexport const NUMBER = 32\nexport const SIGN = 64\nexport const PUNCTUATION = 128\n\nexport function isWord (char: string): boolean {\n const code = char.charCodeAt(0)\n return code >= 128 ? !TYPES[code] : !!(TYPES[code] & WORD)\n}\nTYPES[160] = TYPES[5760] = TYPES[6158] = TYPES[8192] = TYPES[8193] = TYPES[8194] = TYPES[8195] = TYPES[8196] = TYPES[8197] = TYPES[8198] = TYPES[8199] = TYPES[8200] = TYPES[8201] = TYPES[8202] = TYPES[8232] = TYPES[8233] = TYPES[8239] = TYPES[8287] = TYPES[12288] = BLANK\nTYPES[8220] = TYPES[8221] = PUNCTUATION\n","import { AssertionError } from './error'\n\nexport function assert (predicate: T | null | undefined, message?: string | (() => string)) {\n if (!predicate) {\n const msg = typeof message === 'function'\n ? message()\n : (message || `expect ${predicate} to be true`)\n throw new AssertionError(msg)\n }\n}\n","import { Drop } from './drop'\nimport { Comparable } from './comparable'\nimport { isNil, toValue } from '../util'\n\nexport class NullDrop extends Drop implements Comparable {\n public equals (value: any) {\n return isNil(toValue(value))\n }\n public gt () {\n return false\n }\n public geq () {\n return false\n }\n public lt () {\n return false\n }\n public leq () {\n return false\n }\n public valueOf () {\n return null\n }\n}\n","import { Drop } from './drop'\nimport { Comparable } from './comparable'\nimport { isObject, isString, isArray, toValue } from '../util'\n\nexport class EmptyDrop extends Drop implements Comparable {\n public equals (value: any) {\n if (value instanceof EmptyDrop) return false\n value = toValue(value)\n if (isString(value) || isArray(value)) return value.length === 0\n if (isObject(value)) return Object.keys(value).length === 0\n return false\n }\n public gt () {\n return false\n }\n public geq () {\n return false\n }\n public lt () {\n return false\n }\n public leq () {\n return false\n }\n public valueOf () {\n return ''\n }\n}\n","import { isNil, isString, toValue } from '../util'\nimport { EmptyDrop } from '../drop'\n\nexport class BlankDrop extends EmptyDrop {\n public equals (value: any) {\n if (value === false) return true\n if (isNil(toValue(value))) return true\n if (isString(value)) return /^\\s*$/.test(value)\n return super.equals(value)\n }\n}\n","import { Drop } from './drop'\n\nexport class ForloopDrop extends Drop {\n protected i = 0\n public name: string\n public length: number\n public constructor (length: number, collection: string, variable: string) {\n super()\n this.length = length\n this.name = `${variable}-${collection}`\n }\n public next () {\n this.i++\n }\n public index0 () {\n return this.i\n }\n public index () {\n return this.i + 1\n }\n public first () {\n return this.i === 0\n }\n public last () {\n return this.i === this.length - 1\n }\n public rindex () {\n return this.length - this.i\n }\n public rindex0 () {\n return this.length - this.i - 1\n }\n public valueOf () {\n return JSON.stringify(this)\n }\n}\n","import { Drop } from './drop'\n\nexport class BlockDrop extends Drop {\n constructor (\n // the block render from layout template\n private superBlockRender: () => Iterable = () => ''\n ) {\n super()\n }\n /**\n * Provide parent access in child block by\n * {{ block.super }}\n */\n public super () {\n return this.superBlockRender()\n }\n}\n","import { isFunction } from '../util'\n\nexport interface Comparable {\n equals: (rhs: any) => boolean;\n gt: (rhs: any) => boolean;\n geq: (rhs: any) => boolean;\n lt: (rhs: any) => boolean;\n leq: (rhs: any) => boolean;\n}\n\nexport function isComparable (arg: any): arg is Comparable {\n return (\n arg &&\n isFunction(arg.equals) &&\n isFunction(arg.gt) &&\n isFunction(arg.geq) &&\n isFunction(arg.lt) &&\n isFunction(arg.leq)\n )\n}\n","import { BlankDrop, EmptyDrop, NullDrop } from '../drop'\n\nconst nil = new NullDrop()\nexport const literalValues = {\n 'true': true,\n 'false': false,\n 'nil': nil,\n 'null': nil,\n 'empty': new EmptyDrop(),\n 'blank': new BlankDrop()\n}\n\nexport type LiteralKey = keyof typeof literalValues\nexport type LiteralValue = typeof literalValues[LiteralKey]\n","import { isWord } from '../util/character'\n\ninterface TrieInput {\n [key: string]: T\n}\n\ninterface TrieLeafNode {\n data: T;\n end: true;\n needBoundary?: true;\n}\n\nexport interface Trie {\n [key: string]: Trie | TrieLeafNode;\n}\n\nexport type TrieNode = Trie | TrieLeafNode\n\nexport function createTrie (input: TrieInput): Trie {\n const trie: Trie = {}\n for (const [name, data] of Object.entries(input)) {\n let node: Trie | TrieLeafNode = trie\n\n for (let i = 0; i < name.length; i++) {\n const c = name[i]\n node[c] = node[c] || {}\n\n if (i === name.length - 1 && isWord(name[i])) {\n node[c].needBoundary = true\n }\n\n node = node[c]\n }\n\n node.data = data\n node.end = true\n }\n return trie\n}\n","import { isPromise, isIterator } from './underscore'\n\n// convert an async iterator to a Promise\nexport async function toPromise (val: Generator | Promise | T): Promise {\n if (!isIterator(val)) return val\n let value: unknown\n let done = false\n let next = 'next'\n do {\n const state = val[next](value)\n done = state.done\n value = state.value\n next = 'next'\n try {\n if (isIterator(value)) value = toPromise(value)\n if (isPromise(value)) value = await value\n } catch (err) {\n next = 'throw'\n value = err\n }\n } while (!done)\n return value as T\n}\n\n// convert an async iterator to a value in a synchronous manner\nexport function toValueSync (val: Generator | T): T {\n if (!isIterator(val)) return val\n let value: any\n let done = false\n let next = 'next'\n do {\n const state = val[next](value)\n done = state.done\n value = state.value\n next = 'next'\n if (isIterator(value)) {\n try {\n value = toValueSync(value)\n } catch (err) {\n next = 'throw'\n value = err\n }\n }\n } while (!done)\n return value\n}\n","import { changeCase, padStart, padEnd } from './underscore'\nimport { LiquidDate } from './liquid-date'\n\nconst rFormat = /%([-_0^#:]+)?(\\d+)?([EO])?(.)/\nconst monthNames = [\n 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',\n 'September', 'October', 'November', 'December'\n]\nconst dayNames = [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\n]\nconst monthNamesShort = monthNames.map(abbr)\nconst dayNamesShort = dayNames.map(abbr)\ninterface FormatOptions {\n flags: object;\n width?: string;\n modifier?: string;\n}\n\nfunction abbr (str: string) {\n return str.slice(0, 3)\n}\n\n// prototype extensions\nfunction daysInMonth (d: LiquidDate) {\n const feb = isLeapYear(d) ? 29 : 28\n return [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n}\nfunction getDayOfYear (d: LiquidDate) {\n let num = 0\n for (let i = 0; i < d.getMonth(); ++i) {\n num += daysInMonth(d)[i]\n }\n return num + d.getDate()\n}\nfunction getWeekOfYear (d: LiquidDate, startDay: number) {\n // Skip to startDay of this week\n const now = getDayOfYear(d) + (startDay - d.getDay())\n // Find the first startDay of the year\n const jan1 = new Date(d.getFullYear(), 0, 1)\n const then = (7 - jan1.getDay() + startDay)\n return String(Math.floor((now - then) / 7) + 1)\n}\nfunction isLeapYear (d: LiquidDate) {\n const year = d.getFullYear()\n return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year)))\n}\nfunction ordinal (d: LiquidDate) {\n const date = d.getDate()\n if ([11, 12, 13].includes(date)) return 'th'\n\n switch (date % 10) {\n case 1: return 'st'\n case 2: return 'nd'\n case 3: return 'rd'\n default: return 'th'\n }\n}\nfunction century (d: LiquidDate) {\n return parseInt(d.getFullYear().toString().substring(0, 2), 10)\n}\n\n// default to 0\nconst padWidths = {\n d: 2,\n e: 2,\n H: 2,\n I: 2,\n j: 3,\n k: 2,\n l: 2,\n L: 3,\n m: 2,\n M: 2,\n S: 2,\n U: 2,\n W: 2\n}\n\n// default to '0'\nconst padChars = {\n a: ' ',\n A: ' ',\n b: ' ',\n B: ' ',\n c: ' ',\n e: ' ',\n k: ' ',\n l: ' ',\n p: ' ',\n P: ' '\n}\nfunction getTimezoneOffset (d: LiquidDate, opts: FormatOptions) {\n const nOffset = Math.abs(d.getTimezoneOffset())\n const h = Math.floor(nOffset / 60)\n const m = nOffset % 60\n return (d.getTimezoneOffset() > 0 ? '-' : '+') +\n padStart(h, 2, '0') +\n (opts.flags[':'] ? ':' : '') +\n padStart(m, 2, '0')\n}\nconst formatCodes = {\n a: (d: LiquidDate) => dayNamesShort[d.getDay()],\n A: (d: LiquidDate) => dayNames[d.getDay()],\n b: (d: LiquidDate) => monthNamesShort[d.getMonth()],\n B: (d: LiquidDate) => monthNames[d.getMonth()],\n c: (d: LiquidDate) => d.toLocaleString(),\n C: (d: LiquidDate) => century(d),\n d: (d: LiquidDate) => d.getDate(),\n e: (d: LiquidDate) => d.getDate(),\n H: (d: LiquidDate) => d.getHours(),\n I: (d: LiquidDate) => String(d.getHours() % 12 || 12),\n j: (d: LiquidDate) => getDayOfYear(d),\n k: (d: LiquidDate) => d.getHours(),\n l: (d: LiquidDate) => String(d.getHours() % 12 || 12),\n L: (d: LiquidDate) => d.getMilliseconds(),\n m: (d: LiquidDate) => d.getMonth() + 1,\n M: (d: LiquidDate) => d.getMinutes(),\n N: (d: LiquidDate, opts: FormatOptions) => {\n const width = Number(opts.width) || 9\n const str = String(d.getMilliseconds()).slice(0, width)\n return padEnd(str, width, '0')\n },\n p: (d: LiquidDate) => (d.getHours() < 12 ? 'AM' : 'PM'),\n P: (d: LiquidDate) => (d.getHours() < 12 ? 'am' : 'pm'),\n q: (d: LiquidDate) => ordinal(d),\n s: (d: LiquidDate) => Math.round(d.getTime() / 1000),\n S: (d: LiquidDate) => d.getSeconds(),\n u: (d: LiquidDate) => d.getDay() || 7,\n U: (d: LiquidDate) => getWeekOfYear(d, 0),\n w: (d: LiquidDate) => d.getDay(),\n W: (d: LiquidDate) => getWeekOfYear(d, 1),\n x: (d: LiquidDate) => d.toLocaleDateString(),\n X: (d: LiquidDate) => d.toLocaleTimeString(),\n y: (d: LiquidDate) => d.getFullYear().toString().slice(2, 4),\n Y: (d: LiquidDate) => d.getFullYear(),\n z: getTimezoneOffset,\n Z: (d: LiquidDate, opts: FormatOptions) => {\n if (d.getTimezoneName) {\n return d.getTimezoneName() || getTimezoneOffset(d, opts)\n }\n return (typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : '')\n },\n 't': () => '\\t',\n 'n': () => '\\n',\n '%': () => '%'\n};\n(formatCodes as any).h = formatCodes.b\n\nexport function strftime (d: LiquidDate, formatStr: string) {\n let output = ''\n let remaining = formatStr\n let match\n while ((match = rFormat.exec(remaining))) {\n output += remaining.slice(0, match.index)\n remaining = remaining.slice(match.index + match[0].length)\n output += format(d, match)\n }\n return output + remaining\n}\n\nfunction format (d: LiquidDate, match: RegExpExecArray) {\n const [input, flagStr = '', width, modifier, conversion] = match\n const convert = formatCodes[conversion]\n if (!convert) return input\n const flags = {}\n for (const flag of flagStr) flags[flag] = true\n let ret = String(convert(d, { flags, width, modifier }))\n let padChar = padChars[conversion] || '0'\n let padWidth = width || padWidths[conversion] || 0\n if (flags['^']) ret = ret.toUpperCase()\n else if (flags['#']) ret = changeCase(ret)\n if (flags['_']) padChar = ' '\n else if (flags['0']) padChar = '0'\n if (flags['-']) padWidth = 0\n return padStart(ret, padWidth, padChar)\n}\n","import { LiquidDate } from './liquid-date'\nimport { isString } from './underscore'\n\n// one minute in milliseconds\nconst OneMinute = 60000\nconst ISO8601_TIMEZONE_PATTERN = /([zZ]|([+-])(\\d{2}):(\\d{2}))$/\n\n/**\n * A date implementation with timezone info, just like Ruby date\n *\n * Implementation:\n * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods\n * - rewrite getTimezoneOffset() to trick strftime\n */\nexport class TimezoneDate implements LiquidDate {\n private timezoneOffset: number\n private timezoneName: string\n private date: Date\n private displayDate: Date\n constructor (init: string | number | Date | TimezoneDate, timezone: number | string) {\n this.date = init instanceof TimezoneDate\n ? init.date\n : new Date(init)\n this.timezoneOffset = isString(timezone) ? TimezoneDate.getTimezoneOffset(timezone, this.date) : timezone\n this.timezoneName = isString(timezone) ? timezone : ''\n\n const diff = (this.date.getTimezoneOffset() - this.timezoneOffset) * OneMinute\n const time = this.date.getTime() + diff\n this.displayDate = new Date(time)\n }\n\n getTime () {\n return this.displayDate.getTime()\n }\n\n getMilliseconds () {\n return this.displayDate.getMilliseconds()\n }\n getSeconds () {\n return this.displayDate.getSeconds()\n }\n getMinutes () {\n return this.displayDate.getMinutes()\n }\n getHours () {\n return this.displayDate.getHours()\n }\n getDay () {\n return this.displayDate.getDay()\n }\n getDate () {\n return this.displayDate.getDate()\n }\n getMonth () {\n return this.displayDate.getMonth()\n }\n getFullYear () {\n return this.displayDate.getFullYear()\n }\n toLocaleString (locale?: string, init?: any) {\n if (init?.timeZone) {\n return this.date.toLocaleString(locale, init)\n }\n return this.displayDate.toLocaleString(locale, init)\n }\n toLocaleTimeString (locale?: string) {\n return this.displayDate.toLocaleTimeString(locale)\n }\n toLocaleDateString (locale?: string) {\n return this.displayDate.toLocaleDateString(locale)\n }\n getTimezoneOffset () {\n return this.timezoneOffset!\n }\n getTimezoneName () {\n return this.timezoneName\n }\n\n /**\n * Create a Date object fixed to it's declared Timezone. Both\n * - 2021-08-06T02:29:00.000Z and\n * - 2021-08-06T02:29:00.000+08:00\n * will always be displayed as\n * - 2021-08-06 02:29:00\n * regardless timezoneOffset in JavaScript realm\n *\n * The implementation hack:\n * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`,\n * we create a different Date to trick strftime, it's both simpler and more performant.\n * Given that a template is expected to be parsed fewer times than rendered.\n */\n static createDateFixedToTimezone (dateString: string): LiquidDate {\n const m = dateString.match(ISO8601_TIMEZONE_PATTERN)\n // representing a UTC timestamp\n if (m && m[1] === 'Z') {\n return new TimezoneDate(+new Date(dateString), 0)\n }\n // has a timezone specified\n if (m && m[2] && m[3] && m[4]) {\n const [, , sign, hours, minutes] = m\n const offset = (sign === '+' ? -1 : 1) * (parseInt(hours, 10) * 60 + parseInt(minutes, 10))\n return new TimezoneDate(+new Date(dateString), offset)\n }\n return new Date(dateString)\n }\n private static getTimezoneOffset (timezoneName: string, date = new Date()) {\n const localDateString = date.toLocaleString('en-US', { timeZone: timezoneName })\n const utcDateString = date.toLocaleString('en-US', { timeZone: 'UTC' })\n\n const localDate = new Date(localDateString)\n const utcDate = new Date(utcDateString)\n return (+utcDate - +localDate) / (60 * 1000)\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\nimport { TYPES, BLANK } from '../util'\n\nexport abstract class DelimitedToken extends Token {\n public trimLeft = false\n public trimRight = false\n public contentRange: [number, number]\n public constructor (\n kind: TokenKind,\n [contentBegin, contentEnd]: [number, number],\n input: string,\n begin: number,\n end: number,\n trimLeft: boolean,\n trimRight: boolean,\n file?: string\n ) {\n super(kind, input, begin, end, file)\n const tl = input[contentBegin] === '-'\n const tr = input[contentEnd - 1] === '-'\n\n let l = tl ? contentBegin + 1 : contentBegin\n let r = tr ? contentEnd - 1 : contentEnd\n while (l < r && (TYPES[input.charCodeAt(l)] & BLANK)) l++\n while (r > l && (TYPES[input.charCodeAt(r - 1)] & BLANK)) r--\n\n this.contentRange = [l, r]\n this.trimLeft = tl || trimLeft\n this.trimRight = tr || trimRight\n }\n get content () {\n return this.input.slice(this.contentRange[0], this.contentRange[1])\n }\n}\n","import { DelimitedToken } from './delimited-token'\nimport { Tokenizer, TokenKind } from '../parser'\nimport type { NormalizedFullOptions } from '../liquid-options'\n\nexport class TagToken extends DelimitedToken {\n public name: string\n public tokenizer: Tokenizer\n public constructor (\n input: string,\n begin: number,\n end: number,\n options: NormalizedFullOptions,\n file?: string\n ) {\n const { trimTagLeft, trimTagRight, tagDelimiterLeft, tagDelimiterRight } = options\n const [valueBegin, valueEnd] = [begin + tagDelimiterLeft.length, end - tagDelimiterRight.length]\n super(TokenKind.Tag, [valueBegin, valueEnd], input, begin, end, trimTagLeft, trimTagRight, file)\n\n this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange)\n this.name = this.tokenizer.readTagName()\n this.tokenizer.assert(this.name, `illegal tag syntax, tag name expected`)\n this.tokenizer.skipBlank()\n }\n get args (): string {\n return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1])\n }\n}\n","import { DelimitedToken } from './delimited-token'\nimport { NormalizedFullOptions } from '../liquid-options'\nimport { TokenKind } from '../parser'\n\nexport class OutputToken extends DelimitedToken {\n public constructor (\n input: string,\n begin: number,\n end: number,\n options: NormalizedFullOptions,\n file?: string\n ) {\n const { trimOutputLeft, trimOutputRight, outputDelimiterLeft, outputDelimiterRight } = options\n const valueRange: [number, number] = [begin + outputDelimiterLeft.length, end - outputDelimiterRight.length]\n super(TokenKind.Output, valueRange, input, begin, end, trimOutputLeft, trimOutputRight, file)\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\n\nexport class HTMLToken extends Token {\n trimLeft = 0\n trimRight = 0\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.HTML, input, begin, end, file)\n }\n public getContent () {\n return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight)\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\n\nexport class NumberToken extends Token {\n public content: number\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Number, input, begin, end, file)\n this.content = Number(this.getText())\n }\n}\n","import { Token } from './token'\nimport { NUMBER, TYPES, SIGN } from '../util'\nimport { TokenKind } from '../parser'\n\nexport class IdentifierToken extends Token {\n public content: string\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Word, input, begin, end, file)\n this.content = this.getText()\n }\n isNumber (allowSign = false) {\n const begin = allowSign && TYPES[this.input.charCodeAt(this.begin)] & SIGN\n ? this.begin + 1\n : this.begin\n for (let i = begin; i < this.end; i++) {\n if (!(TYPES[this.input.charCodeAt(i)] & NUMBER)) return false\n }\n return true\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\nimport { literalValues, LiteralValue } from '../util'\n\nexport class LiteralToken extends Token {\n public content: LiteralValue\n public literal: string\n public constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Literal, input, begin, end, file)\n this.literal = this.getText()\n this.content = literalValues[this.literal]\n }\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\n\nexport const enum OperatorType {\n Binary,\n Unary\n}\n\nexport const operatorPrecedences = {\n '==': 2,\n '!=': 2,\n '>': 2,\n '<': 2,\n '>=': 2,\n '<=': 2,\n 'contains': 2,\n 'not': 1,\n 'and': 0,\n 'or': 0\n}\n\nexport const operatorTypes = {\n '==': OperatorType.Binary,\n '!=': OperatorType.Binary,\n '>': OperatorType.Binary,\n '<': OperatorType.Binary,\n '>=': OperatorType.Binary,\n '<=': OperatorType.Binary,\n 'contains': OperatorType.Binary,\n 'not': OperatorType.Unary,\n 'and': OperatorType.Binary,\n 'or': OperatorType.Binary\n}\n\nexport class OperatorToken extends Token {\n public operator: string\n public constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Operator, input, begin, end, file)\n this.operator = this.getText()\n }\n getPrecedence () {\n const key = this.getText()\n return key in operatorPrecedences ? operatorPrecedences[key] : 1\n }\n}\n","import { Token } from './token'\nimport { LiteralToken } from './literal-token'\nimport { ValueToken } from './value-token'\nimport { IdentifierToken } from './identifier-token'\nimport { NumberToken } from './number-token'\nimport { RangeToken } from './range-token'\nimport { QuotedToken } from './quoted-token'\nimport { TokenKind } from '../parser'\n\nexport class PropertyAccessToken extends Token {\n constructor (\n public variable: QuotedToken | RangeToken | LiteralToken | NumberToken | undefined,\n public props: (ValueToken | IdentifierToken)[],\n input: string,\n begin: number,\n end: number,\n file?: string\n ) {\n super(TokenKind.PropertyAccess, input, begin, end, file)\n }\n}\n","import { Token } from './token'\nimport { FilterArg } from '../parser/filter-arg'\nimport { TokenKind } from '../parser'\n\nexport class FilterToken extends Token {\n public constructor (\n public name: string,\n public args: FilterArg[],\n input: string,\n begin: number,\n end: number,\n file?: string\n ) {\n super(TokenKind.Filter, input, begin, end, file)\n }\n}\n","import { Token } from './token'\nimport { ValueToken } from './value-token'\nimport { IdentifierToken } from './identifier-token'\nimport { TokenKind } from '../parser'\n\nexport class HashToken extends Token {\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public name: IdentifierToken,\n public value?: ValueToken,\n public file?: string\n ) {\n super(TokenKind.Hash, input, begin, end, file)\n }\n}\n","const rHex = /[\\da-fA-F]/\nconst rOct = /[0-7]/\nconst escapeChar = {\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t',\n v: '\\x0B'\n}\n\nfunction hexVal (c: string) {\n const code = c.charCodeAt(0)\n if (code >= 97) return code - 87\n if (code >= 65) return code - 55\n return code - 48\n}\n\nexport function parseStringLiteral (str: string): string {\n let ret = ''\n for (let i = 1; i < str.length - 1; i++) {\n if (str[i] !== '\\\\') {\n ret += str[i]\n continue\n }\n if (escapeChar[str[i + 1]] !== undefined) {\n ret += escapeChar[str[++i]]\n } else if (str[i + 1] === 'u') {\n let val = 0\n let j = i + 2\n while (j <= i + 5 && rHex.test(str[j])) {\n val = val * 16 + hexVal(str[j++])\n }\n i = j - 1\n ret += String.fromCharCode(val)\n } else if (!rOct.test(str[i + 1])) {\n ret += str[++i]\n } else {\n let j = i + 1\n let val = 0\n while (j <= i + 3 && rOct.test(str[j])) {\n val = val * 8 + hexVal(str[j++])\n }\n i = j - 1\n ret += String.fromCharCode(val)\n }\n }\n return ret\n}\n","import { Token } from './token'\nimport { TokenKind } from '../parser'\nimport { parseStringLiteral } from '../render/string'\n\nexport class QuotedToken extends Token {\n public readonly content: string\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.Quoted, input, begin, end, file)\n this.content = parseStringLiteral(this.getText())\n }\n}\n","import { Token } from './token'\nimport { ValueToken } from './value-token'\nimport { TokenKind } from '../parser'\n\nexport class RangeToken extends Token {\n constructor (\n public input: string,\n public begin: number,\n public end: number,\n public lhs: ValueToken,\n public rhs: ValueToken,\n public file?: string\n ) {\n super(TokenKind.Range, input, begin, end, file)\n }\n}\n","import { DelimitedToken } from './delimited-token'\nimport { NormalizedFullOptions } from '../liquid-options'\nimport { Tokenizer, TokenKind } from '../parser'\n\n/**\n * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}`\n */\nexport class LiquidTagToken extends DelimitedToken {\n public name: string\n public args: string\n public tokenizer: Tokenizer\n public constructor (\n input: string,\n begin: number,\n end: number,\n options: NormalizedFullOptions,\n file?: string\n ) {\n super(TokenKind.Tag, [begin, end], input, begin, end, false, false, file)\n\n this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange)\n this.name = this.tokenizer.readTagName()\n this.tokenizer.assert(this.name, 'illegal liquid tag syntax')\n\n this.tokenizer.skipBlank()\n this.args = this.tokenizer.remaining()\n }\n}\n","import { Token } from './token'\nimport { FilterToken } from './filter-token'\nimport { TokenKind } from '../parser'\nimport { Expression } from '../render'\n\n/**\n * value expression with optional filters\n * e.g.\n * {% assign foo=\"bar\" | append: \"coo\" %}\n */\nexport class FilteredValueToken extends Token {\n constructor (\n public initial: Expression,\n public filters: FilterToken[],\n public input: string,\n public begin: number,\n public end: number,\n public file?: string\n ) {\n super(TokenKind.FilteredValue, input, begin, end, file)\n }\n}\n","import { stringify } from '../util'\nimport { Emitter } from './emitter'\n\nexport class SimpleEmitter implements Emitter {\n public buffer = '';\n\n public write (html: any) {\n this.buffer += stringify(html)\n }\n}\n","import { Emitter } from '../emitters'\n\nexport class StreamedEmitter implements Emitter {\n public buffer = '';\n public stream: NodeJS.ReadableStream = null as any\n constructor () {\n throw new Error('streaming not supported in browser')\n }\n public write: (html: any) => void\n public error: (err: Error) => void\n public end: () => void\n}\n","import { stringify, toValue } from '../util'\nimport { Emitter } from './emitter'\n\nexport class KeepingTypeEmitter implements Emitter {\n public buffer: any = '';\n\n public write (html: any) {\n html = toValue(html)\n // This will only preserve the type if the value is isolated.\n // I.E:\n // {{ my-port }} -> 42\n // {{ my-host }}:{{ my-port }} -> 'host:42'\n if (typeof html !== 'string' && this.buffer === '') {\n this.buffer = html\n } else {\n this.buffer = stringify(this.buffer) + stringify(html)\n }\n }\n}\n","import { toPromise, RenderError, LiquidErrors, LiquidError } from '../util'\nimport { Context } from '../context'\nimport { Template } from '../template'\nimport { Emitter, KeepingTypeEmitter, StreamedEmitter, SimpleEmitter } from '../emitters'\n\nexport class Render {\n public renderTemplatesToNodeStream (templates: Template[], ctx: Context): NodeJS.ReadableStream {\n const emitter = new StreamedEmitter()\n Promise.resolve().then(() => toPromise(this.renderTemplates(templates, ctx, emitter)))\n .then(() => emitter.end(), err => emitter.error(err))\n return emitter.stream\n }\n public * renderTemplates (templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator {\n if (!emitter) {\n emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter()\n }\n const errors = []\n for (const tpl of templates) {\n try {\n // if tpl.render supports emitter, it'll return empty `html`\n const html = yield tpl.render(ctx, emitter)\n // if not, it'll return an `html`, write to the emitter for it\n html && emitter.write(html)\n if (emitter['break'] || emitter['continue']) break\n } catch (e) {\n const err = LiquidError.is(e) ? e : new RenderError(e as Error, tpl)\n if (ctx.opts.catchAllErrors) errors.push(err)\n else throw err\n }\n }\n if (errors.length) {\n throw new LiquidErrors(errors)\n }\n return emitter.buffer\n }\n}\n","import { QuotedToken, RangeToken, OperatorToken, Token, PropertyAccessToken, OperatorType, operatorTypes } from '../tokens'\nimport { isRangeToken, isPropertyAccessToken, UndefinedVariableError, range, isOperatorToken, assert } from '../util'\nimport type { Context } from '../context'\nimport type { UnaryOperatorHandler } from '../render'\n\nexport class Expression {\n private postfix: Token[]\n\n public constructor (tokens: IterableIterator) {\n this.postfix = [...toPostfix(tokens)]\n }\n public * evaluate (ctx: Context, lenient?: boolean): Generator {\n assert(ctx, 'unable to evaluate: context not defined')\n const operands: any[] = []\n for (const token of this.postfix) {\n if (isOperatorToken(token)) {\n const r = operands.pop()\n let result\n if (operatorTypes[token.operator] === OperatorType.Unary) {\n result = yield (ctx.opts.operators[token.operator] as UnaryOperatorHandler)(r, ctx)\n } else {\n const l = operands.pop()\n result = yield ctx.opts.operators[token.operator](l, r, ctx)\n }\n operands.push(result)\n } else {\n operands.push(yield evalToken(token, ctx, lenient))\n }\n }\n return operands[0]\n }\n public valid () {\n return !!this.postfix.length\n }\n}\n\nexport function * evalToken (token: Token | undefined, ctx: Context, lenient = false): IterableIterator {\n if (!token) return\n if ('content' in token) return token.content\n if (isPropertyAccessToken(token)) return yield evalPropertyAccessToken(token, ctx, lenient)\n if (isRangeToken(token)) return yield evalRangeToken(token, ctx)\n}\n\nfunction * evalPropertyAccessToken (token: PropertyAccessToken, ctx: Context, lenient: boolean): IterableIterator {\n const props: string[] = []\n for (const prop of token.props) {\n props.push((yield evalToken(prop, ctx, false)) as unknown as string)\n }\n try {\n if (token.variable) {\n const variable = yield evalToken(token.variable, ctx, lenient)\n return yield ctx._getFromScope(variable, props)\n } else {\n return yield ctx._get(props)\n }\n } catch (e) {\n if (lenient && (e as Error).name === 'InternalUndefinedVariableError') return null\n throw (new UndefinedVariableError(e as Error, token))\n }\n}\n\nexport function evalQuotedToken (token: QuotedToken) {\n return token.content\n}\n\nfunction * evalRangeToken (token: RangeToken, ctx: Context) {\n const low: number = yield evalToken(token.lhs, ctx)\n const high: number = yield evalToken(token.rhs, ctx)\n return range(+low, +high + 1)\n}\n\nfunction * toPostfix (tokens: IterableIterator): IterableIterator {\n const ops: OperatorToken[] = []\n for (const token of tokens) {\n if (isOperatorToken(token)) {\n while (ops.length && ops[ops.length - 1].getPrecedence() > token.getPrecedence()) {\n yield ops.pop()!\n }\n ops.push(token)\n } else yield token\n }\n while (ops.length) {\n yield ops.pop()!\n }\n}\n","import { Context } from '../context/context'\nimport { toValue } from '../util'\n\nexport function isTruthy (val: any, ctx: Context): boolean {\n return !isFalsy(val, ctx)\n}\n\nexport function isFalsy (val: any, ctx: Context): boolean {\n val = toValue(val)\n\n if (ctx.opts.jsTruthy) {\n return !val\n } else {\n return val === false || undefined === val || val === null\n }\n}\n","import { isComparable } from '../drop/comparable'\nimport { Context } from '../context'\nimport { toValue } from '../util'\nimport { isFalsy, isTruthy } from '../render/boolean'\nimport { isArray, isFunction } from '../util/underscore'\n\nexport type UnaryOperatorHandler = (operand: any, ctx: Context) => boolean;\nexport type BinaryOperatorHandler = (lhs: any, rhs: any, ctx: Context) => boolean;\nexport type OperatorHandler = UnaryOperatorHandler | BinaryOperatorHandler;\nexport type Operators = Record\n\nexport const defaultOperators: Operators = {\n '==': equals,\n '!=': (l: any, r: any) => !equals(l, r),\n '>': (l: any, r: any) => {\n if (isComparable(l)) return l.gt(r)\n if (isComparable(r)) return r.lt(l)\n return toValue(l) > toValue(r)\n },\n '<': (l: any, r: any) => {\n if (isComparable(l)) return l.lt(r)\n if (isComparable(r)) return r.gt(l)\n return toValue(l) < toValue(r)\n },\n '>=': (l: any, r: any) => {\n if (isComparable(l)) return l.geq(r)\n if (isComparable(r)) return r.leq(l)\n return toValue(l) >= toValue(r)\n },\n '<=': (l: any, r: any) => {\n if (isComparable(l)) return l.leq(r)\n if (isComparable(r)) return r.geq(l)\n return toValue(l) <= toValue(r)\n },\n 'contains': (l: any, r: any) => {\n l = toValue(l)\n if (isArray(l)) return l.some((i) => equals(i, r))\n if (isFunction(l?.indexOf)) return l.indexOf(toValue(r)) > -1\n return false\n },\n 'not': (v: any, ctx: Context) => isFalsy(toValue(v), ctx),\n 'and': (l: any, r: any, ctx: Context) => isTruthy(toValue(l), ctx) && isTruthy(toValue(r), ctx),\n 'or': (l: any, r: any, ctx: Context) => isTruthy(toValue(l), ctx) || isTruthy(toValue(r), ctx)\n}\n\nexport function equals (lhs: any, rhs: any): boolean {\n if (isComparable(lhs)) return lhs.equals(rhs)\n if (isComparable(rhs)) return rhs.equals(lhs)\n lhs = toValue(lhs)\n rhs = toValue(rhs)\n if (isArray(lhs)) {\n return isArray(rhs) && arrayEquals(lhs, rhs)\n }\n return lhs === rhs\n}\n\nfunction arrayEquals (lhs: any[], rhs: any[]): boolean {\n if (lhs.length !== rhs.length) return false\n return !lhs.some((value, i) => !equals(value, rhs[i]))\n}\n","import { Cache } from './cache'\n\nclass Node {\n constructor (\n public key: string,\n public value: T,\n public next: Node,\n public prev: Node\n ) {}\n}\n\nexport class LRU implements Cache {\n private cache: Record> = {}\n private head: Node\n private tail: Node\n\n constructor (\n public limit: number,\n public size = 0\n ) {\n this.head = new Node('HEAD', null as any, null as any, null as any)\n this.tail = new Node('TAIL', null as any, null as any, null as any)\n this.head.next = this.tail\n this.tail.prev = this.head\n }\n\n write (key: string, value: T) {\n if (this.cache[key]) {\n this.cache[key].value = value\n } else {\n const node = new Node(key, value, this.head.next, this.head)\n this.head.next.prev = node\n this.head.next = node\n\n this.cache[key] = node\n this.size++\n this.ensureLimit()\n }\n }\n\n read (key: string): T | undefined {\n if (!this.cache[key]) return\n const { value } = this.cache[key]\n this.remove(key)\n this.write(key, value)\n return value\n }\n\n remove (key: string) {\n const node = this.cache[key]\n node.prev.next = node.next\n node.next.prev = node.prev\n delete this.cache[key]\n this.size--\n }\n\n clear () {\n this.head.next = this.tail\n this.tail.prev = this.head\n this.size = 0\n this.cache = {}\n }\n\n private ensureLimit () {\n if (this.size > this.limit) this.remove(this.tail.prev.key)\n }\n}\n","import { last } from '../util'\n\nfunction domResolve (root: string, path: string) {\n const base = document.createElement('base')\n base.href = root\n\n const head = document.getElementsByTagName('head')[0]\n head.insertBefore(base, head.firstChild)\n\n const a = document.createElement('a')\n a.href = path\n const resolved = a.href\n head.removeChild(base)\n\n return resolved\n}\n\nexport function resolve (root: string, filepath: string, ext: string) {\n if (root.length && last(root) !== '/') root += '/'\n const url = domResolve(root, filepath)\n return url.replace(/^(\\w+:\\/\\/[^/]+)(\\/[^?]+)/, (str, origin, path) => {\n const last = path.split('/').pop()\n if (/\\.\\w+$/.test(last)) return str\n return origin + path + ext\n })\n}\n\nexport async function readFile (url: string): Promise {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.responseText as string)\n } else {\n reject(new Error(xhr.statusText))\n }\n }\n xhr.onerror = () => {\n reject(new Error('An error occurred whilst receiving the response.'))\n }\n xhr.open('GET', url)\n xhr.send()\n })\n}\n\nexport function readFileSync (url: string): string {\n const xhr = new XMLHttpRequest()\n xhr.open('GET', url, false)\n xhr.send()\n if (xhr.status < 200 || xhr.status >= 300) {\n throw new Error(xhr.statusText)\n }\n return xhr.responseText as string\n}\n\nexport async function exists (filepath: string) {\n return true\n}\n\nexport function existsSync (filepath: string) {\n return true\n}\n\nexport function dirname (filepath: string) {\n return domResolve(filepath, '.')\n}\n\nexport const sep = '/'\n","import { isFalsy } from '../render/boolean'\nimport { identify, isArray, isString, toValue } from '../util/underscore'\nimport { FilterImpl } from '../template'\n\nfunction defaultFilter (this: FilterImpl, value: T1, defaultValue: T2, ...args: Array<[string, any]>): T1 | T2 {\n value = toValue(value)\n if (isArray(value) || isString(value)) return value.length ? value : defaultValue\n if (value === false && (new Map(args)).get('allow_false')) return false as T1\n return isFalsy(value, this.context) ? defaultValue : value\n}\n\nfunction json (value: any, space = 0) {\n return JSON.stringify(value, null, space)\n}\n\nfunction inspect (value: any, space = 0) {\n const ancestors: object[] = []\n return JSON.stringify(value, function (this: unknown, _key: unknown, value: any) {\n if (typeof value !== 'object' || value === null) return value\n // `this` is the object that value is contained in, i.e., its direct parent.\n while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) ancestors.pop()\n if (ancestors.includes(value)) return '[Circular]'\n ancestors.push(value)\n return value\n }, space)\n}\n\nfunction to_integer (value: any) {\n return Number(value)\n}\n\nconst raw = {\n raw: true,\n handler: identify\n}\n\nexport default {\n default: defaultFilter,\n raw,\n jsonify: json,\n to_integer,\n json,\n inspect\n}\n","import { stringify } from '../util/underscore'\n\nconst escapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n}\nconst unescapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n}\n\nexport function escape (str: string) {\n return stringify(str).replace(/&|<|>|\"|'/g, m => escapeMap[m])\n}\n\nexport function xml_escape (str: string) {\n return escape(str)\n}\n\nfunction unescape (str: string) {\n return stringify(str).replace(/&(amp|lt|gt|#34|#39);/g, m => unescapeMap[m])\n}\n\nexport function escape_once (str: string) {\n return escape(unescape(stringify(str)))\n}\n\nexport function newline_to_br (v: string) {\n return stringify(v).replace(/\\r?\\n/gm, '
    \\n')\n}\n\nexport function strip_html (v: string) {\n return stringify(v).replace(/||<.*?>|/g, '')\n}\n","import { assert, isArray, isString, isFunction } from './util'\nimport { LRU, LiquidCache } from './cache'\nimport { FS, LookupType } from './fs'\nimport * as fs from './fs/fs-impl'\nimport { defaultOperators, Operators } from './render'\nimport misc from './filters/misc'\nimport { escape } from './filters/html'\n\ntype OutputEscape = (value: any) => string\ntype OutputEscapeOption = 'escape' | 'json' | OutputEscape\n\nexport interface LiquidOptions {\n /** A directory or an array of directories from where to resolve layout and include templates, and the filename passed to `.renderFile()`. If it's an array, the files are looked up in the order they occur in the array. Defaults to `[\".\"]` */\n root?: string | string[];\n /** A directory or an array of directories from where to resolve included templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */\n partials?: string | string[];\n /** A directory or an array of directories from where to resolve layout templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */\n layouts?: string | string[];\n /** Allow refer to layouts/partials by relative pathname. To avoid arbitrary filesystem read, paths been referenced also need to be within corresponding root, partials, layouts. Defaults to `true`. */\n relativeReference?: boolean;\n /** Use jekyll style include, pass parameters to `include` variable of current scope. Defaults to `false`. */\n jekyllInclude?: boolean;\n /** Add a extname (if filepath doesn't include one) before template file lookup. Eg: setting to `\".html\"` will allow including file by basename. Defaults to `\"\"`. */\n extname?: string;\n /** Whether or not to cache resolved templates. Defaults to `false`. */\n cache?: boolean | number | LiquidCache;\n /** Use JavaScript Truthiness. Defaults to `false`. */\n jsTruthy?: boolean;\n /** If set, treat the `filepath` parameter in `{%include filepath %}` and `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`. */\n dynamicPartials?: boolean;\n /** Whether or not to assert filter existence. If set to `false`, undefined filters will be skipped. Otherwise, undefined filters will cause an exception. Defaults to `false`. */\n strictFilters?: boolean;\n /** Whether or not to assert variable existence. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */\n strictVariables?: boolean;\n /** Catch all errors instead of exit upon one. Please note that render errors won't be reached when parse fails. */\n catchAllErrors?: boolean;\n /** Hide scope variables from prototypes, useful when you're passing a not sanitized object into LiquidJS or need to hide prototypes from templates. */\n ownPropertyOnly?: boolean;\n /** Modifies the behavior of `strictVariables`. If set, a single undefined variable will *not* cause an exception in the context of the `if`/`elsif`/`unless` tag and the `default` filter. Instead, it will evaluate to `false` and `null`, respectively. Irrelevant if `strictVariables` is not set. Defaults to `false`. **/\n lenientIf?: boolean;\n /** JavaScript timezone name or timezoneOffset for `date` filter, default to local time. That means if you're in Australia (UTC+10), it'll default to `-600` or `Australia/Lindeman` */\n timezoneOffset?: number | string;\n /** Default date format to use if the date filter doesn't include a format. Defaults to `%A, %B %-e, %Y at %-l:%M %P %z`. */\n dateFormat?: string;\n /** Strip blank characters (including ` `, `\\t`, and `\\r`) from the right of tags (`{% %}`) until `\\n` (inclusive). Defaults to `false`. */\n trimTagRight?: boolean;\n /** Similar to `trimTagRight`, whereas the `\\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */\n trimTagLeft?: boolean;\n /** Strip blank characters (including ` `, `\\t`, and `\\r`) from the right of values (`{{ }}`) until `\\n` (inclusive). Defaults to `false`. */\n trimOutputRight?: boolean;\n /** Similar to `trimOutputRight`, whereas the `\\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */\n trimOutputLeft?: boolean;\n /** The left delimiter for liquid tags. **/\n tagDelimiterLeft?: string;\n /** The right delimiter for liquid tags. **/\n tagDelimiterRight?: string;\n /** The left delimiter for liquid outputs. **/\n outputDelimiterLeft?: string;\n /** The right delimiter for liquid outputs. **/\n outputDelimiterRight?: string;\n /** Whether input strings to date filter preserve the given timezone **/\n preserveTimezones?: boolean;\n /** Whether `trim*Left`/`trim*Right` is greedy. When set to `true`, all consecutive blank characters including `\\n` will be trimmed regardless of line breaks. Defaults to `true`. */\n greedy?: boolean;\n /** `fs` is used to override the default file-system module with a custom implementation. */\n fs?: FS;\n /** the global scope passed down to all partial and layout templates, i.e. templates included by `include`, `layout` and `render` tags. */\n globals?: object;\n /** Whether or not to keep value type when writing the Output, not working for streamed rendering. Defaults to `false`. */\n keepOutputType?: boolean;\n /** Default escape filter applied to output values, when set, you'll have to add `| raw` for values don't need to be escaped. Defaults to `undefined`. */\n outputEscape?: OutputEscapeOption;\n /** An object of operators for conditional statements. Defaults to the regular Liquid operators. */\n operators?: Operators;\n /** Respect parameter order when using filters like \"for ... reversed limit\", Defaults to `false`. */\n orderedFilterParameters?: boolean;\n}\n\nexport interface RenderOptions {\n /**\n * This call is sync or async? It's used by Liquid internal methods, you'll not need this.\n */\n sync?: boolean;\n /**\n * Same as `globals` on LiquidOptions, but only for current render() call\n */\n globals?: object;\n /**\n * Same as `strictVariables` on LiquidOptions, but only for current render() call\n */\n strictVariables?: boolean;\n /**\n * Same as `ownPropertyOnly` on LiquidOptions, but only for current render() call\n */\n ownPropertyOnly?: boolean;\n}\n\nexport interface RenderFileOptions extends RenderOptions {\n lookupType?: LookupType;\n}\n\ninterface NormalizedOptions extends LiquidOptions {\n root?: string[];\n partials?: string[];\n layouts?: string[];\n cache?: LiquidCache;\n outputEscape?: OutputEscape;\n}\n\nexport interface NormalizedFullOptions extends NormalizedOptions {\n root: string[];\n partials: string[];\n layouts: string[];\n relativeReference: boolean;\n jekyllInclude: boolean;\n extname: string;\n cache?: LiquidCache;\n jsTruthy: boolean;\n dynamicPartials: boolean;\n fs: FS;\n strictFilters: boolean;\n strictVariables: boolean;\n ownPropertyOnly: boolean;\n lenientIf: boolean;\n dateFormat: string;\n trimTagRight: boolean;\n trimTagLeft: boolean;\n trimOutputRight: boolean;\n trimOutputLeft: boolean;\n tagDelimiterLeft: string;\n tagDelimiterRight: string;\n outputDelimiterLeft: string;\n outputDelimiterRight: string;\n preserveTimezones: boolean;\n greedy: boolean;\n globals: object;\n keepOutputType: boolean;\n operators: Operators;\n}\n\nexport const defaultOptions: NormalizedFullOptions = {\n root: ['.'],\n layouts: ['.'],\n partials: ['.'],\n relativeReference: true,\n jekyllInclude: false,\n cache: undefined,\n extname: '',\n fs: fs,\n dynamicPartials: true,\n jsTruthy: false,\n dateFormat: '%A, %B %-e, %Y at %-l:%M %P %z',\n trimTagRight: false,\n trimTagLeft: false,\n trimOutputRight: false,\n trimOutputLeft: false,\n greedy: true,\n tagDelimiterLeft: '{%',\n tagDelimiterRight: '%}',\n outputDelimiterLeft: '{{',\n outputDelimiterRight: '}}',\n preserveTimezones: false,\n strictFilters: false,\n strictVariables: false,\n ownPropertyOnly: true,\n lenientIf: false,\n globals: {},\n keepOutputType: false,\n operators: defaultOperators\n}\n\nexport function normalize (options: LiquidOptions): NormalizedFullOptions {\n if (options.hasOwnProperty('root')) {\n if (!options.hasOwnProperty('partials')) options.partials = options.root\n if (!options.hasOwnProperty('layouts')) options.layouts = options.root\n }\n if (options.hasOwnProperty('cache')) {\n let cache: LiquidCache | undefined\n if (typeof options.cache === 'number') cache = options.cache > 0 ? new LRU(options.cache) : undefined\n else if (typeof options.cache === 'object') cache = options.cache\n else cache = options.cache ? new LRU(1024) : undefined\n options.cache = cache\n }\n options = { ...defaultOptions, ...(options.jekyllInclude ? { dynamicPartials: false } : {}), ...options }\n if ((!options.fs!.dirname || !options.fs!.sep) && options.relativeReference) {\n console.warn('[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning')\n options.relativeReference = false\n }\n options.root = normalizeDirectoryList(options.root)\n options.partials = normalizeDirectoryList(options.partials)\n options.layouts = normalizeDirectoryList(options.layouts)\n options.outputEscape = options.outputEscape && getOutputEscapeFunction(options.outputEscape)\n return options as NormalizedFullOptions\n}\n\nfunction getOutputEscapeFunction (nameOrFunction: OutputEscapeOption): OutputEscape {\n if (nameOrFunction === 'escape') return escape\n if (nameOrFunction === 'json') return misc.json\n assert(isFunction(nameOrFunction), '`outputEscape` need to be of type string or function')\n return nameOrFunction\n}\n\nexport function normalizeDirectoryList (value: any): string[] {\n let list: string[] = []\n if (isArray(value)) list = value\n if (isString(value)) list = [value]\n return list\n}\n","import { Token } from '../tokens'\nimport { NormalizedFullOptions } from '../liquid-options'\nimport { isTagToken, isHTMLToken, isDelimitedToken, TYPES, INLINE_BLANK, BLANK } from '../util'\n\nexport function whiteSpaceCtrl (tokens: Token[], options: NormalizedFullOptions) {\n let inRaw = false\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n if (!isDelimitedToken(token)) continue\n if (!inRaw && token.trimLeft) {\n trimLeft(tokens[i - 1], options.greedy)\n }\n\n if (isTagToken(token)) {\n if (token.name === 'raw') inRaw = true\n else if (token.name === 'endraw') inRaw = false\n }\n\n if (!inRaw && token.trimRight) {\n trimRight(tokens[i + 1], options.greedy)\n }\n }\n}\n\nfunction trimLeft (token: Token, greedy: boolean) {\n if (!token || !isHTMLToken(token)) return\n\n const mask = greedy ? BLANK : INLINE_BLANK\n while (TYPES[token.input.charCodeAt(token.end - 1 - token.trimRight)] & mask) token.trimRight++\n}\n\nfunction trimRight (token: Token, greedy: boolean) {\n if (!token || !isHTMLToken(token)) return\n\n const mask = greedy ? BLANK : INLINE_BLANK\n while (TYPES[token.input.charCodeAt(token.begin + token.trimLeft)] & mask) token.trimLeft++\n if (token.input.charAt(token.begin + token.trimLeft) === '\\n') token.trimLeft++\n}\n","import { FilteredValueToken, TagToken, HTMLToken, HashToken, QuotedToken, LiquidTagToken, OutputToken, ValueToken, Token, RangeToken, FilterToken, TopLevelToken, PropertyAccessToken, OperatorToken, LiteralToken, IdentifierToken, NumberToken } from '../tokens'\nimport { OperatorHandler } from '../render/operator'\nimport { TrieNode, LiteralValue, Trie, createTrie, ellipsis, literalValues, TokenizationError, TYPES, QUOTE, BLANK, NUMBER, SIGN, isWord } from '../util'\nimport { Operators, Expression } from '../render'\nimport { NormalizedFullOptions, defaultOptions } from '../liquid-options'\nimport { FilterArg } from './filter-arg'\nimport { whiteSpaceCtrl } from './whitespace-ctrl'\n\nexport class Tokenizer {\n p: number\n N: number\n private rawBeginAt = -1\n private opTrie: Trie\n private literalTrie: Trie\n\n constructor (\n public input: string,\n operators: Operators = defaultOptions.operators,\n public file?: string,\n range?: [number, number]\n ) {\n this.p = range ? range[0] : 0\n this.N = range ? range[1] : input.length\n this.opTrie = createTrie(operators)\n this.literalTrie = createTrie(literalValues)\n }\n\n readExpression () {\n return new Expression(this.readExpressionTokens())\n }\n\n * readExpressionTokens (): IterableIterator {\n while (this.p < this.N) {\n const operator = this.readOperator()\n if (operator) {\n yield operator\n continue\n }\n const operand = this.readValue()\n if (operand) {\n yield operand\n continue\n }\n return\n }\n }\n readOperator (): OperatorToken | undefined {\n this.skipBlank()\n const end = this.matchTrie(this.opTrie)\n if (end === -1) return\n return new OperatorToken(this.input, this.p, (this.p = end), this.file)\n }\n matchTrie (trie: Trie) {\n let node: TrieNode = trie\n let i = this.p\n let info\n while (node[this.input[i]] && i < this.N) {\n node = node[this.input[i++]]\n if (node['end']) info = node\n }\n if (!info) return -1\n if (info['needBoundary'] && isWord(this.peek(i - this.p))) return -1\n return i\n }\n readFilteredValue (): FilteredValueToken {\n const begin = this.p\n const initial = this.readExpression()\n this.assert(initial.valid(), `invalid value expression: ${this.snapshot()}`)\n const filters = this.readFilters()\n return new FilteredValueToken(initial, filters, this.input, begin, this.p, this.file)\n }\n readFilters (): FilterToken[] {\n const filters = []\n while (true) {\n const filter = this.readFilter()\n if (!filter) return filters\n filters.push(filter)\n }\n }\n readFilter (): FilterToken | null {\n this.skipBlank()\n if (this.end()) return null\n this.assert(this.peek() === '|', `expected \"|\" before filter`)\n this.p++\n const begin = this.p\n const name = this.readIdentifier()\n if (!name.size()) {\n this.assert(this.end(), `expected filter name`)\n return null\n }\n const args = []\n this.skipBlank()\n if (this.peek() === ':') {\n do {\n ++this.p\n const arg = this.readFilterArg()\n arg && args.push(arg)\n this.skipBlank()\n this.assert(this.end() || this.peek() === ',' || this.peek() === '|', () => `unexpected character ${this.snapshot()}`)\n } while (this.peek() === ',')\n } else if (this.peek() === '|' || this.end()) {\n // do nothing\n } else {\n throw this.error('expected \":\" after filter name')\n }\n return new FilterToken(name.getText(), args, this.input, begin, this.p, this.file)\n }\n\n readFilterArg (): FilterArg | undefined {\n const key = this.readValue()\n if (!key) return\n this.skipBlank()\n if (this.peek() !== ':') return key\n ++this.p\n const value = this.readValue()\n return [key.getText(), value]\n }\n\n readTopLevelTokens (options: NormalizedFullOptions = defaultOptions): TopLevelToken[] {\n const tokens: TopLevelToken[] = []\n while (this.p < this.N) {\n const token = this.readTopLevelToken(options)\n tokens.push(token)\n }\n whiteSpaceCtrl(tokens, options)\n return tokens\n }\n\n readTopLevelToken (options: NormalizedFullOptions): TopLevelToken {\n const { tagDelimiterLeft, outputDelimiterLeft } = options\n if (this.rawBeginAt > -1) return this.readEndrawOrRawContent(options)\n if (this.match(tagDelimiterLeft)) return this.readTagToken(options)\n if (this.match(outputDelimiterLeft)) return this.readOutputToken(options)\n return this.readHTMLToken([tagDelimiterLeft, outputDelimiterLeft])\n }\n\n readHTMLToken (stopStrings: string[]): HTMLToken {\n const begin = this.p\n while (this.p < this.N) {\n if (stopStrings.some(str => this.match(str))) break\n ++this.p\n }\n return new HTMLToken(this.input, begin, this.p, this.file)\n }\n\n readTagToken (options: NormalizedFullOptions = defaultOptions): TagToken {\n const { file, input } = this\n const begin = this.p\n if (this.readToDelimiter(options.tagDelimiterRight) === -1) {\n throw this.error(`tag ${this.snapshot(begin)} not closed`, begin)\n }\n const token = new TagToken(input, begin, this.p, options, file)\n if (token.name === 'raw') this.rawBeginAt = begin\n return token\n }\n\n readToDelimiter (delimiter: string, respectQuoted = false) {\n this.skipBlank()\n while (this.p < this.N) {\n if (respectQuoted && (this.peekType() & QUOTE)) {\n this.readQuoted()\n continue\n }\n ++this.p\n if (this.rmatch(delimiter)) return this.p\n }\n return -1\n }\n\n readOutputToken (options: NormalizedFullOptions = defaultOptions): OutputToken {\n const { file, input } = this\n const { outputDelimiterRight } = options\n const begin = this.p\n if (this.readToDelimiter(outputDelimiterRight, true) === -1) {\n throw this.error(`output ${this.snapshot(begin)} not closed`, begin)\n }\n return new OutputToken(input, begin, this.p, options, file)\n }\n\n readEndrawOrRawContent (options: NormalizedFullOptions): HTMLToken | TagToken {\n const { tagDelimiterLeft, tagDelimiterRight } = options\n const begin = this.p\n let leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length\n while (this.p < this.N) {\n if (this.readIdentifier().getText() !== 'endraw') {\n leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length\n continue\n }\n while (this.p <= this.N) {\n if (this.rmatch(tagDelimiterRight)) {\n const end = this.p\n if (begin === leftPos) {\n this.rawBeginAt = -1\n return new TagToken(this.input, begin, end, options, this.file)\n } else {\n this.p = leftPos\n return new HTMLToken(this.input, begin, leftPos, this.file)\n }\n }\n if (this.rmatch(tagDelimiterLeft)) break\n this.p++\n }\n }\n throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, begin)\n }\n\n readLiquidTagTokens (options: NormalizedFullOptions = defaultOptions): LiquidTagToken[] {\n const tokens: LiquidTagToken[] = []\n while (this.p < this.N) {\n const token = this.readLiquidTagToken(options)\n token && tokens.push(token)\n }\n return tokens\n }\n\n readLiquidTagToken (options: NormalizedFullOptions): LiquidTagToken | undefined {\n this.skipBlank()\n if (this.end()) return\n\n const begin = this.p\n this.readToDelimiter('\\n')\n const end = this.p\n return new LiquidTagToken(this.input, begin, end, options, this.file)\n }\n\n error (msg: string, pos: number = this.p) {\n return new TokenizationError(msg, new IdentifierToken(this.input, pos, this.N, this.file))\n }\n\n assert (pred: unknown, msg: string | (() => string), pos?: number) {\n if (!pred) throw this.error(typeof msg === 'function' ? msg() : msg, pos)\n }\n\n snapshot (begin: number = this.p) {\n return JSON.stringify(ellipsis(this.input.slice(begin, this.N), 32))\n }\n\n /**\n * @deprecated use #readIdentifier instead\n */\n readWord () {\n return this.readIdentifier()\n }\n\n readIdentifier (): IdentifierToken {\n this.skipBlank()\n const begin = this.p\n while (!this.end() && isWord(this.peek())) ++this.p\n return new IdentifierToken(this.input, begin, this.p, this.file)\n }\n\n readNonEmptyIdentifier (): IdentifierToken | undefined {\n const id = this.readIdentifier()\n return id.size() ? id : undefined\n }\n\n readTagName (): string {\n this.skipBlank()\n // Handle inline comment tags\n if (this.input[this.p] === '#') return this.input.slice(this.p, ++this.p)\n return this.readIdentifier().getText()\n }\n\n readHashes (jekyllStyle?: boolean) {\n const hashes = []\n while (true) {\n const hash = this.readHash(jekyllStyle)\n if (!hash) return hashes\n hashes.push(hash)\n }\n }\n\n readHash (jekyllStyle?: boolean): HashToken | undefined {\n this.skipBlank()\n if (this.peek() === ',') ++this.p\n const begin = this.p\n const name = this.readNonEmptyIdentifier()\n if (!name) return\n let value\n\n this.skipBlank()\n const sep = jekyllStyle ? '=' : ':'\n if (this.peek() === sep) {\n ++this.p\n value = this.readValue()\n }\n return new HashToken(this.input, begin, this.p, name, value, this.file)\n }\n\n remaining () {\n return this.input.slice(this.p, this.N)\n }\n\n advance (step = 1) {\n this.p += step\n }\n\n end () {\n return this.p >= this.N\n }\n\n readTo (end: string): number {\n while (this.p < this.N) {\n ++this.p\n if (this.rmatch(end)) return this.p\n }\n return -1\n }\n\n readValue (): ValueToken | undefined {\n this.skipBlank()\n const begin = this.p\n const variable = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber()\n const props = this.readProperties(!variable)\n if (!props.length) return variable\n return new PropertyAccessToken(variable, props, this.input, begin, this.p)\n }\n\n readScopeValue (): ValueToken | undefined {\n this.skipBlank()\n const begin = this.p\n const props = this.readProperties()\n if (!props.length) return undefined\n return new PropertyAccessToken(undefined, props, this.input, begin, this.p)\n }\n\n private readProperties (isBegin = true): (ValueToken | IdentifierToken)[] {\n const props: (ValueToken | IdentifierToken)[] = []\n while (true) {\n if (this.peek() === '[') {\n this.p++\n const prop = this.readValue() || new IdentifierToken(this.input, this.p, this.p, this.file)\n this.assert(this.readTo(']') !== -1, '[ not closed')\n props.push(prop)\n continue\n }\n if (isBegin && !props.length) {\n const prop = this.readNonEmptyIdentifier()\n if (prop) {\n props.push(prop)\n continue\n }\n }\n if (this.peek() === '.' && this.peek(1) !== '.') { // skip range syntax\n this.p++\n const prop = this.readNonEmptyIdentifier()\n if (!prop) break\n props.push(prop)\n continue\n }\n break\n }\n return props\n }\n\n readNumber (): NumberToken | undefined {\n this.skipBlank()\n let decimalFound = false\n let digitFound = false\n let n = 0\n if (this.peekType() & SIGN) n++\n while (this.p + n <= this.N) {\n if (this.peekType(n) & NUMBER) {\n digitFound = true\n n++\n } else if (this.peek(n) === '.' && this.peek(n + 1) !== '.') {\n if (decimalFound || !digitFound) return\n decimalFound = true\n n++\n } else break\n }\n if (digitFound && !isWord(this.peek(n))) {\n const num = new NumberToken(this.input, this.p, this.p + n, this.file)\n this.advance(n)\n return num\n }\n }\n\n readLiteral (): LiteralToken | undefined {\n this.skipBlank()\n const end = this.matchTrie(this.literalTrie)\n if (end === -1) return\n const literal = new LiteralToken(this.input, this.p, end, this.file)\n this.p = end\n return literal\n }\n\n readRange (): RangeToken | undefined {\n this.skipBlank()\n const begin = this.p\n if (this.peek() !== '(') return\n ++this.p\n const lhs = this.readValueOrThrow()\n this.p += 2\n const rhs = this.readValueOrThrow()\n ++this.p\n return new RangeToken(this.input, begin, this.p, lhs, rhs, this.file)\n }\n\n readValueOrThrow (): ValueToken {\n const value = this.readValue()\n this.assert(value, () => `unexpected token ${this.snapshot()}, value expected`)\n return value!\n }\n\n readQuoted (): QuotedToken | undefined {\n this.skipBlank()\n const begin = this.p\n if (!(this.peekType() & QUOTE)) return\n ++this.p\n let escaped = false\n while (this.p < this.N) {\n ++this.p\n if (this.input[this.p - 1] === this.input[begin] && !escaped) break\n if (escaped) escaped = false\n else if (this.input[this.p - 1] === '\\\\') escaped = true\n }\n return new QuotedToken(this.input, begin, this.p, this.file)\n }\n\n * readFileNameTemplate (options: NormalizedFullOptions): IterableIterator {\n const { outputDelimiterLeft } = options\n const htmlStopStrings = [',', ' ', outputDelimiterLeft]\n const htmlStopStringSet = new Set(htmlStopStrings)\n // break on ',' and ' ', outputDelimiterLeft only stops HTML token\n while (this.p < this.N && !htmlStopStringSet.has(this.peek())) {\n yield this.match(outputDelimiterLeft)\n ? this.readOutputToken(options)\n : this.readHTMLToken(htmlStopStrings)\n }\n }\n\n match (word: string) {\n for (let i = 0; i < word.length; i++) {\n if (word[i] !== this.input[this.p + i]) return false\n }\n return true\n }\n\n rmatch (pattern: string) {\n for (let i = 0; i < pattern.length; i++) {\n if (pattern[pattern.length - 1 - i] !== this.input[this.p - 1 - i]) return false\n }\n return true\n }\n\n peekType (n = 0) {\n return this.p + n >= this.N ? 0 : TYPES[this.input.charCodeAt(this.p + n)]\n }\n\n peek (n = 0): string {\n return this.p + n >= this.N ? '' : this.input[this.p + n]\n }\n\n skipBlank () {\n while (this.peekType() & BLANK) ++this.p\n }\n}\n","import { Token, TopLevelToken } from '../tokens'\nimport { Template } from '../template'\nimport { isTagToken } from '../util'\n\ntype ParseToken = ((token: T, remainTokens: T[]) => Template)\n\nexport class ParseStream {\n private tokens: T[]\n private handlers: Record void> = {}\n private stopRequested = false\n private parseToken: ParseToken\n\n public constructor (tokens: T[], parseToken: ParseToken) {\n this.tokens = tokens\n this.parseToken = parseToken\n }\n public on (name: string, cb: (this: ParseStream, arg: T2) => void): ParseStream {\n this.handlers[name] = cb\n return this\n }\n private trigger (event: string, arg?: T) {\n const h = this.handlers[event]\n return h ? (h.call(this, arg), true) : false\n }\n public start () {\n this.trigger('start')\n let token: T | undefined\n while (!this.stopRequested && (token = this.tokens.shift())) {\n if (this.trigger('token', token)) continue\n if (isTagToken(token) && this.trigger(`tag:${token.name}`, token)) {\n continue\n }\n const template = this.parseToken(token, this.tokens)\n this.trigger('template', template)\n }\n if (!this.stopRequested) this.trigger('end')\n return this\n }\n public stop () {\n this.stopRequested = true\n return this\n }\n}\n","export abstract class TemplateImpl {\n public token: T;\n public constructor (token: T) {\n this.token = token\n }\n}\n","import { TemplateImpl } from './template-impl'\nimport type { Emitter } from '../emitters/emitter'\nimport type { Tokenizer } from '../parser'\nimport type { Context } from '../context/context'\nimport type { TopLevelToken, TagToken } from '../tokens'\nimport type { Template } from './template'\nimport type { Liquid } from '../liquid'\n\nexport type TagRenderReturn = Generator | Promise | unknown\n\nexport abstract class Tag extends TemplateImpl implements Template {\n public name: string\n public liquid: Liquid\n protected tokenizer: Tokenizer\n\n public constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token)\n this.name = token.name\n this.liquid = liquid\n this.tokenizer = token.tokenizer\n }\n public abstract render (ctx: Context, emitter: Emitter): TagRenderReturn;\n}\n\nexport interface TagClass {\n new(token: TagToken, tokens: TopLevelToken[], liquid: Liquid): Tag\n}\n","import { evalToken } from '../render/expression'\nimport { Context } from '../context/context'\nimport { Tokenizer } from '../parser/tokenizer'\nimport { Token } from '../tokens/token'\n\ntype HashValueTokens = Record\n\n/**\n * Key-Value Pairs Representing Tag Arguments\n * Example:\n * For the markup `, foo:'bar', coo:2 reversed %}`,\n * hash['foo'] === 'bar'\n * hash['coo'] === 2\n * hash['reversed'] === undefined\n */\nexport class Hash {\n hash: HashValueTokens = {}\n constructor (markup: string, jekyllStyle?: boolean) {\n const tokenizer = new Tokenizer(markup, {})\n for (const hash of tokenizer.readHashes(jekyllStyle)) {\n this.hash[hash.name.content] = hash.value\n }\n }\n * render (ctx: Context): Generator, unknown> {\n const hash = {}\n for (const key of Object.keys(this.hash)) {\n hash[key] = this.hash[key] === undefined ? true : yield evalToken(this.hash[key], ctx)\n }\n return hash\n }\n}\n","import { isFunction } from '../util'\nimport { Hash } from './hash'\nimport { Tag, TagClass, TagRenderReturn } from './tag'\nimport { TagToken, TopLevelToken } from '../tokens'\nimport { Emitter } from '../emitters'\nimport { Context } from '../context'\nimport type { Liquid } from '../liquid'\n\nexport interface TagImplOptions {\n [key: string]: any\n parse?: (this: Tag & TagImplOptions, token: TagToken, remainingTokens: TopLevelToken[]) => void;\n render: (this: Tag & TagImplOptions, ctx: Context, emitter: Emitter, hash: Record) => TagRenderReturn;\n}\n\nexport function createTagClass (options: TagImplOptions): TagClass {\n return class extends Tag {\n constructor (token: TagToken, tokens: TopLevelToken[], liquid: Liquid) {\n super(token, tokens, liquid)\n if (isFunction(options.parse)) {\n options.parse.call(this, token, tokens)\n }\n }\n * render (ctx: Context, emitter: Emitter): TagRenderReturn {\n const hash = (yield new Hash(this.token.args).render(ctx)) as Record\n return yield options.render.call(this, ctx, emitter, hash)\n }\n }\n}\n","import { isArray } from '../util/underscore'\nimport { ValueToken } from '../tokens/value-token'\n\ntype KeyValuePair = [string?, ValueToken?]\n\nexport type FilterArg = ValueToken | KeyValuePair\n\nexport function isKeyValuePair (arr: FilterArg): arr is KeyValuePair {\n return isArray(arr)\n}\n","import { evalToken } from '../render'\nimport { Context } from '../context'\nimport { identify, isFunction } from '../util/underscore'\nimport { FilterHandler, FilterImplOptions } from './filter-impl-options'\nimport { FilterArg, isKeyValuePair } from '../parser/filter-arg'\nimport { Liquid } from '../liquid'\n\nexport class Filter {\n public name: string\n public args: FilterArg[]\n public readonly raw: boolean\n private handler: FilterHandler\n private liquid: Liquid\n\n public constructor (name: string, options: FilterImplOptions | undefined, args: FilterArg[], liquid: Liquid) {\n this.name = name\n this.handler = isFunction(options)\n ? options\n : (isFunction(options?.handler) ? options!.handler : identify)\n this.raw = !isFunction(options) && !!options?.raw\n this.args = args\n this.liquid = liquid\n }\n public * render (value: any, context: Context): IterableIterator {\n const argv: any[] = []\n for (const arg of this.args as FilterArg[]) {\n if (isKeyValuePair(arg)) argv.push([arg[0], yield evalToken(arg[1], context)])\n else argv.push(yield evalToken(arg, context))\n }\n return yield this.handler.apply({ context, liquid: this.liquid }, [value, ...argv])\n }\n}\n","import { Filter } from './filter'\nimport { Expression } from '../render'\nimport { Tokenizer } from '../parser'\nimport { assert } from '../util'\nimport type { FilteredValueToken } from '../tokens'\nimport type { Liquid } from '../liquid'\nimport type { Context } from '../context'\n\nexport class Value {\n public readonly filters: Filter[] = []\n public readonly initial: Expression\n\n /**\n * @param str the value to be valuated, eg.: \"foobar\" | truncate: 3\n */\n public constructor (input: string | FilteredValueToken, liquid: Liquid) {\n const token: FilteredValueToken = typeof input === 'string'\n ? new Tokenizer(input, liquid.options.operators).readFilteredValue()\n : input\n this.initial = token.initial\n this.filters = token.filters.map(({ name, args }) => new Filter(name, this.getFilter(liquid, name), args, liquid))\n }\n public * value (ctx: Context, lenient?: boolean): Generator {\n lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default')\n let val = yield this.initial.evaluate(ctx, lenient)\n\n for (const filter of this.filters) {\n val = yield filter.render(val, ctx)\n }\n return val\n }\n private getFilter (liquid: Liquid, name: string) {\n const impl = liquid.filters[name]\n assert(impl || !liquid.options.strictFilters, () => `undefined filter: ${name}`)\n return impl\n }\n}\n","import { Value } from './value'\nimport { Template, TemplateImpl } from '../template'\nimport { Context } from '../context/context'\nimport { Emitter } from '../emitters/emitter'\nimport { OutputToken } from '../tokens/output-token'\nimport { Tokenizer } from '../parser'\nimport { Liquid } from '../liquid'\nimport { Filter } from './filter'\n\nexport class Output extends TemplateImpl implements Template {\n value: Value\n public constructor (token: OutputToken, liquid: Liquid) {\n super(token)\n const tokenizer = new Tokenizer(token.input, liquid.options.operators, token.file, token.contentRange)\n this.value = new Value(tokenizer.readFilteredValue(), liquid)\n const filters = this.value.filters\n const outputEscape = liquid.options.outputEscape\n if (!filters[filters.length - 1]?.raw && outputEscape) {\n filters.push(new Filter(toString.call(outputEscape), outputEscape, [], liquid))\n }\n }\n public * render (ctx: Context, emitter: Emitter): IterableIterator {\n const val = yield this.value.value(ctx, false)\n emitter.write(val)\n }\n}\n","import { TemplateImpl, Template } from '../template'\nimport { HTMLToken } from '../tokens'\nimport { Context } from '../context'\nimport { Emitter } from '../emitters'\n\nexport class HTML extends TemplateImpl implements Template {\n private str: string\n public constructor (token: HTMLToken) {\n super(token)\n this.str = token.getContent()\n }\n public * render (ctx: Context, emitter: Emitter): IterableIterator {\n emitter.write(this.str)\n }\n}\n","import { FS } from './fs'\nimport { assert, escapeRegex } from '../util'\n\nexport interface LoaderOptions {\n fs: FS;\n extname: string;\n root: string[];\n partials: string[];\n layouts: string[];\n relativeReference: boolean;\n}\nexport enum LookupType {\n Partials = 'partials',\n Layouts = 'layouts',\n Root = 'root'\n}\nexport class Loader {\n public shouldLoadRelative: (referencedFile: string) => boolean\n private options: LoaderOptions\n private contains: (root: string, file: string) => boolean\n\n constructor (options: LoaderOptions) {\n this.options = options\n if (options.relativeReference) {\n const sep = options.fs.sep\n assert(sep, '`fs.sep` is required for relative reference')\n const rRelativePath = new RegExp(['.' + sep, '..' + sep, './', '../'].map(prefix => escapeRegex(prefix)).join('|'))\n this.shouldLoadRelative = (referencedFile: string) => rRelativePath.test(referencedFile)\n } else {\n this.shouldLoadRelative = (referencedFile: string) => false\n }\n this.contains = this.options.fs.contains || (() => true)\n }\n\n public * lookup (file: string, type: LookupType, sync?: boolean, currentFile?: string): Generator {\n const { fs } = this.options\n const dirs = this.options[type]\n for (const filepath of this.candidates(file, dirs, currentFile, type !== LookupType.Root)) {\n if (sync ? fs.existsSync(filepath) : yield fs.exists(filepath)) return filepath\n }\n throw this.lookupError(file, dirs)\n }\n\n public * candidates (file: string, dirs: string[], currentFile?: string, enforceRoot?: boolean) {\n const { fs, extname } = this.options\n if (this.shouldLoadRelative(file) && currentFile) {\n const referenced = fs.resolve(this.dirname(currentFile), file, extname)\n for (const dir of dirs) {\n if (!enforceRoot || this.contains(dir, referenced)) {\n // the relatively referenced file is within one of root dirs\n yield referenced\n break\n }\n }\n }\n for (const dir of dirs) {\n const referenced = fs.resolve(dir, file, extname)\n if (!enforceRoot || this.contains(dir, referenced)) {\n yield referenced\n }\n }\n if (fs.fallback !== undefined) {\n const filepath = fs.fallback(file)\n if (filepath !== undefined) yield filepath\n }\n }\n\n private dirname (path: string) {\n const fs = this.options.fs\n assert(fs.dirname, '`fs.dirname` is required for relative reference')\n return fs.dirname!(path)\n }\n\n private lookupError (file: string, roots: string[]) {\n const err = new Error('ENOENT') as any\n err.message = `ENOENT: Failed to lookup \"${file}\" in \"${roots}\"`\n err.code = 'ENOENT'\n return err\n }\n}\n","import { toPromise, assert, isTagToken, isOutputToken, ParseError } from '../util'\nimport { Tokenizer } from './tokenizer'\nimport { ParseStream } from './parse-stream'\nimport { TopLevelToken, OutputToken } from '../tokens'\nimport { Template, Output, HTML } from '../template'\nimport { LiquidCache } from '../cache'\nimport { FS, Loader, LookupType } from '../fs'\nimport { LiquidError, LiquidErrors } from '../util/error'\nimport type { Liquid } from '../liquid'\n\nexport class Parser {\n public parseFile: (file: string, sync?: boolean, type?: LookupType, currentFile?: string) => Generator\n\n private liquid: Liquid\n private fs: FS\n private cache?: LiquidCache\n private loader: Loader\n\n public constructor (liquid: Liquid) {\n this.liquid = liquid\n this.cache = this.liquid.options.cache\n this.fs = this.liquid.options.fs\n this.parseFile = this.cache ? this._parseFileCached : this._parseFile\n this.loader = new Loader(this.liquid.options)\n }\n public parse (html: string, filepath?: string): Template[] {\n const tokenizer = new Tokenizer(html, this.liquid.options.operators, filepath)\n const tokens = tokenizer.readTopLevelTokens(this.liquid.options)\n return this.parseTokens(tokens)\n }\n public parseTokens (tokens: TopLevelToken[]) {\n let token\n const templates: Template[] = []\n const errors: LiquidError[] = []\n while ((token = tokens.shift())) {\n try {\n templates.push(this.parseToken(token, tokens))\n } catch (err) {\n if (this.liquid.options.catchAllErrors) errors.push(err as LiquidError)\n else throw err\n }\n }\n if (errors.length) throw new LiquidErrors(errors)\n return templates\n }\n public parseToken (token: TopLevelToken, remainTokens: TopLevelToken[]) {\n try {\n if (isTagToken(token)) {\n const TagClass = this.liquid.tags[token.name]\n assert(TagClass, `tag \"${token.name}\" not found`)\n return new TagClass(token, remainTokens, this.liquid)\n }\n if (isOutputToken(token)) {\n return new Output(token as OutputToken, this.liquid)\n }\n return new HTML(token)\n } catch (e) {\n if (LiquidError.is(e)) throw e\n throw new ParseError(e as Error, token)\n }\n }\n public parseStream (tokens: TopLevelToken[]) {\n return new ParseStream(tokens, (token, tokens) => this.parseToken(token, tokens))\n }\n private * _parseFileCached (file: string, sync?: boolean, type: LookupType = LookupType.Root, currentFile?: string): Generator {\n const cache = this.cache!\n const key = this.loader.shouldLoadRelative(file) ? currentFile + ',' + file : type + ':' + file\n const tpls = yield cache.read(key)\n if (tpls) return tpls\n\n const task = this._parseFile(file, sync, type, currentFile)\n // sync mode: exec the task and cache the result\n // async mode: cache the task before exec\n const taskOrTpl = sync ? yield task : toPromise(task)\n cache.write(key, taskOrTpl as any)\n // note: concurrent tasks will be reused, cache for failed task is removed until its end\n try { return yield taskOrTpl } catch (err) { cache.remove(key); throw err }\n }\n private * _parseFile (file: string, sync?: boolean, type: LookupType = LookupType.Root, currentFile?: string): Generator {\n const filepath = yield this.loader.lookup(file, type, sync, currentFile)\n return this.liquid.parse(sync ? this.fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath)\n }\n}\n","export enum TokenKind {\n Number = 1,\n Literal = 2,\n Tag = 4,\n Output = 8,\n HTML = 16,\n Filter = 32,\n Hash = 64,\n PropertyAccess = 128,\n Word = 256,\n Range = 512,\n Quoted = 1024,\n Operator = 2048,\n FilteredValue = 4096,\n Delimited = Tag | Output\n}\n","import { RangeToken, NumberToken, QuotedToken, LiteralToken, PropertyAccessToken, OutputToken, HTMLToken, TagToken, IdentifierToken, DelimitedToken, OperatorToken } from '../tokens'\nimport { TokenKind } from '../parser'\n\nexport function isDelimitedToken (val: any): val is DelimitedToken {\n return !!(getKind(val) & TokenKind.Delimited)\n}\n\nexport function isOperatorToken (val: any): val is OperatorToken {\n return getKind(val) === TokenKind.Operator\n}\n\nexport function isHTMLToken (val: any): val is HTMLToken {\n return getKind(val) === TokenKind.HTML\n}\n\nexport function isOutputToken (val: any): val is OutputToken {\n return getKind(val) === TokenKind.Output\n}\n\nexport function isTagToken (val: any): val is TagToken {\n return getKind(val) === TokenKind.Tag\n}\n\nexport function isQuotedToken (val: any): val is QuotedToken {\n return getKind(val) === TokenKind.Quoted\n}\n\nexport function isLiteralToken (val: any): val is LiteralToken {\n return getKind(val) === TokenKind.Literal\n}\n\nexport function isNumberToken (val: any): val is NumberToken {\n return getKind(val) === TokenKind.Number\n}\n\nexport function isPropertyAccessToken (val: any): val is PropertyAccessToken {\n return getKind(val) === TokenKind.PropertyAccess\n}\n\nexport function isWordToken (val: any): val is IdentifierToken {\n return getKind(val) === TokenKind.Word\n}\n\nexport function isRangeToken (val: any): val is RangeToken {\n return getKind(val) === TokenKind.Range\n}\n\nfunction getKind (val: any) {\n return val ? val.kind : -1\n}\n","import { Drop } from '../drop/drop'\nimport { __assign } from 'tslib'\nimport { NormalizedFullOptions, defaultOptions, RenderOptions } from '../liquid-options'\nimport { Scope } from './scope'\nimport { isArray, isNil, isUndefined, isString, isFunction, toLiquid, InternalUndefinedVariableError, toValueSync, isObject } from '../util'\n\ntype PropertyKey = string | number;\n\nexport class Context {\n /**\n * insert a Context-level empty scope,\n * for tags like `{% capture %}` `{% assign %}` to operate\n */\n private scopes: Scope[] = [{}]\n private registers = {}\n /**\n * user passed in scope\n * `{% increment %}`, `{% decrement %}` changes this scope,\n * whereas `{% capture %}`, `{% assign %}` only hide this scope\n */\n public environments: Scope\n /**\n * global scope used as fallback for missing variables\n */\n public globals: Scope\n public sync: boolean\n /**\n * The normalized liquid options object\n */\n public opts: NormalizedFullOptions\n /**\n * Throw when accessing undefined variable?\n */\n public strictVariables: boolean;\n public ownPropertyOnly: boolean;\n public constructor (env: object = {}, opts: NormalizedFullOptions = defaultOptions, renderOptions: RenderOptions = {}) {\n this.sync = !!renderOptions.sync\n this.opts = opts\n this.globals = renderOptions.globals ?? opts.globals\n this.environments = isObject(env) ? env : Object(env)\n this.strictVariables = renderOptions.strictVariables ?? this.opts.strictVariables\n this.ownPropertyOnly = renderOptions.ownPropertyOnly ?? opts.ownPropertyOnly\n }\n public getRegister (key: string) {\n return (this.registers[key] = this.registers[key] || {})\n }\n public setRegister (key: string, value: any) {\n return (this.registers[key] = value)\n }\n public saveRegister (...keys: string[]): [string, any][] {\n return keys.map(key => [key, this.getRegister(key)])\n }\n public restoreRegister (keyValues: [string, any][]) {\n return keyValues.forEach(([key, value]) => this.setRegister(key, value))\n }\n public getAll () {\n return [this.globals, this.environments, ...this.scopes]\n .reduce((ctx, val) => __assign(ctx, val), {})\n }\n /**\n * @deprecated use `_get()` or `getSync()` instead\n */\n public get (paths: PropertyKey[]): unknown {\n return this.getSync(paths)\n }\n public getSync (paths: PropertyKey[]): unknown {\n return toValueSync(this._get(paths))\n }\n public * _get (paths: PropertyKey[]): IterableIterator {\n const scope = this.findScope(paths[0])\n return yield this._getFromScope(scope, paths)\n }\n /**\n * @deprecated use `_get()` instead\n */\n public getFromScope (scope: unknown, paths: PropertyKey[] | string): IterableIterator {\n return toValueSync(this._getFromScope(scope, paths))\n }\n public * _getFromScope (scope: unknown, paths: PropertyKey[] | string, strictVariables = this.strictVariables): IterableIterator {\n if (isString(paths)) paths = paths.split('.')\n for (let i = 0; i < paths.length; i++) {\n scope = yield readProperty(scope as object, paths[i], this.ownPropertyOnly)\n if (strictVariables && isUndefined(scope)) {\n throw new InternalUndefinedVariableError((paths as string[]).slice(0, i + 1).join!('.'))\n }\n }\n return scope\n }\n public push (ctx: object) {\n return this.scopes.push(ctx)\n }\n public pop () {\n return this.scopes.pop()\n }\n public bottom () {\n return this.scopes[0]\n }\n private findScope (key: string | number) {\n for (let i = this.scopes.length - 1; i >= 0; i--) {\n const candidate = this.scopes[i]\n if (key in candidate) return candidate\n }\n if (key in this.environments) return this.environments\n return this.globals\n }\n}\n\nexport function readProperty (obj: Scope, key: PropertyKey, ownPropertyOnly: boolean) {\n obj = toLiquid(obj)\n if (isNil(obj)) return obj\n if (isArray(obj) && key < 0) return obj[obj.length + +key]\n const value = readJSProperty(obj, key, ownPropertyOnly)\n if (value === undefined && obj instanceof Drop) return obj.liquidMethodMissing(key)\n if (isFunction(value)) return value.call(obj)\n if (key === 'size') return readSize(obj)\n else if (key === 'first') return readFirst(obj)\n else if (key === 'last') return readLast(obj)\n return value\n}\nexport function readJSProperty (obj: Scope, key: PropertyKey, ownPropertyOnly: boolean) {\n if (ownPropertyOnly && !Object.hasOwnProperty.call(obj, key) && !(obj instanceof Drop)) return undefined\n return obj[key]\n}\n\nfunction readFirst (obj: Scope) {\n if (isArray(obj)) return obj[0]\n return obj['first']\n}\n\nfunction readLast (obj: Scope) {\n if (isArray(obj)) return obj[obj.length - 1]\n return obj['last']\n}\n\nfunction readSize (obj: Scope) {\n if (obj.hasOwnProperty('size') || obj['size'] !== undefined) return obj['size']\n if (isArray(obj) || isString(obj)) return obj.length\n if (typeof obj === 'object') return Object.keys(obj).length\n}\n","export enum BlockMode {\n /* store rendered html into blocks */\n OUTPUT,\n /* output rendered html directly */\n STORE\n}\n","import { toValue, argumentsToValue } from '../util/underscore'\n\nexport const abs = argumentsToValue(Math.abs)\nexport const at_least = argumentsToValue(Math.max)\nexport const at_most = argumentsToValue(Math.min)\nexport const ceil = argumentsToValue(Math.ceil)\nexport const divided_by = argumentsToValue((dividend: number, divisor: number, integerArithmetic = false) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor)\nexport const floor = argumentsToValue(Math.floor)\nexport const minus = argumentsToValue((v: number, arg: number) => v - arg)\nexport const modulo = argumentsToValue((v: number, arg: number) => v % arg)\nexport const times = argumentsToValue((v: number, arg: number) => v * arg)\n\nexport function round (v: number, arg = 0) {\n v = toValue(v)\n arg = toValue(arg)\n const amp = Math.pow(10, arg)\n return Math.round(v * amp) / amp\n}\n\nexport function plus (v: number, arg: number) {\n v = toValue(v)\n arg = toValue(arg)\n return Number(v) + Number(arg)\n}\n","import { stringify } from '../util/underscore'\n\nexport const url_decode = (x: string) => decodeURIComponent(stringify(x)).replace(/\\+/g, ' ')\nexport const url_encode = (x: string) => encodeURIComponent(stringify(x)).replace(/%20/g, '+')\nexport const cgi_escape = (x: string) => encodeURIComponent(stringify(x))\n .replace(/%20/g, '+')\n .replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase())\nexport const uri_escape = (x: string) => encodeURI(stringify(x))\n .replace(/%5B/g, '[')\n .replace(/%5D/g, ']')\n\nconst rSlugifyDefault = /[^\\p{M}\\p{L}\\p{Nd}]+/ug\nconst rSlugifyReplacers = {\n 'raw': /\\s+/g,\n 'default': rSlugifyDefault,\n 'pretty': /[^\\p{M}\\p{L}\\p{Nd}._~!$&'()+,;=@]+/ug,\n 'ascii': /[^A-Za-z0-9]+/g,\n 'latin': rSlugifyDefault,\n 'none': null\n}\n\nexport function slugify (str: string, mode: keyof typeof rSlugifyReplacers = 'default', cased = false): string {\n str = stringify(str)\n\n const replacer = rSlugifyReplacers[mode]\n if (replacer) {\n if (mode === 'latin') str = removeAccents(str)\n str = str.replace(replacer, '-').replace(/^-|-$/g, '')\n }\n\n return cased ? str : str.toLowerCase()\n}\n\nfunction removeAccents (str: string): string {\n return str.replace(/[àáâãäå]/g, 'a')\n .replace(/[æ]/g, 'ae')\n .replace(/[ç]/g, 'c')\n .replace(/[èéêë]/g, 'e')\n .replace(/[ìíîï]/g, 'i')\n .replace(/[ð]/g, 'd')\n .replace(/[ñ]/g, 'n')\n .replace(/[òóôõöø]/g, 'o')\n .replace(/[ùúûü]/g, 'u')\n .replace(/[ýÿ]/g, 'y')\n .replace(/[ß]/g, 'ss')\n .replace(/[œ]/g, 'oe')\n .replace(/[þ]/g, 'th')\n .replace(/[ẞ]/g, 'SS')\n .replace(/[Œ]/g, 'OE')\n .replace(/[Þ]/g, 'TH')\n}\n","import { toArray, argumentsToValue, toValue, stringify, caseInsensitiveCompare, isArray, isNil, last as arrayLast, hasOwnProperty } from '../util'\nimport { equals, evalToken, isTruthy } from '../render'\nimport { Value, FilterImpl } from '../template'\nimport { Context, Scope } from '../context'\nimport { Tokenizer } from '../parser'\n\nexport const join = argumentsToValue((v: any[], arg: string) => toArray(v).join(arg === undefined ? ' ' : arg))\nexport const last = argumentsToValue((v: any) => isArray(v) ? arrayLast(v) : '')\nexport const first = argumentsToValue((v: any) => isArray(v) ? v[0] : '')\nexport const reverse = argumentsToValue((v: any[]) => [...toArray(v)].reverse())\n\nexport function * sort (this: FilterImpl, arr: T[], property?: string): IterableIterator {\n const values: [T, string | number][] = []\n for (const item of toArray(arr)) {\n values.push([\n item,\n property ? yield this.context._getFromScope(item, stringify(property).split('.'), false) : item\n ])\n }\n return values.sort((lhs, rhs) => {\n const lvalue = lhs[1]\n const rvalue = rhs[1]\n return lvalue < rvalue ? -1 : (lvalue > rvalue ? 1 : 0)\n }).map(tuple => tuple[0])\n}\n\nexport function sort_natural (input: T[], property?: string) {\n const propertyString = stringify(property)\n const compare = property === undefined\n ? caseInsensitiveCompare\n : (lhs: T, rhs: T) => caseInsensitiveCompare(lhs[propertyString], rhs[propertyString])\n return [...toArray(input)].sort(compare)\n}\n\nexport const size = (v: string | any[]) => (v && v.length) || 0\n\nexport function * map (this: FilterImpl, arr: Scope[], property: string): IterableIterator {\n const results = []\n for (const item of toArray(arr)) {\n results.push(yield this.context._getFromScope(item, stringify(property), false))\n }\n return results\n}\n\nexport function * sum (this: FilterImpl, arr: Scope[], property?: string): IterableIterator {\n let sum = 0\n for (const item of toArray(arr)) {\n const data = Number(property ? yield this.context._getFromScope(item, stringify(property), false) : item)\n sum += Number.isNaN(data) ? 0 : data\n }\n return sum\n}\n\nexport function compact (this: FilterImpl, arr: T[]) {\n return toArray(arr).filter(x => !isNil(toValue(x)))\n}\n\nexport function concat (v: T1[], arg: T2[] = []): (T1 | T2)[] {\n return toArray(v).concat(toArray(arg))\n}\n\nexport function push (v: T[], arg: T): T[] {\n return concat(v, [arg])\n}\n\nexport function unshift (v: T[], arg: T): T[] {\n const clone = [...toArray(v)]\n clone.unshift(arg)\n return clone\n}\n\nexport function pop (v: T[]): T[] {\n const clone = [...toArray(v)]\n clone.pop()\n return clone\n}\n\nexport function shift (v: T[]): T[] {\n const clone = [...toArray(v)]\n clone.shift()\n return clone\n}\n\nexport function slice (v: T[] | string, begin: number, length = 1): T[] | string {\n v = toValue(v)\n if (isNil(v)) return []\n if (!isArray(v)) v = stringify(v)\n begin = begin < 0 ? v.length + begin : begin\n return v.slice(begin, begin + length)\n}\n\nexport function * where (this: FilterImpl, arr: T[], property: string, expected?: any): IterableIterator {\n const values: unknown[] = []\n arr = toArray(arr)\n const token = new Tokenizer(stringify(property)).readScopeValue()\n for (const item of arr) {\n values.push(yield evalToken(token, new Context(item)))\n }\n return arr.filter((_, i) => {\n if (expected === undefined) return isTruthy(values[i], this.context)\n return equals(values[i], expected)\n })\n}\n\nexport function * where_exp (this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator {\n const filtered: unknown[] = []\n const keyTemplate = new Value(stringify(exp), this.liquid)\n for (const item of toArray(arr)) {\n const value = yield keyTemplate.value(new Context({ [itemName]: item }))\n if (value) filtered.push(item)\n }\n return filtered\n}\n\nexport function * group_by (arr: T[], property: string): IterableIterator {\n const map = new Map()\n arr = toArray(arr)\n const token = new Tokenizer(stringify(property)).readScopeValue()\n for (const item of arr) {\n const key = yield evalToken(token, new Context(item))\n if (!map.has(key)) map.set(key, [])\n map.get(key).push(item)\n }\n return [...map.entries()].map(([name, items]) => ({ name, items }))\n}\n\nexport function * group_by_exp (this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator {\n const map = new Map()\n const keyTemplate = new Value(stringify(exp), this.liquid)\n for (const item of toArray(arr)) {\n const key = yield keyTemplate.value(new Context({ [itemName]: item }))\n if (!map.has(key)) map.set(key, [])\n map.get(key).push(item)\n }\n return [...map.entries()].map(([name, items]) => ({ name, items }))\n}\n\nexport function * find (this: FilterImpl, arr: T[], property: string, expected: string): IterableIterator {\n const token = new Tokenizer(stringify(property)).readScopeValue()\n for (const item of toArray(arr)) {\n const value = yield evalToken(token, new Context(item))\n if (equals(value, expected)) return item\n }\n return null\n}\n\nexport function * find_exp (this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator {\n const predicate = new Value(stringify(exp), this.liquid)\n for (const item of toArray(arr)) {\n const value = yield predicate.value(new Context({ [itemName]: item }))\n if (value) return item\n }\n return null\n}\n\nexport function uniq (arr: T[]): T[] {\n arr = toValue(arr)\n const u = {}\n return (arr || []).filter(val => {\n if (hasOwnProperty.call(u, String(val))) return false\n u[String(val)] = true\n return true\n })\n}\n\nexport function sample (v: T[] | string, count = 1): T | string | (T | string)[] {\n v = toValue(v)\n if (isNil(v)) return []\n if (!isArray(v)) v = stringify(v)\n const shuffled = [...v].sort(() => Math.random() - 0.5)\n if (count === 1) return shuffled[0]\n return shuffled.slice(0, count)\n}\n","import { toValue, stringify, isString, isNumber, TimezoneDate, LiquidDate, strftime, isNil } from '../util'\nimport { FilterImpl } from '../template'\nimport { LiquidOptions } from '../liquid-options'\n\nexport function date (this: FilterImpl, v: string | Date, format?: string, timezoneOffset?: number | string) {\n const date = parseDate(v, this.context.opts, timezoneOffset)\n if (!date) return v\n format = toValue(format)\n format = isNil(format) ? this.context.opts.dateFormat : stringify(format)\n return strftime(date, format)\n}\n\nexport function date_to_xmlschema (this: FilterImpl, v: string | Date) {\n return date.call(this, v, '%Y-%m-%dT%H:%M:%S%:z')\n}\n\nexport function date_to_rfc822 (this: FilterImpl, v: string | Date) {\n return date.call(this, v, '%a, %d %b %Y %H:%M:%S %z')\n}\n\nexport function date_to_string (this: FilterImpl, v: string | Date, type?: string, style?: string) {\n return stringify_date.call(this, v, '%b', type, style)\n}\n\nexport function date_to_long_string (this: FilterImpl, v: string | Date, type?: string, style?: string) {\n return stringify_date.call(this, v, '%B', type, style)\n}\n\nfunction stringify_date (this: FilterImpl, v: string | Date, month_type: string, type?: string, style?: string) {\n const date = parseDate(v, this.context.opts)\n if (!date) return v\n if (type === 'ordinal') {\n const d = date.getDate()\n return style === 'US'\n ? strftime(date, `${month_type} ${d}%q, %Y`)\n : strftime(date, `${d}%q ${month_type} %Y`)\n }\n return strftime(date, `%d ${month_type} %Y`)\n}\n\nfunction parseDate (v: string | Date, opts: LiquidOptions, timezoneOffset?: number | string): LiquidDate | undefined {\n let date: LiquidDate\n v = toValue(v)\n if (v === 'now' || v === 'today') {\n date = new Date()\n } else if (isNumber(v)) {\n date = new Date(v * 1000)\n } else if (isString(v)) {\n if (/^\\d+$/.test(v)) {\n date = new Date(+v * 1000)\n } else if (opts.preserveTimezones) {\n date = TimezoneDate.createDateFixedToTimezone(v)\n } else {\n date = new Date(v)\n }\n } else {\n date = v\n }\n if (!isValidDate(date)) return\n if (timezoneOffset !== undefined) {\n date = new TimezoneDate(date, timezoneOffset)\n } else if (!(date instanceof TimezoneDate) && opts.timezoneOffset !== undefined) {\n date = new TimezoneDate(date, opts.timezoneOffset)\n }\n return date\n}\n\nfunction isValidDate (date: any): date is Date {\n return (date instanceof Date || date instanceof TimezoneDate) && !isNaN(date.getTime())\n}\n","/**\n * String related filters\n *\n * * prefer stringify() to String() since `undefined`, `null` should eval ''\n */\n\n// Han (Chinese) characters: \\u4E00-\\u9FFF\n// Additional Han characters: \\uF900-\\uFAFF (CJK Compatibility Ideographs)\n// Additional Han characters: \\u3400-\\u4DBF (CJK Unified Ideographs Extension A)\n// Katakana (Japanese): \\u30A0-\\u30FF\n// Hiragana (Japanese): \\u3040-\\u309F\n// Hangul (Korean): \\uAC00-\\uD7AF\nimport { assert, escapeRegExp, stringify } from '../util'\n\nconst rCJKWord = /[\\u4E00-\\u9FFF\\uF900-\\uFAFF\\u3400-\\u4DBF\\u3040-\\u309F\\u30A0-\\u30FF\\uAC00-\\uD7AF]/gu\n\n// Word boundary followed by word characters (for detecting words)\nconst rNonCJKWord = /[^\\u4E00-\\u9FFF\\uF900-\\uFAFF\\u3400-\\u4DBF\\u3040-\\u309F\\u30A0-\\u30FF\\uAC00-\\uD7AF\\s]+/gu\n\nexport function append (v: string, arg: string) {\n assert(arguments.length === 2, 'append expect 2 arguments')\n return stringify(v) + stringify(arg)\n}\n\nexport function prepend (v: string, arg: string) {\n assert(arguments.length === 2, 'prepend expect 2 arguments')\n return stringify(arg) + stringify(v)\n}\n\nexport function lstrip (v: string, chars?: string) {\n if (chars) {\n chars = escapeRegExp(stringify(chars))\n return stringify(v).replace(new RegExp(`^[${chars}]+`, 'g'), '')\n }\n return stringify(v).replace(/^\\s+/, '')\n}\n\nexport function downcase (v: string) {\n return stringify(v).toLowerCase()\n}\n\nexport function upcase (str: string) {\n return stringify(str).toUpperCase()\n}\n\nexport function remove (v: string, arg: string) {\n return stringify(v).split(stringify(arg)).join('')\n}\n\nexport function remove_first (v: string, l: string) {\n return stringify(v).replace(stringify(l), '')\n}\n\nexport function remove_last (v: string, l: string) {\n const str = stringify(v)\n const pattern = stringify(l)\n const index = str.lastIndexOf(pattern)\n if (index === -1) return str\n return str.substring(0, index) + str.substring(index + pattern.length)\n}\n\nexport function rstrip (str: string, chars?: string) {\n if (chars) {\n chars = escapeRegExp(stringify(chars))\n return stringify(str).replace(new RegExp(`[${chars}]+$`, 'g'), '')\n }\n return stringify(str).replace(/\\s+$/, '')\n}\n\nexport function split (v: string, arg: string) {\n const arr = stringify(v).split(stringify(arg))\n // align to ruby split, which is the behavior of shopify/liquid\n // see: https://ruby-doc.org/core-2.4.0/String.html#method-i-split\n while (arr.length && arr[arr.length - 1] === '') arr.pop()\n return arr\n}\n\nexport function strip (v: string, chars?: string) {\n if (chars) {\n chars = escapeRegExp(stringify(chars))\n return stringify(v)\n .replace(new RegExp(`^[${chars}]+`, 'g'), '')\n .replace(new RegExp(`[${chars}]+$`, 'g'), '')\n }\n return stringify(v).trim()\n}\n\nexport function strip_newlines (v: string) {\n return stringify(v).replace(/\\r?\\n/gm, '')\n}\n\nexport function capitalize (str: string) {\n str = stringify(str)\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()\n}\n\nexport function replace (v: string, pattern: string, replacement: string) {\n return stringify(v).split(stringify(pattern)).join(replacement)\n}\n\nexport function replace_first (v: string, arg1: string, arg2: string) {\n return stringify(v).replace(stringify(arg1), arg2)\n}\n\nexport function replace_last (v: string, arg1: string, arg2: string) {\n const str = stringify(v)\n const pattern = stringify(arg1)\n const index = str.lastIndexOf(pattern)\n if (index === -1) return str\n const replacement = stringify(arg2)\n return str.substring(0, index) + replacement + str.substring(index + pattern.length)\n}\n\nexport function truncate (v: string, l = 50, o = '...') {\n v = stringify(v)\n if (v.length <= l) return v\n return v.substring(0, l - o.length) + o\n}\n\nexport function truncatewords (v: string, words = 15, o = '...') {\n const arr = stringify(v).split(/\\s+/)\n if (words <= 0) words = 1\n let ret = arr.slice(0, words).join(' ')\n if (arr.length >= words) ret += o\n return ret\n}\n\nexport function normalize_whitespace (v: string) {\n v = stringify(v)\n return v.replace(/\\s+/g, ' ')\n}\n\nexport function number_of_words (input: string, mode?: 'cjk' | 'auto') {\n input = stringify(input).trim()\n if (!input) return 0\n switch (mode) {\n case 'cjk':\n // Count CJK characters and words\n return (input.match(rCJKWord) || []).length + (input.match(rNonCJKWord) || []).length\n case 'auto':\n // Count CJK characters, if none, count words\n return rCJKWord.test(input)\n ? input.match(rCJKWord)!.length + (input.match(rNonCJKWord) || []).length\n : input.split(/\\s+/).length\n default:\n // Count words only\n return input.split(/\\s+/).length\n }\n}\n\nexport function array_to_sentence_string (array: unknown[], connector = 'and') {\n switch (array.length) {\n case 0:\n return ''\n case 1:\n return array[0]\n case 2:\n return `${array[0]} ${connector} ${array[1]}`\n default:\n return `${array.slice(0, -1).join(', ')}, ${connector} ${array[array.length - 1]}`\n }\n}\n","import * as htmlFilters from './html'\nimport * as mathFilters from './math'\nimport * as urlFilters from './url'\nimport * as arrayFilters from './array'\nimport * as dateFilters from './date'\nimport * as stringFilters from './string'\nimport misc from './misc'\nimport { FilterImplOptions } from '../template'\n\nexport const filters: Record = {\n ...htmlFilters,\n ...mathFilters,\n ...urlFilters,\n ...arrayFilters,\n ...dateFilters,\n ...stringFilters,\n ...misc\n}\n","import { Value, Liquid, TopLevelToken, TagToken, Context, Tag } from '..'\nexport default class extends Tag {\n private key: string\n private value: Value\n\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.key = this.tokenizer.readIdentifier().content\n this.tokenizer.assert(this.key, 'expected variable name')\n\n this.tokenizer.skipBlank()\n this.tokenizer.assert(this.tokenizer.peek() === '=', 'expected \"=\"')\n\n this.tokenizer.advance()\n this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid)\n }\n * render (ctx: Context): Generator {\n ctx.bottom()[this.key] = yield this.value.value(ctx, this.liquid.options.lenientIf)\n }\n}\n","import { Hash, ValueToken, Liquid, Tag, evalToken, Emitter, TagToken, TopLevelToken, Context, Template, ParseStream } from '..'\nimport { toEnumerable } from '../util'\nimport { ForloopDrop } from '../drop/forloop-drop'\n\nconst MODIFIERS = ['offset', 'limit', 'reversed']\n\ntype valueof = T[keyof T]\n\nexport default class extends Tag {\n variable: string\n collection: ValueToken\n hash: Hash\n templates: Template[]\n elseTemplates: Template[]\n\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const variable = this.tokenizer.readIdentifier()\n const inStr = this.tokenizer.readIdentifier()\n const collection = this.tokenizer.readValue()\n if (!variable.size() || inStr.content !== 'in' || !collection) {\n throw new Error(`illegal tag: ${token.getText()}`)\n }\n\n this.variable = variable.content\n this.collection = collection\n this.hash = new Hash(this.tokenizer.remaining())\n this.templates = []\n this.elseTemplates = []\n\n let p\n const stream: ParseStream = this.liquid.parser.parseStream(remainTokens)\n .on('start', () => (p = this.templates))\n .on('tag:else', () => (p = this.elseTemplates))\n .on('tag:endfor', () => stream.stop())\n .on('template', (tpl: Template) => p.push(tpl))\n .on('end', () => {\n throw new Error(`tag ${token.getText()} not closed`)\n })\n\n stream.start()\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n let collection = toEnumerable(yield evalToken(this.collection, ctx))\n\n if (!collection.length) {\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n return\n }\n\n const continueKey = 'continue-' + this.variable + '-' + this.collection.getText()\n ctx.push({ continue: ctx.getRegister(continueKey) })\n const hash = yield this.hash.render(ctx)\n ctx.pop()\n\n const modifiers = this.liquid.options.orderedFilterParameters\n ? Object.keys(hash).filter(x => MODIFIERS.includes(x))\n : MODIFIERS.filter(x => hash[x] !== undefined)\n\n collection = modifiers.reduce((collection, modifier: valueof) => {\n if (modifier === 'offset') return offset(collection, hash['offset'])\n if (modifier === 'limit') return limit(collection, hash['limit'])\n return reversed(collection)\n }, collection)\n\n ctx.setRegister(continueKey, (hash['offset'] || 0) + collection.length)\n const scope = { forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) }\n ctx.push(scope)\n for (const item of collection) {\n scope[this.variable] = item\n yield r.renderTemplates(this.templates, ctx, emitter)\n if (emitter['break']) {\n emitter['break'] = false\n break\n }\n emitter['continue'] = false\n scope.forloop.next()\n }\n ctx.pop()\n }\n}\n\nfunction reversed (arr: Array) {\n return [...arr].reverse()\n}\n\nfunction offset (arr: Array, count: number) {\n return arr.slice(count)\n}\n\nfunction limit (arr: Array, count: number) {\n return arr.slice(0, count)\n}\n","import { Liquid, Tag, Template, Context, TagToken, TopLevelToken } from '..'\nimport { evalQuotedToken } from '../render'\nimport { isTagToken } from '../util'\n\nexport default class extends Tag {\n variable: string\n templates: Template[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n this.variable = this.readVariableName()\n\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endcapture') return\n this.templates.push(liquid.parser.parseToken(token, remainTokens))\n }\n throw new Error(`tag ${tagToken.getText()} not closed`)\n }\n * render (ctx: Context): Generator {\n const r = this.liquid.renderer\n const html = yield r.renderTemplates(this.templates, ctx)\n ctx.bottom()[this.variable] = html\n }\n private readVariableName () {\n const word = this.tokenizer.readIdentifier().content\n if (word) return word\n const quoted = this.tokenizer.readQuoted()\n if (quoted) return evalQuotedToken(quoted)\n throw this.tokenizer.error('invalid capture name')\n }\n}\n","import { ValueToken, Liquid, toValue, evalToken, Value, Emitter, TagToken, TopLevelToken, Context, Template, Tag, ParseStream } from '..'\nimport { equals } from '../render'\n\nexport default class extends Tag {\n value: Value\n branches: { values: ValueToken[], templates: Template[] }[] = []\n elseTemplates: Template[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid)\n this.elseTemplates = []\n\n let p: Template[] = []\n let elseCount = 0\n const stream: ParseStream = this.liquid.parser.parseStream(remainTokens)\n .on('tag:when', (token: TagToken) => {\n if (elseCount > 0) {\n return\n }\n\n p = []\n\n const values: ValueToken[] = []\n while (!token.tokenizer.end()) {\n values.push(token.tokenizer.readValueOrThrow())\n token.tokenizer.skipBlank()\n if (token.tokenizer.peek() === ',') {\n token.tokenizer.readTo(',')\n } else {\n token.tokenizer.readTo('or')\n }\n }\n this.branches.push({\n values,\n templates: p\n })\n })\n .on('tag:else', () => {\n elseCount++\n p = this.elseTemplates\n })\n .on('tag:endcase', () => stream.stop())\n .on('template', (tpl: Template) => {\n if (p !== this.elseTemplates || elseCount === 1) {\n p.push(tpl)\n }\n })\n .on('end', () => {\n throw new Error(`tag ${tagToken.getText()} not closed`)\n })\n\n stream.start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n const target = toValue(yield this.value.value(ctx, ctx.opts.lenientIf))\n let branchHit = false\n for (const branch of this.branches) {\n for (const valueToken of branch.values) {\n const value = yield evalToken(valueToken, ctx, ctx.opts.lenientIf)\n if (equals(target, value)) {\n yield r.renderTemplates(branch.templates, ctx, emitter)\n branchHit = true\n break\n }\n }\n }\n if (!branchHit) {\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n }\n }\n}\n","import { Liquid, TopLevelToken, TagToken, Tag } from '..'\nimport { isTagToken } from '../util'\n\nexport default class extends Tag {\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endcomment') return\n }\n throw new Error(`tag ${tagToken.getText()} not closed`)\n }\n render () {}\n}\n","import { __assign } from 'tslib'\nimport { ForloopDrop } from '../drop'\nimport { toEnumerable } from '../util'\nimport { TopLevelToken, assert, Liquid, Token, Template, evalQuotedToken, TypeGuards, Tokenizer, evalToken, Hash, Emitter, TagToken, Context, Tag } from '..'\n\nexport type ParsedFileName = Template[] | Token | string | undefined\n\nexport default class extends Tag {\n private file: ParsedFileName\n private currentFile?: string\n private hash: Hash\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const tokenizer = this.tokenizer\n this.file = parseFilePath(tokenizer, this.liquid)\n this.currentFile = token.file\n while (!tokenizer.end()) {\n tokenizer.skipBlank()\n const begin = tokenizer.p\n const keyword = tokenizer.readIdentifier()\n if (keyword.content === 'with' || keyword.content === 'for') {\n tokenizer.skipBlank()\n // can be normal key/value pair, like \"with: true\"\n if (tokenizer.peek() !== ':') {\n const value = tokenizer.readValue()\n // can be normal key, like \"with,\"\n if (value) {\n const beforeAs = tokenizer.p\n const asStr = tokenizer.readIdentifier()\n let alias\n if (asStr.content === 'as') alias = tokenizer.readIdentifier()\n else tokenizer.p = beforeAs\n\n this[keyword.content] = { value, alias: alias && alias.content }\n tokenizer.skipBlank()\n if (tokenizer.peek() === ',') tokenizer.advance()\n continue // matched!\n }\n }\n }\n /**\n * restore cursor if with/for not matched\n */\n tokenizer.p = begin\n break\n }\n this.hash = new Hash(tokenizer.remaining())\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const { liquid, hash } = this\n const filepath = (yield renderFilePath(this['file'], ctx, liquid)) as string\n assert(filepath, () => `illegal file path \"${filepath}\"`)\n\n const childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables })\n const scope = childCtx.bottom()\n __assign(scope, yield hash.render(ctx))\n if (this['with']) {\n const { value, alias } = this['with']\n scope[alias || filepath] = yield evalToken(value, ctx)\n }\n\n if (this['for']) {\n const { value, alias } = this['for']\n const collection = toEnumerable(yield evalToken(value, ctx))\n scope['forloop'] = new ForloopDrop(collection.length, value.getText(), alias)\n for (const item of collection) {\n scope[alias] = item\n const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])) as Template[]\n yield liquid.renderer.renderTemplates(templates, childCtx, emitter)\n scope['forloop'].next()\n }\n } else {\n const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])) as Template[]\n yield liquid.renderer.renderTemplates(templates, childCtx, emitter)\n }\n }\n}\n\n/**\n * @return null for \"none\",\n * @return Template[] for quoted with tags and/or filters\n * @return Token for expression (not quoted)\n * @throws TypeError if cannot read next token\n */\nexport function parseFilePath (tokenizer: Tokenizer, liquid: Liquid): ParsedFileName {\n if (liquid.options.dynamicPartials) {\n const file = tokenizer.readValue()\n tokenizer.assert(file, 'illegal file path')\n if (file!.getText() === 'none') return\n if (TypeGuards.isQuotedToken(file)) {\n // for filenames like \"files/{{file}}\", eval as liquid template\n const templates = liquid.parse(evalQuotedToken(file))\n return optimize(templates)\n }\n return file\n }\n const tokens = [...tokenizer.readFileNameTemplate(liquid.options)]\n const templates = optimize(liquid.parser.parseTokens(tokens))\n return templates === 'none' ? undefined : templates\n}\n\nfunction optimize (templates: Template[]): string | Template[] {\n // for filenames like \"files/file.liquid\", extract the string directly\n if (templates.length === 1 && TypeGuards.isHTMLToken(templates[0].token)) return templates[0].token.getContent()\n return templates\n}\n\nexport function * renderFilePath (file: ParsedFileName, ctx: Context, liquid: Liquid): IterableIterator {\n if (typeof file === 'string') return file\n if (Array.isArray(file)) return liquid.renderer.renderTemplates(file, ctx)\n return yield evalToken(file, ctx)\n}\n","import { Template, ValueToken, TopLevelToken, Liquid, Tag, assert, evalToken, Hash, Emitter, TagToken, Context } from '..'\nimport { BlockMode, Scope } from '../context'\nimport { parseFilePath, renderFilePath } from './render'\n\nexport default class extends Tag {\n private withVar?: ValueToken\n private hash: Hash\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const { tokenizer } = token\n this['file'] = parseFilePath(tokenizer, this.liquid)\n this['currentFile'] = token.file\n\n const begin = tokenizer.p\n const withStr = tokenizer.readIdentifier()\n if (withStr.content === 'with') {\n tokenizer.skipBlank()\n if (tokenizer.peek() !== ':') {\n this.withVar = tokenizer.readValue()\n } else tokenizer.p = begin\n } else tokenizer.p = begin\n\n this.hash = new Hash(tokenizer.remaining(), this.liquid.options.jekyllInclude)\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const { liquid, hash, withVar } = this\n const { renderer } = liquid\n const filepath = (yield renderFilePath(this['file'], ctx, liquid)) as string\n assert(filepath, () => `illegal file path \"${filepath}\"`)\n\n const saved = ctx.saveRegister('blocks', 'blockMode')\n ctx.setRegister('blocks', {})\n ctx.setRegister('blockMode', BlockMode.OUTPUT)\n const scope = (yield hash.render(ctx)) as Scope\n if (withVar) scope[filepath] = yield evalToken(withVar, ctx)\n const templates = (yield liquid._parsePartialFile(filepath, ctx.sync, this['currentFile'])) as Template[]\n ctx.push(ctx.opts.jekyllInclude ? { include: scope } : scope)\n yield renderer.renderTemplates(templates, ctx, emitter)\n ctx.pop()\n ctx.restoreRegister(saved)\n }\n}\n","import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..'\nimport { isNumber, stringify } from '../util'\n\nexport default class extends Tag {\n private variable: string\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.variable = this.tokenizer.readIdentifier().content\n }\n render (context: Context, emitter: Emitter) {\n const scope = context.environments\n if (!isNumber(scope[this.variable])) {\n scope[this.variable] = 0\n }\n emitter.write(stringify(--scope[this.variable]))\n }\n}\n","import { TopLevelToken, Liquid, ValueToken, evalToken, Emitter, TagToken, Context, Tag } from '..'\n\nexport default class extends Tag {\n private candidates: ValueToken[] = []\n private group?: ValueToken\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const group = this.tokenizer.readValue()\n this.tokenizer.skipBlank()\n\n if (group) {\n if (this.tokenizer.peek() === ':') {\n this.group = group\n this.tokenizer.advance()\n } else this.candidates.push(group)\n }\n\n while (!this.tokenizer.end()) {\n const value = this.tokenizer.readValue()\n if (value) this.candidates.push(value)\n this.tokenizer.readTo(',')\n }\n this.tokenizer.assert(this.candidates.length, () => `empty candidates: \"${token.getText()}\"`)\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const group = (yield evalToken(this.group, ctx)) as ValueToken\n const fingerprint = `cycle:${group}:` + this.candidates.join(',')\n const groups = ctx.getRegister('cycle')\n let idx = groups[fingerprint]\n\n if (idx === undefined) {\n idx = groups[fingerprint] = 0\n }\n\n const candidate = this.candidates[idx]\n idx = (idx + 1) % this.candidates.length\n groups[fingerprint] = idx\n return yield evalToken(candidate, ctx)\n }\n}\n","import { Liquid, Tag, Value, Emitter, isTruthy, TagToken, TopLevelToken, Context, Template } from '..'\n\nexport default class extends Tag {\n branches: { value: Value, templates: Template[] }[] = []\n elseTemplates: Template[] = []\n\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n let p: Template[] = []\n let elseCount = 0\n liquid.parser.parseStream(remainTokens)\n .on('start', () => this.branches.push({\n value: new Value(tagToken.args, this.liquid),\n templates: (p = [])\n }))\n .on('tag:elsif', (token: TagToken) => {\n if (elseCount > 0) {\n p = []\n return\n }\n this.branches.push({\n value: new Value(token.args, this.liquid),\n templates: (p = [])\n })\n })\n .on('tag:else', () => {\n elseCount++\n p = this.elseTemplates\n })\n .on('tag:endif', function () { this.stop() })\n .on('template', (tpl: Template) => {\n if (p !== this.elseTemplates || elseCount === 1) {\n p.push(tpl)\n }\n })\n .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`) })\n .start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n\n for (const { value, templates } of this.branches) {\n const v = yield value.value(ctx, ctx.opts.lenientIf)\n if (isTruthy(v, ctx)) {\n yield r.renderTemplates(templates, ctx, emitter)\n return\n }\n }\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n }\n}\n","import { isNumber, stringify } from '../util'\nimport { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..'\n\nexport default class extends Tag {\n private variable: string\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.variable = this.tokenizer.readIdentifier().content\n }\n render (context: Context, emitter: Emitter) {\n const scope = context.environments\n if (!isNumber(scope[this.variable])) {\n scope[this.variable] = 0\n }\n const val = scope[this.variable]\n scope[this.variable]++\n emitter.write(stringify(val))\n }\n}\n","import { Scope, Template, Liquid, Tag, assert, Emitter, Hash, TagToken, TopLevelToken, Context } from '..'\nimport { BlockMode } from '../context'\nimport { parseFilePath, renderFilePath, ParsedFileName } from './render'\nimport { BlankDrop } from '../drop'\n\nexport default class extends Tag {\n args: Hash\n templates: Template[]\n file?: ParsedFileName\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.file = parseFilePath(this.tokenizer, this.liquid)\n this['currentFile'] = token.file\n this.args = new Hash(this.tokenizer.remaining())\n this.templates = this.liquid.parser.parseTokens(remainTokens)\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n const { liquid, args, file } = this\n const { renderer } = liquid\n if (file === undefined) {\n ctx.setRegister('blockMode', BlockMode.OUTPUT)\n yield renderer.renderTemplates(this.templates, ctx, emitter)\n return\n }\n const filepath = (yield renderFilePath(this.file, ctx, liquid)) as string\n assert(filepath, () => `illegal file path \"${filepath}\"`)\n const templates = (yield liquid._parseLayoutFile(filepath, ctx.sync, this['currentFile'])) as Template[]\n\n // render remaining contents and store rendered results\n ctx.setRegister('blockMode', BlockMode.STORE)\n const html = yield renderer.renderTemplates(this.templates, ctx)\n const blocks = ctx.getRegister('blocks')\n\n // set whole content to anonymous block if anonymous doesn't specified\n if (blocks[''] === undefined) blocks[''] = (parent: BlankDrop, emitter: Emitter) => emitter.write(html)\n ctx.setRegister('blockMode', BlockMode.OUTPUT)\n\n // render the layout file use stored blocks\n ctx.push((yield args.render(ctx)) as Scope)\n yield renderer.renderTemplates(templates, ctx, emitter)\n ctx.pop()\n }\n}\n","import { BlockMode } from '../context'\nimport { isTagToken } from '../util'\nimport { BlockDrop } from '../drop'\nimport { Liquid, TagToken, TopLevelToken, Template, Context, Emitter, Tag } from '..'\n\nexport default class extends Tag {\n block: string\n templates: Template[] = []\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const match = /\\w+/.exec(token.args)\n this.block = match ? match[0] : ''\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endblock') return\n const template = liquid.parser.parseToken(token, remainTokens)\n this.templates.push(template)\n }\n throw new Error(`tag ${token.getText()} not closed`)\n }\n\n * render (ctx: Context, emitter: Emitter) {\n const blockRender = this.getBlockRender(ctx)\n if (ctx.getRegister('blockMode') === BlockMode.STORE) {\n ctx.getRegister('blocks')[this.block] = blockRender\n } else {\n yield blockRender(new BlockDrop(), emitter)\n }\n }\n\n private getBlockRender (ctx: Context) {\n const { liquid, templates } = this\n const renderChild = ctx.getRegister('blocks')[this.block]\n const renderCurrent = function * (superBlock: BlockDrop, emitter: Emitter) {\n // add {{ block.super }} support when rendering\n ctx.push({ block: superBlock })\n yield liquid.renderer.renderTemplates(templates, ctx, emitter)\n ctx.pop()\n }\n return renderChild\n ? (superBlock: BlockDrop, emitter: Emitter) => renderChild(new BlockDrop(() => renderCurrent(superBlock, emitter)), emitter)\n : renderCurrent\n }\n}\n","import { Liquid, TagToken, TopLevelToken, Tag } from '..'\nimport { isTagToken } from '../util'\n\nexport default class extends Tag {\n private tokens: TopLevelToken[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n while (remainTokens.length) {\n const token = remainTokens.shift()!\n if (isTagToken(token) && token.name === 'endraw') return\n this.tokens.push(token)\n }\n throw new Error(`tag ${tagToken.getText()} not closed`)\n }\n render () {\n return this.tokens.map((token: TopLevelToken) => token.getText()).join('')\n }\n}\n","import { ForloopDrop } from './forloop-drop'\n\nexport class TablerowloopDrop extends ForloopDrop {\n private cols: number\n public constructor (length: number, cols: number, collection: string, variable: string) {\n super(length, collection, variable)\n this.length = length\n this.cols = cols\n }\n public row () {\n return Math.floor(this.i / this.cols) + 1\n }\n public col0 () {\n return (this.i % this.cols)\n }\n public col () {\n return this.col0() + 1\n }\n public col_first () { // eslint-disable-line\n return this.col0() === 0\n }\n public col_last () { // eslint-disable-line\n return this.col() === this.cols\n }\n}\n","import { toEnumerable } from '../util'\nimport { ValueToken, Liquid, Tag, evalToken, Emitter, Hash, TagToken, TopLevelToken, Context, Template, ParseStream } from '..'\nimport { TablerowloopDrop } from '../drop/tablerowloop-drop'\n\nexport default class extends Tag {\n variable: string\n args: Hash\n templates: Template[]\n collection: ValueToken\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n const variable = this.tokenizer.readIdentifier()\n this.tokenizer.skipBlank()\n\n const predicate = this.tokenizer.readIdentifier()\n const collectionToken = this.tokenizer.readValue()\n if (predicate.content !== 'in' || !collectionToken) {\n throw new Error(`illegal tag: ${tagToken.getText()}`)\n }\n\n this.variable = variable.content\n this.collection = collectionToken\n this.args = new Hash(this.tokenizer.remaining())\n this.templates = []\n\n let p\n const stream: ParseStream = this.liquid.parser.parseStream(remainTokens)\n .on('start', () => (p = this.templates))\n .on('tag:endtablerow', () => stream.stop())\n .on('template', (tpl: Template) => p.push(tpl))\n .on('end', () => {\n throw new Error(`tag ${tagToken.getText()} not closed`)\n })\n\n stream.start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n let collection = toEnumerable(yield evalToken(this.collection, ctx))\n const args = (yield this.args.render(ctx)) as Record\n const offset = args.offset || 0\n const limit = (args.limit === undefined) ? collection.length : args.limit\n\n collection = collection.slice(offset, offset + limit)\n const cols = args.cols || collection.length\n\n const r = this.liquid.renderer\n const tablerowloop = new TablerowloopDrop(collection.length, cols, this.collection.getText(), this.variable)\n const scope = { tablerowloop }\n ctx.push(scope)\n\n for (let idx = 0; idx < collection.length; idx++, tablerowloop.next()) {\n scope[this.variable] = collection[idx]\n if (tablerowloop.col0() === 0) {\n if (tablerowloop.row() !== 1) emitter.write('')\n emitter.write(``)\n }\n emitter.write(``)\n yield r.renderTemplates(this.templates, ctx, emitter)\n emitter.write('')\n }\n if (collection.length) emitter.write('')\n ctx.pop()\n }\n}\n","import { Liquid, Tag, Value, TopLevelToken, Template, Emitter, isTruthy, isFalsy, Context, TagToken } from '..'\n\nexport default class extends Tag {\n branches: { value: Value, test: (val: any, ctx: Context) => boolean, templates: Template[] }[] = []\n elseTemplates: Template[] = []\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n let p: Template[] = []\n let elseCount = 0\n this.liquid.parser.parseStream(remainTokens)\n .on('start', () => this.branches.push({\n value: new Value(tagToken.args, this.liquid),\n test: isFalsy,\n templates: (p = [])\n }))\n .on('tag:elsif', (token: TagToken) => {\n if (elseCount > 0) {\n p = []\n return\n }\n this.branches.push({\n value: new Value(token.args, this.liquid),\n test: isTruthy,\n templates: (p = [])\n })\n })\n .on('tag:else', () => {\n elseCount++\n p = this.elseTemplates\n })\n .on('tag:endunless', function () { this.stop() })\n .on('template', (tpl: Template) => {\n if (p !== this.elseTemplates || elseCount === 1) {\n p.push(tpl)\n }\n })\n .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`) })\n .start()\n }\n\n * render (ctx: Context, emitter: Emitter): Generator {\n const r = this.liquid.renderer\n\n for (const { value, test, templates } of this.branches) {\n const v = yield value.value(ctx, ctx.opts.lenientIf)\n if (test(v, ctx)) {\n yield r.renderTemplates(templates, ctx, emitter)\n return\n }\n }\n\n yield r.renderTemplates(this.elseTemplates, ctx, emitter)\n }\n}\n","import { Context, Emitter, Tag } from '..'\n\nexport default class extends Tag {\n render (ctx: Context, emitter: Emitter) {\n emitter['break'] = true\n }\n}\n","import { Tag, Emitter, Context } from '..'\n\nexport default class extends Tag {\n render (ctx: Context, emitter: Emitter) {\n emitter['continue'] = true\n }\n}\n","import { Liquid, TopLevelToken, Emitter, Value, TagToken, Context, Tag } from '..'\n\nexport default class extends Tag {\n private value?: Value\n\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n this.tokenizer.skipBlank()\n if (!this.tokenizer.end()) {\n this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid)\n }\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n if (!this.value) return\n const val = yield this.value.value(ctx, false)\n emitter.write(val)\n }\n}\n","import { Template, Emitter, Liquid, TopLevelToken, TagToken, Context, Tag } from '..'\n\nexport default class extends Tag {\n templates: Template[]\n constructor (token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(token, remainTokens, liquid)\n const tokens = this.tokenizer.readLiquidTagTokens(this.liquid.options)\n this.templates = this.liquid.parser.parseTokens(tokens)\n }\n * render (ctx: Context, emitter: Emitter): Generator {\n yield this.liquid.renderer.renderTemplates(this.templates, ctx, emitter)\n }\n}\n","import { TagToken, Liquid, TopLevelToken, Tag } from '..'\n\nexport default class extends Tag {\n constructor (tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid) {\n super(tagToken, remainTokens, liquid)\n if (tagToken.args.search(/\\n\\s*[^#\\s]/g) !== -1) {\n throw new Error('every line of an inline comment must start with a \\'#\\' character')\n }\n }\n render () { }\n}\n","import AssignTag from './assign'\nimport ForTag from './for'\nimport CaptureTag from './capture'\nimport CaseTag from './case'\nimport CommentTag from './comment'\nimport IncludeTag from './include'\nimport RenderTag from './render'\nimport DecrementTag from './decrement'\nimport CycleTag from './cycle'\nimport IfTag from './if'\nimport IncrementTag from './increment'\nimport LayoutTag from './layout'\nimport BlockTag from './block'\nimport RawTag from './raw'\nimport TablerowTag from './tablerow'\nimport UnlessTag from './unless'\nimport BreakTag from './break'\nimport ContinueTag from './continue'\nimport EchoTag from './echo'\nimport LiquidTag from './liquid'\nimport InlineCommentTag from './inline-comment'\nimport type { TagClass } from '../template/tag'\n\nexport const tags: Record = {\n assign: AssignTag,\n 'for': ForTag,\n capture: CaptureTag,\n 'case': CaseTag,\n comment: CommentTag,\n include: IncludeTag,\n render: RenderTag,\n decrement: DecrementTag,\n increment: IncrementTag,\n cycle: CycleTag,\n 'if': IfTag,\n layout: LayoutTag,\n block: BlockTag,\n raw: RawTag,\n tablerow: TablerowTag,\n unless: UnlessTag,\n 'break': BreakTag,\n 'continue': ContinueTag,\n echo: EchoTag,\n liquid: LiquidTag,\n '#': InlineCommentTag\n}\n\nexport { AssignTag, ForTag, CaptureTag, CaseTag, CommentTag, IncludeTag, RenderTag, DecrementTag, IncrementTag, CycleTag, IfTag, LayoutTag, BlockTag, RawTag, TablerowTag, UnlessTag, BreakTag, ContinueTag, EchoTag, LiquidTag, InlineCommentTag }\n","import { Context } from './context'\nimport { toPromise, toValueSync, isFunction, forOwn } from './util'\nimport { TagClass, createTagClass, TagImplOptions, FilterImplOptions, Template, Value } from './template'\nimport { LookupType } from './fs/loader'\nimport { Render } from './render'\nimport { Parser } from './parser'\nimport { tags } from './tags'\nimport { filters } from './filters'\nimport { LiquidOptions, normalizeDirectoryList, NormalizedFullOptions, normalize, RenderOptions, RenderFileOptions } from './liquid-options'\n\nexport class Liquid {\n public readonly options: NormalizedFullOptions\n public readonly renderer = new Render()\n public readonly parser: Parser\n public readonly filters: Record = {}\n public readonly tags: Record = {}\n\n public constructor (opts: LiquidOptions = {}) {\n this.options = normalize(opts)\n this.parser = new Parser(this)\n forOwn(tags, (conf: TagClass, name: string) => this.registerTag(name, conf))\n forOwn(filters, (handler: FilterImplOptions, name: string) => this.registerFilter(name, handler))\n }\n public parse (html: string, filepath?: string): Template[] {\n return this.parser.parse(html, filepath)\n }\n\n public _render (tpl: Template[], scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator {\n const ctx = scope instanceof Context ? scope : new Context(scope, this.options, renderOptions)\n return this.renderer.renderTemplates(tpl, ctx)\n }\n public async render (tpl: Template[], scope?: object, renderOptions?: RenderOptions): Promise {\n return toPromise(this._render(tpl, scope, { ...renderOptions, sync: false }))\n }\n public renderSync (tpl: Template[], scope?: object, renderOptions?: RenderOptions): any {\n return toValueSync(this._render(tpl, scope, { ...renderOptions, sync: true }))\n }\n public renderToNodeStream (tpl: Template[], scope?: object, renderOptions: RenderOptions = {}): NodeJS.ReadableStream {\n const ctx = new Context(scope, this.options, renderOptions)\n return this.renderer.renderTemplatesToNodeStream(tpl, ctx)\n }\n\n public _parseAndRender (html: string, scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator {\n const tpl = this.parse(html)\n return this._render(tpl, scope, renderOptions)\n }\n public async parseAndRender (html: string, scope?: Context | object, renderOptions?: RenderOptions): Promise {\n return toPromise(this._parseAndRender(html, scope, { ...renderOptions, sync: false }))\n }\n public parseAndRenderSync (html: string, scope?: Context | object, renderOptions?: RenderOptions): any {\n return toValueSync(this._parseAndRender(html, scope, { ...renderOptions, sync: true }))\n }\n\n public _parsePartialFile (file: string, sync?: boolean, currentFile?: string) {\n return this.parser.parseFile(file, sync, LookupType.Partials, currentFile)\n }\n public _parseLayoutFile (file: string, sync?: boolean, currentFile?: string) {\n return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile)\n }\n public _parseFile (file: string, sync?: boolean, lookupType?: LookupType, currentFile?: string): Generator {\n return this.parser.parseFile(file, sync, lookupType, currentFile)\n }\n public async parseFile (file: string, lookupType?: LookupType): Promise {\n return toPromise(this.parser.parseFile(file, false, lookupType))\n }\n public parseFileSync (file: string, lookupType?: LookupType): Template[] {\n return toValueSync(this.parser.parseFile(file, true, lookupType))\n }\n public * _renderFile (file: string, ctx: Context | object | undefined, renderFileOptions: RenderFileOptions): Generator {\n const templates = (yield this._parseFile(file, renderFileOptions.sync, renderFileOptions.lookupType)) as Template[]\n return yield this._render(templates, ctx, renderFileOptions)\n }\n public async renderFile (file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions) {\n return toPromise(this._renderFile(file, ctx, { ...renderFileOptions, sync: false }))\n }\n public renderFileSync (file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions) {\n return toValueSync(this._renderFile(file, ctx, { ...renderFileOptions, sync: true }))\n }\n public async renderFileToNodeStream (file: string, scope?: object, renderOptions?: RenderOptions) {\n const templates = await this.parseFile(file)\n return this.renderToNodeStream(templates, scope, renderOptions)\n }\n\n public _evalValue (str: string, scope?: object | Context): IterableIterator {\n const value = new Value(str, this)\n const ctx = scope instanceof Context ? scope : new Context(scope, this.options)\n return value.value(ctx)\n }\n public async evalValue (str: string, scope?: object | Context): Promise {\n return toPromise(this._evalValue(str, scope))\n }\n public evalValueSync (str: string, scope?: object | Context): any {\n return toValueSync(this._evalValue(str, scope))\n }\n\n public registerFilter (name: string, filter: FilterImplOptions) {\n this.filters[name] = filter\n }\n public registerTag (name: string, tag: TagClass | TagImplOptions) {\n this.tags[name] = isFunction(tag) ? tag : createTagClass(tag)\n }\n public plugin (plugin: (this: Liquid, L: typeof Liquid) => void) {\n return plugin.call(this, Liquid)\n }\n public express () {\n const self = this // eslint-disable-line\n let firstCall = true\n\n return function (this: any, filePath: string, ctx: object, callback: (err: Error | null, rendered: string) => void) {\n if (firstCall) {\n firstCall = false\n const dirs = normalizeDirectoryList(this.root)\n self.options.root.unshift(...dirs)\n self.options.layouts.unshift(...dirs)\n self.options.partials.unshift(...dirs)\n }\n self.renderFile(filePath, ctx).then(html => callback(null, html) as any, callback as any)\n }\n }\n}\n","/* istanbul ignore file */\nexport const version = '[VI]{version}[/VI]'\nexport * as TypeGuards from './util/type-guards'\nexport { toValue, TimezoneDate, createTrie, Trie, toPromise, toValueSync, assert, LiquidError, ParseError, RenderError, UndefinedVariableError, TokenizationError, AssertionError } from './util'\nexport { Drop } from './drop'\nexport { Emitter } from './emitters'\nexport { defaultOperators, Operators, evalToken, evalQuotedToken, Expression, isFalsy, isTruthy } from './render'\nexport { Context, Scope } from './context'\nexport { Value, Hash, Template, FilterImplOptions, Tag, Filter, Output } from './template'\nexport { Token, TopLevelToken, TagToken, ValueToken } from './tokens'\nexport { TokenKind, Tokenizer, ParseStream } from './parser'\nexport { filters } from './filters'\nexport * from './tags'\nexport { defaultOptions, LiquidOptions } from './liquid-options'\nexport { FS } from './fs'\nexport { Liquid } from './liquid'\n"],"names":["toString","_\r\n .range","_.padStart","TokenKind","last","arrayLast","TypeGuards.isQuotedToken","TypeGuards.isHTMLToken","AssignTag","ForTag","CaptureTag","CaseTag","CommentTag","IncludeTag","RenderTag","DecrementTag","IncrementTag","CycleTag","IfTag","LayoutTag","BlockTag","RawTag","TablerowTag","UnlessTag","BreakTag","ContinueTag","EchoTag","LiquidTag","InlineCommentTag"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGE,eACS,IAAe,EACf,KAAa,EACb,KAAa,EACb,GAAW,EACX,IAAa;YAJb,SAAI,GAAJ,IAAI,CAAW;YACf,UAAK,GAAL,KAAK,CAAQ;YACb,UAAK,GAAL,KAAK,CAAQ;YACb,QAAG,GAAH,GAAG,CAAQ;YACX,SAAI,GAAJ,IAAI,CAAS;SAClB;QACG,uBAAO,GAAd;YACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;SAC9C;QACM,2BAAW,GAAlB;YACM,IAAA,KAAA,OAAa,CAAC,CAAC,EAAE,CAAC,CAAC,IAAA,EAAlB,GAAG,QAAA,EAAE,GAAG,QAAU,CAAA;YAC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CAAC,GAAG,CAAC,CAAA;SAC9D;QACM,uBAAM,GAAb,UAAe,MAAgD;YAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;SACjC;QACM,wBAAO,GAAd;YACE,IAAM,IAAI,GAAG,IAAI,CAAA;YACjB,IAAI,SAAS,GAAG,IAAI,CAAA;YAEpB,OAAO,UAAqB,QAAgB,EAAE,GAAW,EAAE,QAAuD;;gBAChH,IAAI,SAAS,EAAE;oBACb,SAAS,GAAG,KAAK,CAAA;oBACjB,IAAM,IAAI,GAAG,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;oBAC9C,CAAA,KAAA,IAAI,CAAC,OAAO,CAAC,IAAI,EAAC,OAAO,oCAAI,IAAI,WAAC;oBAClC,CAAA,KAAA,IAAI,CAAC,OAAO,CAAC,OAAO,EAAC,OAAO,oCAAI,IAAI,WAAC;oBACrC,CAAA,KAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAC,OAAO,oCAAI,IAAI,WAAC;iBACvC;gBACD,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAQ,GAAA,EAAE,QAAe,CAAC,CAAA;aAC1F,CAAA;SACF;QACH,aAAC;IAAD,CAAC;;ICvHD;AACA,QAAa,OAAO,GAAG,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/liquidjs/dist/liquid.d.ts b/node_modules/liquidjs/dist/liquid.d.ts new file mode 100644 index 0000000..d8e3152 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid.d.ts @@ -0,0 +1,39 @@ +/// +import { Context } from './context'; +import { TagClass, TagImplOptions, FilterImplOptions, Template } from './template'; +import { LookupType } from './fs/loader'; +import { Render } from './render'; +import { Parser } from './parser'; +import { LiquidOptions, NormalizedFullOptions, RenderOptions, RenderFileOptions } from './liquid-options'; +export declare class Liquid { + readonly options: NormalizedFullOptions; + readonly renderer: Render; + readonly parser: Parser; + readonly filters: Record; + readonly tags: Record; + constructor(opts?: LiquidOptions); + parse(html: string, filepath?: string): Template[]; + _render(tpl: Template[], scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator; + render(tpl: Template[], scope?: object, renderOptions?: RenderOptions): Promise; + renderSync(tpl: Template[], scope?: object, renderOptions?: RenderOptions): any; + renderToNodeStream(tpl: Template[], scope?: object, renderOptions?: RenderOptions): NodeJS.ReadableStream; + _parseAndRender(html: string, scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator; + parseAndRender(html: string, scope?: Context | object, renderOptions?: RenderOptions): Promise; + parseAndRenderSync(html: string, scope?: Context | object, renderOptions?: RenderOptions): any; + _parsePartialFile(file: string, sync?: boolean, currentFile?: string): Generator; + _parseLayoutFile(file: string, sync?: boolean, currentFile?: string): Generator; + _parseFile(file: string, sync?: boolean, lookupType?: LookupType, currentFile?: string): Generator; + parseFile(file: string, lookupType?: LookupType): Promise; + parseFileSync(file: string, lookupType?: LookupType): Template[]; + _renderFile(file: string, ctx: Context | object | undefined, renderFileOptions: RenderFileOptions): Generator; + renderFile(file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions): Promise; + renderFileSync(file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions): any; + renderFileToNodeStream(file: string, scope?: object, renderOptions?: RenderOptions): Promise; + _evalValue(str: string, scope?: object | Context): IterableIterator; + evalValue(str: string, scope?: object | Context): Promise; + evalValueSync(str: string, scope?: object | Context): any; + registerFilter(name: string, filter: FilterImplOptions): void; + registerTag(name: string, tag: TagClass | TagImplOptions): void; + plugin(plugin: (this: Liquid, L: typeof Liquid) => void): void; + express(): (this: any, filePath: string, ctx: object, callback: (err: Error | null, rendered: string) => void) => void; +} diff --git a/node_modules/liquidjs/dist/liquid.node.cjs.js b/node_modules/liquidjs/dist/liquid.node.cjs.js new file mode 100644 index 0000000..b03ee90 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid.node.cjs.js @@ -0,0 +1,4084 @@ +/* + * liquidjs@10.14.0, https://github.com/harttle/liquidjs + * (c) 2016-2024 harttle + * Released under the MIT License. + */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var stream = require('stream'); +var path = require('path'); +var fs$1 = require('fs'); + +class Token { + constructor(kind, input, begin, end, file) { + this.kind = kind; + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + } + getText() { + return this.input.slice(this.begin, this.end); + } + getPosition() { + let [row, col] = [1, 1]; + for (let i = 0; i < this.begin; i++) { + if (this.input[i] === '\n') { + row++; + col = 1; + } + else + col++; + } + return [row, col]; + } + size() { + return this.end - this.begin; + } +} + +class Drop { + liquidMethodMissing(key) { + return undefined; + } +} + +const toString$1 = Object.prototype.toString; +const toLowerCase = String.prototype.toLowerCase; +const hasOwnProperty = Object.hasOwnProperty; +function isString(value) { + return typeof value === 'string'; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function isFunction(value) { + return typeof value === 'function'; +} +function isPromise(val) { + return val && isFunction(val.then); +} +function isIterator(val) { + return val && isFunction(val.next) && isFunction(val.throw) && isFunction(val.return); +} +function escapeRegex(str) { + return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); +} +function promisify(fn) { + return function (...args) { + return new Promise((resolve, reject) => { + fn(...args, (err, result) => { + err ? reject(err) : resolve(result); + }); + }); + }; +} +function stringify(value) { + value = toValue(value); + if (isString(value)) + return value; + if (isNil(value)) + return ''; + if (isArray(value)) + return value.map(x => stringify(x)).join(''); + return String(value); +} +function toEnumerable(val) { + val = toValue(val); + if (isArray(val)) + return val; + if (isString(val) && val.length > 0) + return [val]; + if (isIterable(val)) + return Array.from(val); + if (isObject(val)) + return Object.keys(val).map((key) => [key, val[key]]); + return []; +} +function toArray(val) { + val = toValue(val); + if (isNil(val)) + return []; + if (isArray(val)) + return val; + return [val]; +} +function toValue(value) { + return (value instanceof Drop && isFunction(value.valueOf)) ? value.valueOf() : value; +} +function isNumber(value) { + return typeof value === 'number'; +} +function toLiquid(value) { + if (value && isFunction(value.toLiquid)) + return toLiquid(value.toLiquid()); + return value; +} +function isNil(value) { + return value == null; +} +function isUndefined(value) { + return value === undefined; +} +function isArray(value) { + // be compatible with IE 8 + return toString$1.call(value) === '[object Array]'; +} +function isIterable(value) { + return isObject(value) && Symbol.iterator in value; +} +/* + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * The iteratee is invoked with three arguments: (value, key, object). + * Iteratee functions may exit iteration early by explicitly returning false. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @return {Object} Returns object. + */ +function forOwn(obj, iteratee) { + obj = obj || {}; + for (const k in obj) { + if (hasOwnProperty.call(obj, k)) { + if (iteratee(obj[k], k, obj) === false) + break; + } + } + return obj; +} +function last(arr) { + return arr[arr.length - 1]; +} +/* + * Checks if value is the language type of Object. + * (e.g. arrays, functions, objects, regexes, new Number(0), and new String('')) + * @param {any} value The value to check. + * @return {Boolean} Returns true if value is an object, else false. + */ +function isObject(value) { + const type = typeof value; + return value !== null && (type === 'object' || type === 'function'); +} +function range(start, stop, step = 1) { + const arr = []; + for (let i = start; i < stop; i += step) { + arr.push(i); + } + return arr; +} +function padStart(str, length, ch = ' ') { + return pad(str, length, ch, (str, ch) => ch + str); +} +function padEnd(str, length, ch = ' ') { + return pad(str, length, ch, (str, ch) => str + ch); +} +function pad(str, length, ch, add) { + str = String(str); + let n = length - str.length; + while (n-- > 0) + str = add(str, ch); + return str; +} +function identify(val) { + return val; +} +function changeCase(str) { + const hasLowerCase = [...str].some(ch => ch >= 'a' && ch <= 'z'); + return hasLowerCase ? str.toUpperCase() : str.toLowerCase(); +} +function ellipsis(str, N) { + return str.length > N ? str.slice(0, N - 3) + '...' : str; +} +// compare string in case-insensitive way, undefined values to the tail +function caseInsensitiveCompare(a, b) { + if (a == null && b == null) + return 0; + if (a == null) + return 1; + if (b == null) + return -1; + a = toLowerCase.call(a); + b = toLowerCase.call(b); + if (a < b) + return -1; + if (a > b) + return 1; + return 0; +} +function argumentsToValue(fn) { + return (...args) => fn(...args.map(toValue)); +} +function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +} + +/** + * targeting ES5, extends Error won't create a proper prototype chain, need a trait to keep track of classes + */ +const TRAIT = '__liquidClass__'; +class LiquidError extends Error { + constructor(err, token) { + /** + * note: for ES5 targeting, `this` will be replaced by return value of Error(), + * thus everything on `this` will be lost, avoid calling `LiquidError` methods here + */ + super(typeof err === 'string' ? err : err.message); + this.context = ''; + if (typeof err !== 'string') + Object.defineProperty(this, 'originalError', { value: err, enumerable: false }); + Object.defineProperty(this, 'token', { value: token, enumerable: false }); + Object.defineProperty(this, TRAIT, { value: 'LiquidError', enumerable: false }); + } + update() { + Object.defineProperty(this, 'context', { value: mkContext(this.token), enumerable: false }); + this.message = mkMessage(this.message, this.token); + this.stack = this.message + '\n' + this.context + + '\n' + this.stack; + if (this.originalError) + this.stack += '\nFrom ' + this.originalError.stack; + } + static is(obj) { + return obj?.[TRAIT] === 'LiquidError'; + } +} +class TokenizationError extends LiquidError { + constructor(message, token) { + super(message, token); + this.name = 'TokenizationError'; + super.update(); + } +} +class ParseError extends LiquidError { + constructor(err, token) { + super(err, token); + this.name = 'ParseError'; + this.message = err.message; + super.update(); + } +} +class RenderError extends LiquidError { + constructor(err, tpl) { + super(err, tpl.token); + this.name = 'RenderError'; + this.message = err.message; + super.update(); + } + static is(obj) { + return obj.name === 'RenderError'; + } +} +class LiquidErrors extends LiquidError { + constructor(errors) { + super(errors[0], errors[0].token); + this.errors = errors; + this.name = 'LiquidErrors'; + const s = errors.length > 1 ? 's' : ''; + this.message = `${errors.length} error${s} found`; + super.update(); + } + static is(obj) { + return obj.name === 'LiquidErrors'; + } +} +class UndefinedVariableError extends LiquidError { + constructor(err, token) { + super(err, token); + this.name = 'UndefinedVariableError'; + this.message = err.message; + super.update(); + } +} +// only used internally; raised where we don't have token information, +// so it can't be an UndefinedVariableError. +class InternalUndefinedVariableError extends Error { + constructor(variableName) { + super(`undefined variable: ${variableName}`); + this.name = 'InternalUndefinedVariableError'; + this.variableName = variableName; + } +} +class AssertionError extends Error { + constructor(message) { + super(message); + this.name = 'AssertionError'; + this.message = message + ''; + } +} +function mkContext(token) { + const [line, col] = token.getPosition(); + const lines = token.input.split('\n'); + const begin = Math.max(line - 2, 1); + const end = Math.min(line + 3, lines.length); + const context = range(begin, end + 1) + .map(lineNumber => { + const rowIndicator = (lineNumber === line) ? '>> ' : ' '; + const num = padStart(String(lineNumber), String(end).length); + let text = `${rowIndicator}${num}| `; + const colIndicator = lineNumber === line + ? '\n' + padStart('^', col + text.length) + : ''; + text += lines[lineNumber - 1]; + text += colIndicator; + return text; + }) + .join('\n'); + return context; +} +function mkMessage(msg, token) { + if (token.file) + msg += `, file:${token.file}`; + const [line, col] = token.getPosition(); + msg += `, line:${line}, col:${col}`; + return msg; +} + +// **DO NOT CHANGE THIS FILE** +// +// This file is generated by bin/character-gen.js +// bitmask character types to boost performance +const TYPES = [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 4, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 8, 0, 0, 0, 0, 8, 0, 0, 0, 64, 0, 65, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]; +const WORD = 1; +const BLANK = 4; +const QUOTE = 8; +const INLINE_BLANK = 16; +const NUMBER = 32; +const SIGN = 64; +const PUNCTUATION = 128; +function isWord(char) { + const code = char.charCodeAt(0); + return code >= 128 ? !TYPES[code] : !!(TYPES[code] & WORD); +} +TYPES[160] = TYPES[5760] = TYPES[6158] = TYPES[8192] = TYPES[8193] = TYPES[8194] = TYPES[8195] = TYPES[8196] = TYPES[8197] = TYPES[8198] = TYPES[8199] = TYPES[8200] = TYPES[8201] = TYPES[8202] = TYPES[8232] = TYPES[8233] = TYPES[8239] = TYPES[8287] = TYPES[12288] = BLANK; +TYPES[8220] = TYPES[8221] = PUNCTUATION; + +function assert(predicate, message) { + if (!predicate) { + const msg = typeof message === 'function' + ? message() + : (message || `expect ${predicate} to be true`); + throw new AssertionError(msg); + } +} + +class NullDrop extends Drop { + equals(value) { + return isNil(toValue(value)); + } + gt() { + return false; + } + geq() { + return false; + } + lt() { + return false; + } + leq() { + return false; + } + valueOf() { + return null; + } +} + +class EmptyDrop extends Drop { + equals(value) { + if (value instanceof EmptyDrop) + return false; + value = toValue(value); + if (isString(value) || isArray(value)) + return value.length === 0; + if (isObject(value)) + return Object.keys(value).length === 0; + return false; + } + gt() { + return false; + } + geq() { + return false; + } + lt() { + return false; + } + leq() { + return false; + } + valueOf() { + return ''; + } +} + +class BlankDrop extends EmptyDrop { + equals(value) { + if (value === false) + return true; + if (isNil(toValue(value))) + return true; + if (isString(value)) + return /^\s*$/.test(value); + return super.equals(value); + } +} + +class ForloopDrop extends Drop { + constructor(length, collection, variable) { + super(); + this.i = 0; + this.length = length; + this.name = `${variable}-${collection}`; + } + next() { + this.i++; + } + index0() { + return this.i; + } + index() { + return this.i + 1; + } + first() { + return this.i === 0; + } + last() { + return this.i === this.length - 1; + } + rindex() { + return this.length - this.i; + } + rindex0() { + return this.length - this.i - 1; + } + valueOf() { + return JSON.stringify(this); + } +} + +class BlockDrop extends Drop { + constructor( + // the block render from layout template + superBlockRender = () => '') { + super(); + this.superBlockRender = superBlockRender; + } + /** + * Provide parent access in child block by + * {{ block.super }} + */ + super() { + return this.superBlockRender(); + } +} + +function isComparable(arg) { + return (arg && + isFunction(arg.equals) && + isFunction(arg.gt) && + isFunction(arg.geq) && + isFunction(arg.lt) && + isFunction(arg.leq)); +} + +const nil = new NullDrop(); +const literalValues = { + 'true': true, + 'false': false, + 'nil': nil, + 'null': nil, + 'empty': new EmptyDrop(), + 'blank': new BlankDrop() +}; + +function createTrie(input) { + const trie = {}; + for (const [name, data] of Object.entries(input)) { + let node = trie; + for (let i = 0; i < name.length; i++) { + const c = name[i]; + node[c] = node[c] || {}; + if (i === name.length - 1 && isWord(name[i])) { + node[c].needBoundary = true; + } + node = node[c]; + } + node.data = data; + node.end = true; + } + return trie; +} + +// convert an async iterator to a Promise +async function toPromise(val) { + if (!isIterator(val)) + return val; + let value; + let done = false; + let next = 'next'; + do { + const state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + try { + if (isIterator(value)) + value = toPromise(value); + if (isPromise(value)) + value = await value; + } + catch (err) { + next = 'throw'; + value = err; + } + } while (!done); + return value; +} +// convert an async iterator to a value in a synchronous manner +function toValueSync(val) { + if (!isIterator(val)) + return val; + let value; + let done = false; + let next = 'next'; + do { + const state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + if (isIterator(value)) { + try { + value = toValueSync(value); + } + catch (err) { + next = 'throw'; + value = err; + } + } + } while (!done); + return value; +} + +const rFormat = /%([-_0^#:]+)?(\d+)?([EO])?(.)/; +const monthNames = [ + 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', + 'September', 'October', 'November', 'December' +]; +const dayNames = [ + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' +]; +const monthNamesShort = monthNames.map(abbr); +const dayNamesShort = dayNames.map(abbr); +function abbr(str) { + return str.slice(0, 3); +} +// prototype extensions +function daysInMonth(d) { + const feb = isLeapYear(d) ? 29 : 28; + return [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +} +function getDayOfYear(d) { + let num = 0; + for (let i = 0; i < d.getMonth(); ++i) { + num += daysInMonth(d)[i]; + } + return num + d.getDate(); +} +function getWeekOfYear(d, startDay) { + // Skip to startDay of this week + const now = getDayOfYear(d) + (startDay - d.getDay()); + // Find the first startDay of the year + const jan1 = new Date(d.getFullYear(), 0, 1); + const then = (7 - jan1.getDay() + startDay); + return String(Math.floor((now - then) / 7) + 1); +} +function isLeapYear(d) { + const year = d.getFullYear(); + return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year))); +} +function ordinal(d) { + const date = d.getDate(); + if ([11, 12, 13].includes(date)) + return 'th'; + switch (date % 10) { + case 1: return 'st'; + case 2: return 'nd'; + case 3: return 'rd'; + default: return 'th'; + } +} +function century(d) { + return parseInt(d.getFullYear().toString().substring(0, 2), 10); +} +// default to 0 +const padWidths = { + d: 2, + e: 2, + H: 2, + I: 2, + j: 3, + k: 2, + l: 2, + L: 3, + m: 2, + M: 2, + S: 2, + U: 2, + W: 2 +}; +// default to '0' +const padChars = { + a: ' ', + A: ' ', + b: ' ', + B: ' ', + c: ' ', + e: ' ', + k: ' ', + l: ' ', + p: ' ', + P: ' ' +}; +function getTimezoneOffset(d, opts) { + const nOffset = Math.abs(d.getTimezoneOffset()); + const h = Math.floor(nOffset / 60); + const m = nOffset % 60; + return (d.getTimezoneOffset() > 0 ? '-' : '+') + + padStart(h, 2, '0') + + (opts.flags[':'] ? ':' : '') + + padStart(m, 2, '0'); +} +const formatCodes = { + a: (d) => dayNamesShort[d.getDay()], + A: (d) => dayNames[d.getDay()], + b: (d) => monthNamesShort[d.getMonth()], + B: (d) => monthNames[d.getMonth()], + c: (d) => d.toLocaleString(), + C: (d) => century(d), + d: (d) => d.getDate(), + e: (d) => d.getDate(), + H: (d) => d.getHours(), + I: (d) => String(d.getHours() % 12 || 12), + j: (d) => getDayOfYear(d), + k: (d) => d.getHours(), + l: (d) => String(d.getHours() % 12 || 12), + L: (d) => d.getMilliseconds(), + m: (d) => d.getMonth() + 1, + M: (d) => d.getMinutes(), + N: (d, opts) => { + const width = Number(opts.width) || 9; + const str = String(d.getMilliseconds()).slice(0, width); + return padEnd(str, width, '0'); + }, + p: (d) => (d.getHours() < 12 ? 'AM' : 'PM'), + P: (d) => (d.getHours() < 12 ? 'am' : 'pm'), + q: (d) => ordinal(d), + s: (d) => Math.round(d.getTime() / 1000), + S: (d) => d.getSeconds(), + u: (d) => d.getDay() || 7, + U: (d) => getWeekOfYear(d, 0), + w: (d) => d.getDay(), + W: (d) => getWeekOfYear(d, 1), + x: (d) => d.toLocaleDateString(), + X: (d) => d.toLocaleTimeString(), + y: (d) => d.getFullYear().toString().slice(2, 4), + Y: (d) => d.getFullYear(), + z: getTimezoneOffset, + Z: (d, opts) => { + if (d.getTimezoneName) { + return d.getTimezoneName() || getTimezoneOffset(d, opts); + } + return (typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : ''); + }, + 't': () => '\t', + 'n': () => '\n', + '%': () => '%' +}; +formatCodes.h = formatCodes.b; +function strftime(d, formatStr) { + let output = ''; + let remaining = formatStr; + let match; + while ((match = rFormat.exec(remaining))) { + output += remaining.slice(0, match.index); + remaining = remaining.slice(match.index + match[0].length); + output += format(d, match); + } + return output + remaining; +} +function format(d, match) { + const [input, flagStr = '', width, modifier, conversion] = match; + const convert = formatCodes[conversion]; + if (!convert) + return input; + const flags = {}; + for (const flag of flagStr) + flags[flag] = true; + let ret = String(convert(d, { flags, width, modifier })); + let padChar = padChars[conversion] || '0'; + let padWidth = width || padWidths[conversion] || 0; + if (flags['^']) + ret = ret.toUpperCase(); + else if (flags['#']) + ret = changeCase(ret); + if (flags['_']) + padChar = ' '; + else if (flags['0']) + padChar = '0'; + if (flags['-']) + padWidth = 0; + return padStart(ret, padWidth, padChar); +} + +// one minute in milliseconds +const OneMinute = 60000; +const ISO8601_TIMEZONE_PATTERN = /([zZ]|([+-])(\d{2}):(\d{2}))$/; +/** + * A date implementation with timezone info, just like Ruby date + * + * Implementation: + * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods + * - rewrite getTimezoneOffset() to trick strftime + */ +class TimezoneDate { + constructor(init, timezone) { + this.date = init instanceof TimezoneDate + ? init.date + : new Date(init); + this.timezoneOffset = isString(timezone) ? TimezoneDate.getTimezoneOffset(timezone, this.date) : timezone; + this.timezoneName = isString(timezone) ? timezone : ''; + const diff = (this.date.getTimezoneOffset() - this.timezoneOffset) * OneMinute; + const time = this.date.getTime() + diff; + this.displayDate = new Date(time); + } + getTime() { + return this.displayDate.getTime(); + } + getMilliseconds() { + return this.displayDate.getMilliseconds(); + } + getSeconds() { + return this.displayDate.getSeconds(); + } + getMinutes() { + return this.displayDate.getMinutes(); + } + getHours() { + return this.displayDate.getHours(); + } + getDay() { + return this.displayDate.getDay(); + } + getDate() { + return this.displayDate.getDate(); + } + getMonth() { + return this.displayDate.getMonth(); + } + getFullYear() { + return this.displayDate.getFullYear(); + } + toLocaleString(locale, init) { + if (init?.timeZone) { + return this.date.toLocaleString(locale, init); + } + return this.displayDate.toLocaleString(locale, init); + } + toLocaleTimeString(locale) { + return this.displayDate.toLocaleTimeString(locale); + } + toLocaleDateString(locale) { + return this.displayDate.toLocaleDateString(locale); + } + getTimezoneOffset() { + return this.timezoneOffset; + } + getTimezoneName() { + return this.timezoneName; + } + /** + * Create a Date object fixed to it's declared Timezone. Both + * - 2021-08-06T02:29:00.000Z and + * - 2021-08-06T02:29:00.000+08:00 + * will always be displayed as + * - 2021-08-06 02:29:00 + * regardless timezoneOffset in JavaScript realm + * + * The implementation hack: + * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`, + * we create a different Date to trick strftime, it's both simpler and more performant. + * Given that a template is expected to be parsed fewer times than rendered. + */ + static createDateFixedToTimezone(dateString) { + const m = dateString.match(ISO8601_TIMEZONE_PATTERN); + // representing a UTC timestamp + if (m && m[1] === 'Z') { + return new TimezoneDate(+new Date(dateString), 0); + } + // has a timezone specified + if (m && m[2] && m[3] && m[4]) { + const [, , sign, hours, minutes] = m; + const offset = (sign === '+' ? -1 : 1) * (parseInt(hours, 10) * 60 + parseInt(minutes, 10)); + return new TimezoneDate(+new Date(dateString), offset); + } + return new Date(dateString); + } + static getTimezoneOffset(timezoneName, date = new Date()) { + const localDateString = date.toLocaleString('en-US', { timeZone: timezoneName }); + const utcDateString = date.toLocaleString('en-US', { timeZone: 'UTC' }); + const localDate = new Date(localDateString); + const utcDate = new Date(utcDateString); + return (+utcDate - +localDate) / (60 * 1000); + } +} + +class DelimitedToken extends Token { + constructor(kind, [contentBegin, contentEnd], input, begin, end, trimLeft, trimRight, file) { + super(kind, input, begin, end, file); + this.trimLeft = false; + this.trimRight = false; + const tl = input[contentBegin] === '-'; + const tr = input[contentEnd - 1] === '-'; + let l = tl ? contentBegin + 1 : contentBegin; + let r = tr ? contentEnd - 1 : contentEnd; + while (l < r && (TYPES[input.charCodeAt(l)] & BLANK)) + l++; + while (r > l && (TYPES[input.charCodeAt(r - 1)] & BLANK)) + r--; + this.contentRange = [l, r]; + this.trimLeft = tl || trimLeft; + this.trimRight = tr || trimRight; + } + get content() { + return this.input.slice(this.contentRange[0], this.contentRange[1]); + } +} + +class TagToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + const { trimTagLeft, trimTagRight, tagDelimiterLeft, tagDelimiterRight } = options; + const [valueBegin, valueEnd] = [begin + tagDelimiterLeft.length, end - tagDelimiterRight.length]; + super(exports.TokenKind.Tag, [valueBegin, valueEnd], input, begin, end, trimTagLeft, trimTagRight, file); + this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange); + this.name = this.tokenizer.readTagName(); + this.tokenizer.assert(this.name, `illegal tag syntax, tag name expected`); + this.tokenizer.skipBlank(); + } + get args() { + return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]); + } +} + +class OutputToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + const { trimOutputLeft, trimOutputRight, outputDelimiterLeft, outputDelimiterRight } = options; + const valueRange = [begin + outputDelimiterLeft.length, end - outputDelimiterRight.length]; + super(exports.TokenKind.Output, valueRange, input, begin, end, trimOutputLeft, trimOutputRight, file); + } +} + +class HTMLToken extends Token { + constructor(input, begin, end, file) { + super(exports.TokenKind.HTML, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.trimLeft = 0; + this.trimRight = 0; + } + getContent() { + return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight); + } +} + +class NumberToken extends Token { + constructor(input, begin, end, file) { + super(exports.TokenKind.Number, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = Number(this.getText()); + } +} + +class IdentifierToken extends Token { + constructor(input, begin, end, file) { + super(exports.TokenKind.Word, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = this.getText(); + } + isNumber(allowSign = false) { + const begin = allowSign && TYPES[this.input.charCodeAt(this.begin)] & SIGN + ? this.begin + 1 + : this.begin; + for (let i = begin; i < this.end; i++) { + if (!(TYPES[this.input.charCodeAt(i)] & NUMBER)) + return false; + } + return true; + } +} + +class LiteralToken extends Token { + constructor(input, begin, end, file) { + super(exports.TokenKind.Literal, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.literal = this.getText(); + this.content = literalValues[this.literal]; + } +} + +const operatorPrecedences = { + '==': 2, + '!=': 2, + '>': 2, + '<': 2, + '>=': 2, + '<=': 2, + 'contains': 2, + 'not': 1, + 'and': 0, + 'or': 0 +}; +const operatorTypes = { + '==': 0 /* OperatorType.Binary */, + '!=': 0 /* OperatorType.Binary */, + '>': 0 /* OperatorType.Binary */, + '<': 0 /* OperatorType.Binary */, + '>=': 0 /* OperatorType.Binary */, + '<=': 0 /* OperatorType.Binary */, + 'contains': 0 /* OperatorType.Binary */, + 'not': 1 /* OperatorType.Unary */, + 'and': 0 /* OperatorType.Binary */, + 'or': 0 /* OperatorType.Binary */ +}; +class OperatorToken extends Token { + constructor(input, begin, end, file) { + super(exports.TokenKind.Operator, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.operator = this.getText(); + } + getPrecedence() { + const key = this.getText(); + return key in operatorPrecedences ? operatorPrecedences[key] : 1; + } +} + +class PropertyAccessToken extends Token { + constructor(variable, props, input, begin, end, file) { + super(exports.TokenKind.PropertyAccess, input, begin, end, file); + this.variable = variable; + this.props = props; + } +} + +class FilterToken extends Token { + constructor(name, args, input, begin, end, file) { + super(exports.TokenKind.Filter, input, begin, end, file); + this.name = name; + this.args = args; + } +} + +class HashToken extends Token { + constructor(input, begin, end, name, value, file) { + super(exports.TokenKind.Hash, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.name = name; + this.value = value; + this.file = file; + } +} + +const rHex = /[\da-fA-F]/; +const rOct = /[0-7]/; +const escapeChar = { + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t', + v: '\x0B' +}; +function hexVal(c) { + const code = c.charCodeAt(0); + if (code >= 97) + return code - 87; + if (code >= 65) + return code - 55; + return code - 48; +} +function parseStringLiteral(str) { + let ret = ''; + for (let i = 1; i < str.length - 1; i++) { + if (str[i] !== '\\') { + ret += str[i]; + continue; + } + if (escapeChar[str[i + 1]] !== undefined) { + ret += escapeChar[str[++i]]; + } + else if (str[i + 1] === 'u') { + let val = 0; + let j = i + 2; + while (j <= i + 5 && rHex.test(str[j])) { + val = val * 16 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + else if (!rOct.test(str[i + 1])) { + ret += str[++i]; + } + else { + let j = i + 1; + let val = 0; + while (j <= i + 3 && rOct.test(str[j])) { + val = val * 8 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + } + return ret; +} + +class QuotedToken extends Token { + constructor(input, begin, end, file) { + super(exports.TokenKind.Quoted, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = parseStringLiteral(this.getText()); + } +} + +class RangeToken extends Token { + constructor(input, begin, end, lhs, rhs, file) { + super(exports.TokenKind.Range, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.lhs = lhs; + this.rhs = rhs; + this.file = file; + } +} + +/** + * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}` + */ +class LiquidTagToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + super(exports.TokenKind.Tag, [begin, end], input, begin, end, false, false, file); + this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange); + this.name = this.tokenizer.readTagName(); + this.tokenizer.assert(this.name, 'illegal liquid tag syntax'); + this.tokenizer.skipBlank(); + this.args = this.tokenizer.remaining(); + } +} + +/** + * value expression with optional filters + * e.g. + * {% assign foo="bar" | append: "coo" %} + */ +class FilteredValueToken extends Token { + constructor(initial, filters, input, begin, end, file) { + super(exports.TokenKind.FilteredValue, input, begin, end, file); + this.initial = initial; + this.filters = filters; + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + } +} + +class SimpleEmitter { + constructor() { + this.buffer = ''; + } + write(html) { + this.buffer += stringify(html); + } +} + +class StreamedEmitter { + constructor() { + this.buffer = ''; + this.stream = new stream.PassThrough(); + } + write(html) { + this.stream.write(stringify(html)); + } + error(err) { + this.stream.emit('error', err); + } + end() { + this.stream.end(); + } +} + +class KeepingTypeEmitter { + constructor() { + this.buffer = ''; + } + write(html) { + html = toValue(html); + // This will only preserve the type if the value is isolated. + // I.E: + // {{ my-port }} -> 42 + // {{ my-host }}:{{ my-port }} -> 'host:42' + if (typeof html !== 'string' && this.buffer === '') { + this.buffer = html; + } + else { + this.buffer = stringify(this.buffer) + stringify(html); + } + } +} + +class Render { + renderTemplatesToNodeStream(templates, ctx) { + const emitter = new StreamedEmitter(); + Promise.resolve().then(() => toPromise(this.renderTemplates(templates, ctx, emitter))) + .then(() => emitter.end(), err => emitter.error(err)); + return emitter.stream; + } + *renderTemplates(templates, ctx, emitter) { + if (!emitter) { + emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter(); + } + const errors = []; + for (const tpl of templates) { + try { + // if tpl.render supports emitter, it'll return empty `html` + const html = yield tpl.render(ctx, emitter); + // if not, it'll return an `html`, write to the emitter for it + html && emitter.write(html); + if (emitter['break'] || emitter['continue']) + break; + } + catch (e) { + const err = LiquidError.is(e) ? e : new RenderError(e, tpl); + if (ctx.opts.catchAllErrors) + errors.push(err); + else + throw err; + } + } + if (errors.length) { + throw new LiquidErrors(errors); + } + return emitter.buffer; + } +} + +class Expression { + constructor(tokens) { + this.postfix = [...toPostfix(tokens)]; + } + *evaluate(ctx, lenient) { + assert(ctx, 'unable to evaluate: context not defined'); + const operands = []; + for (const token of this.postfix) { + if (isOperatorToken(token)) { + const r = operands.pop(); + let result; + if (operatorTypes[token.operator] === 1 /* OperatorType.Unary */) { + result = yield ctx.opts.operators[token.operator](r, ctx); + } + else { + const l = operands.pop(); + result = yield ctx.opts.operators[token.operator](l, r, ctx); + } + operands.push(result); + } + else { + operands.push(yield evalToken(token, ctx, lenient)); + } + } + return operands[0]; + } + valid() { + return !!this.postfix.length; + } +} +function* evalToken(token, ctx, lenient = false) { + if (!token) + return; + if ('content' in token) + return token.content; + if (isPropertyAccessToken(token)) + return yield evalPropertyAccessToken(token, ctx, lenient); + if (isRangeToken(token)) + return yield evalRangeToken(token, ctx); +} +function* evalPropertyAccessToken(token, ctx, lenient) { + const props = []; + for (const prop of token.props) { + props.push((yield evalToken(prop, ctx, false))); + } + try { + if (token.variable) { + const variable = yield evalToken(token.variable, ctx, lenient); + return yield ctx._getFromScope(variable, props); + } + else { + return yield ctx._get(props); + } + } + catch (e) { + if (lenient && e.name === 'InternalUndefinedVariableError') + return null; + throw (new UndefinedVariableError(e, token)); + } +} +function evalQuotedToken(token) { + return token.content; +} +function* evalRangeToken(token, ctx) { + const low = yield evalToken(token.lhs, ctx); + const high = yield evalToken(token.rhs, ctx); + return range(+low, +high + 1); +} +function* toPostfix(tokens) { + const ops = []; + for (const token of tokens) { + if (isOperatorToken(token)) { + while (ops.length && ops[ops.length - 1].getPrecedence() > token.getPrecedence()) { + yield ops.pop(); + } + ops.push(token); + } + else + yield token; + } + while (ops.length) { + yield ops.pop(); + } +} + +function isTruthy(val, ctx) { + return !isFalsy(val, ctx); +} +function isFalsy(val, ctx) { + val = toValue(val); + if (ctx.opts.jsTruthy) { + return !val; + } + else { + return val === false || undefined === val || val === null; + } +} + +const defaultOperators = { + '==': equals, + '!=': (l, r) => !equals(l, r), + '>': (l, r) => { + if (isComparable(l)) + return l.gt(r); + if (isComparable(r)) + return r.lt(l); + return toValue(l) > toValue(r); + }, + '<': (l, r) => { + if (isComparable(l)) + return l.lt(r); + if (isComparable(r)) + return r.gt(l); + return toValue(l) < toValue(r); + }, + '>=': (l, r) => { + if (isComparable(l)) + return l.geq(r); + if (isComparable(r)) + return r.leq(l); + return toValue(l) >= toValue(r); + }, + '<=': (l, r) => { + if (isComparable(l)) + return l.leq(r); + if (isComparable(r)) + return r.geq(l); + return toValue(l) <= toValue(r); + }, + 'contains': (l, r) => { + l = toValue(l); + if (isArray(l)) + return l.some((i) => equals(i, r)); + if (isFunction(l?.indexOf)) + return l.indexOf(toValue(r)) > -1; + return false; + }, + 'not': (v, ctx) => isFalsy(toValue(v), ctx), + 'and': (l, r, ctx) => isTruthy(toValue(l), ctx) && isTruthy(toValue(r), ctx), + 'or': (l, r, ctx) => isTruthy(toValue(l), ctx) || isTruthy(toValue(r), ctx) +}; +function equals(lhs, rhs) { + if (isComparable(lhs)) + return lhs.equals(rhs); + if (isComparable(rhs)) + return rhs.equals(lhs); + lhs = toValue(lhs); + rhs = toValue(rhs); + if (isArray(lhs)) { + return isArray(rhs) && arrayEquals(lhs, rhs); + } + return lhs === rhs; +} +function arrayEquals(lhs, rhs) { + if (lhs.length !== rhs.length) + return false; + return !lhs.some((value, i) => !equals(value, rhs[i])); +} + +class Node { + constructor(key, value, next, prev) { + this.key = key; + this.value = value; + this.next = next; + this.prev = prev; + } +} +class LRU { + constructor(limit, size = 0) { + this.limit = limit; + this.size = size; + this.cache = {}; + this.head = new Node('HEAD', null, null, null); + this.tail = new Node('TAIL', null, null, null); + this.head.next = this.tail; + this.tail.prev = this.head; + } + write(key, value) { + if (this.cache[key]) { + this.cache[key].value = value; + } + else { + const node = new Node(key, value, this.head.next, this.head); + this.head.next.prev = node; + this.head.next = node; + this.cache[key] = node; + this.size++; + this.ensureLimit(); + } + } + read(key) { + if (!this.cache[key]) + return; + const { value } = this.cache[key]; + this.remove(key); + this.write(key, value); + return value; + } + remove(key) { + const node = this.cache[key]; + node.prev.next = node.next; + node.next.prev = node.prev; + delete this.cache[key]; + this.size--; + } + clear() { + this.head.next = this.tail; + this.tail.prev = this.head; + this.size = 0; + this.cache = {}; + } + ensureLimit() { + if (this.size > this.limit) + this.remove(this.tail.prev.key); + } +} + +const requireResolve = require.resolve; + +const statAsync = promisify(fs$1.stat); +const readFileAsync = promisify(fs$1.readFile); +async function exists(filepath) { + try { + await statAsync(filepath); + return true; + } + catch (err) { + return false; + } +} +function readFile(filepath) { + return readFileAsync(filepath, 'utf8'); +} +function existsSync(filepath) { + try { + fs$1.statSync(filepath); + return true; + } + catch (err) { + return false; + } +} +function readFileSync(filepath) { + return fs$1.readFileSync(filepath, 'utf8'); +} +function resolve(root, file, ext) { + if (!path.extname(file)) + file += ext; + return path.resolve(root, file); +} +function fallback(file) { + try { + return requireResolve(file); + } + catch (e) { } +} +function dirname(filepath) { + return path.dirname(filepath); +} +function contains(root, file) { + root = path.resolve(root); + root = root.endsWith(path.sep) ? root : root + path.sep; + return file.startsWith(root); +} + +var fs = /*#__PURE__*/Object.freeze({ + __proto__: null, + exists: exists, + readFile: readFile, + existsSync: existsSync, + readFileSync: readFileSync, + resolve: resolve, + fallback: fallback, + dirname: dirname, + contains: contains, + sep: path.sep +}); + +function defaultFilter(value, defaultValue, ...args) { + value = toValue(value); + if (isArray(value) || isString(value)) + return value.length ? value : defaultValue; + if (value === false && (new Map(args)).get('allow_false')) + return false; + return isFalsy(value, this.context) ? defaultValue : value; +} +function json(value, space = 0) { + return JSON.stringify(value, null, space); +} +function inspect(value, space = 0) { + const ancestors = []; + return JSON.stringify(value, function (_key, value) { + if (typeof value !== 'object' || value === null) + return value; + // `this` is the object that value is contained in, i.e., its direct parent. + while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) + ancestors.pop(); + if (ancestors.includes(value)) + return '[Circular]'; + ancestors.push(value); + return value; + }, space); +} +function to_integer(value) { + return Number(value); +} +const raw = { + raw: true, + handler: identify +}; +var misc = { + default: defaultFilter, + raw, + jsonify: json, + to_integer, + json, + inspect +}; + +const escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; +const unescapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; +function escape(str) { + return stringify(str).replace(/&|<|>|"|'/g, m => escapeMap[m]); +} +function xml_escape(str) { + return escape(str); +} +function unescape(str) { + return stringify(str).replace(/&(amp|lt|gt|#34|#39);/g, m => unescapeMap[m]); +} +function escape_once(str) { + return escape(unescape(stringify(str))); +} +function newline_to_br(v) { + return stringify(v).replace(/\r?\n/gm, '
    \n'); +} +function strip_html(v) { + return stringify(v).replace(/||<.*?>|/g, ''); +} + +var htmlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + escape: escape, + xml_escape: xml_escape, + escape_once: escape_once, + newline_to_br: newline_to_br, + strip_html: strip_html +}); + +const defaultOptions = { + root: ['.'], + layouts: ['.'], + partials: ['.'], + relativeReference: true, + jekyllInclude: false, + cache: undefined, + extname: '', + fs: fs, + dynamicPartials: true, + jsTruthy: false, + dateFormat: '%A, %B %-e, %Y at %-l:%M %P %z', + trimTagRight: false, + trimTagLeft: false, + trimOutputRight: false, + trimOutputLeft: false, + greedy: true, + tagDelimiterLeft: '{%', + tagDelimiterRight: '%}', + outputDelimiterLeft: '{{', + outputDelimiterRight: '}}', + preserveTimezones: false, + strictFilters: false, + strictVariables: false, + ownPropertyOnly: true, + lenientIf: false, + globals: {}, + keepOutputType: false, + operators: defaultOperators +}; +function normalize(options) { + if (options.hasOwnProperty('root')) { + if (!options.hasOwnProperty('partials')) + options.partials = options.root; + if (!options.hasOwnProperty('layouts')) + options.layouts = options.root; + } + if (options.hasOwnProperty('cache')) { + let cache; + if (typeof options.cache === 'number') + cache = options.cache > 0 ? new LRU(options.cache) : undefined; + else if (typeof options.cache === 'object') + cache = options.cache; + else + cache = options.cache ? new LRU(1024) : undefined; + options.cache = cache; + } + options = { ...defaultOptions, ...(options.jekyllInclude ? { dynamicPartials: false } : {}), ...options }; + if ((!options.fs.dirname || !options.fs.sep) && options.relativeReference) { + console.warn('[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning'); + options.relativeReference = false; + } + options.root = normalizeDirectoryList(options.root); + options.partials = normalizeDirectoryList(options.partials); + options.layouts = normalizeDirectoryList(options.layouts); + options.outputEscape = options.outputEscape && getOutputEscapeFunction(options.outputEscape); + return options; +} +function getOutputEscapeFunction(nameOrFunction) { + if (nameOrFunction === 'escape') + return escape; + if (nameOrFunction === 'json') + return misc.json; + assert(isFunction(nameOrFunction), '`outputEscape` need to be of type string or function'); + return nameOrFunction; +} +function normalizeDirectoryList(value) { + let list = []; + if (isArray(value)) + list = value; + if (isString(value)) + list = [value]; + return list; +} + +function whiteSpaceCtrl(tokens, options) { + let inRaw = false; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + if (!isDelimitedToken(token)) + continue; + if (!inRaw && token.trimLeft) { + trimLeft(tokens[i - 1], options.greedy); + } + if (isTagToken(token)) { + if (token.name === 'raw') + inRaw = true; + else if (token.name === 'endraw') + inRaw = false; + } + if (!inRaw && token.trimRight) { + trimRight(tokens[i + 1], options.greedy); + } + } +} +function trimLeft(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + const mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.end - 1 - token.trimRight)] & mask) + token.trimRight++; +} +function trimRight(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + const mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.begin + token.trimLeft)] & mask) + token.trimLeft++; + if (token.input.charAt(token.begin + token.trimLeft) === '\n') + token.trimLeft++; +} + +class Tokenizer { + constructor(input, operators = defaultOptions.operators, file, range) { + this.input = input; + this.file = file; + this.rawBeginAt = -1; + this.p = range ? range[0] : 0; + this.N = range ? range[1] : input.length; + this.opTrie = createTrie(operators); + this.literalTrie = createTrie(literalValues); + } + readExpression() { + return new Expression(this.readExpressionTokens()); + } + *readExpressionTokens() { + while (this.p < this.N) { + const operator = this.readOperator(); + if (operator) { + yield operator; + continue; + } + const operand = this.readValue(); + if (operand) { + yield operand; + continue; + } + return; + } + } + readOperator() { + this.skipBlank(); + const end = this.matchTrie(this.opTrie); + if (end === -1) + return; + return new OperatorToken(this.input, this.p, (this.p = end), this.file); + } + matchTrie(trie) { + let node = trie; + let i = this.p; + let info; + while (node[this.input[i]] && i < this.N) { + node = node[this.input[i++]]; + if (node['end']) + info = node; + } + if (!info) + return -1; + if (info['needBoundary'] && isWord(this.peek(i - this.p))) + return -1; + return i; + } + readFilteredValue() { + const begin = this.p; + const initial = this.readExpression(); + this.assert(initial.valid(), `invalid value expression: ${this.snapshot()}`); + const filters = this.readFilters(); + return new FilteredValueToken(initial, filters, this.input, begin, this.p, this.file); + } + readFilters() { + const filters = []; + while (true) { + const filter = this.readFilter(); + if (!filter) + return filters; + filters.push(filter); + } + } + readFilter() { + this.skipBlank(); + if (this.end()) + return null; + this.assert(this.peek() === '|', `expected "|" before filter`); + this.p++; + const begin = this.p; + const name = this.readIdentifier(); + if (!name.size()) { + this.assert(this.end(), `expected filter name`); + return null; + } + const args = []; + this.skipBlank(); + if (this.peek() === ':') { + do { + ++this.p; + const arg = this.readFilterArg(); + arg && args.push(arg); + this.skipBlank(); + this.assert(this.end() || this.peek() === ',' || this.peek() === '|', () => `unexpected character ${this.snapshot()}`); + } while (this.peek() === ','); + } + else if (this.peek() === '|' || this.end()) ; + else { + throw this.error('expected ":" after filter name'); + } + return new FilterToken(name.getText(), args, this.input, begin, this.p, this.file); + } + readFilterArg() { + const key = this.readValue(); + if (!key) + return; + this.skipBlank(); + if (this.peek() !== ':') + return key; + ++this.p; + const value = this.readValue(); + return [key.getText(), value]; + } + readTopLevelTokens(options = defaultOptions) { + const tokens = []; + while (this.p < this.N) { + const token = this.readTopLevelToken(options); + tokens.push(token); + } + whiteSpaceCtrl(tokens, options); + return tokens; + } + readTopLevelToken(options) { + const { tagDelimiterLeft, outputDelimiterLeft } = options; + if (this.rawBeginAt > -1) + return this.readEndrawOrRawContent(options); + if (this.match(tagDelimiterLeft)) + return this.readTagToken(options); + if (this.match(outputDelimiterLeft)) + return this.readOutputToken(options); + return this.readHTMLToken([tagDelimiterLeft, outputDelimiterLeft]); + } + readHTMLToken(stopStrings) { + const begin = this.p; + while (this.p < this.N) { + if (stopStrings.some(str => this.match(str))) + break; + ++this.p; + } + return new HTMLToken(this.input, begin, this.p, this.file); + } + readTagToken(options = defaultOptions) { + const { file, input } = this; + const begin = this.p; + if (this.readToDelimiter(options.tagDelimiterRight) === -1) { + throw this.error(`tag ${this.snapshot(begin)} not closed`, begin); + } + const token = new TagToken(input, begin, this.p, options, file); + if (token.name === 'raw') + this.rawBeginAt = begin; + return token; + } + readToDelimiter(delimiter, respectQuoted = false) { + this.skipBlank(); + while (this.p < this.N) { + if (respectQuoted && (this.peekType() & QUOTE)) { + this.readQuoted(); + continue; + } + ++this.p; + if (this.rmatch(delimiter)) + return this.p; + } + return -1; + } + readOutputToken(options = defaultOptions) { + const { file, input } = this; + const { outputDelimiterRight } = options; + const begin = this.p; + if (this.readToDelimiter(outputDelimiterRight, true) === -1) { + throw this.error(`output ${this.snapshot(begin)} not closed`, begin); + } + return new OutputToken(input, begin, this.p, options, file); + } + readEndrawOrRawContent(options) { + const { tagDelimiterLeft, tagDelimiterRight } = options; + const begin = this.p; + let leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + while (this.p < this.N) { + if (this.readIdentifier().getText() !== 'endraw') { + leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + continue; + } + while (this.p <= this.N) { + if (this.rmatch(tagDelimiterRight)) { + const end = this.p; + if (begin === leftPos) { + this.rawBeginAt = -1; + return new TagToken(this.input, begin, end, options, this.file); + } + else { + this.p = leftPos; + return new HTMLToken(this.input, begin, leftPos, this.file); + } + } + if (this.rmatch(tagDelimiterLeft)) + break; + this.p++; + } + } + throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, begin); + } + readLiquidTagTokens(options = defaultOptions) { + const tokens = []; + while (this.p < this.N) { + const token = this.readLiquidTagToken(options); + token && tokens.push(token); + } + return tokens; + } + readLiquidTagToken(options) { + this.skipBlank(); + if (this.end()) + return; + const begin = this.p; + this.readToDelimiter('\n'); + const end = this.p; + return new LiquidTagToken(this.input, begin, end, options, this.file); + } + error(msg, pos = this.p) { + return new TokenizationError(msg, new IdentifierToken(this.input, pos, this.N, this.file)); + } + assert(pred, msg, pos) { + if (!pred) + throw this.error(typeof msg === 'function' ? msg() : msg, pos); + } + snapshot(begin = this.p) { + return JSON.stringify(ellipsis(this.input.slice(begin, this.N), 32)); + } + /** + * @deprecated use #readIdentifier instead + */ + readWord() { + return this.readIdentifier(); + } + readIdentifier() { + this.skipBlank(); + const begin = this.p; + while (!this.end() && isWord(this.peek())) + ++this.p; + return new IdentifierToken(this.input, begin, this.p, this.file); + } + readNonEmptyIdentifier() { + const id = this.readIdentifier(); + return id.size() ? id : undefined; + } + readTagName() { + this.skipBlank(); + // Handle inline comment tags + if (this.input[this.p] === '#') + return this.input.slice(this.p, ++this.p); + return this.readIdentifier().getText(); + } + readHashes(jekyllStyle) { + const hashes = []; + while (true) { + const hash = this.readHash(jekyllStyle); + if (!hash) + return hashes; + hashes.push(hash); + } + } + readHash(jekyllStyle) { + this.skipBlank(); + if (this.peek() === ',') + ++this.p; + const begin = this.p; + const name = this.readNonEmptyIdentifier(); + if (!name) + return; + let value; + this.skipBlank(); + const sep = jekyllStyle ? '=' : ':'; + if (this.peek() === sep) { + ++this.p; + value = this.readValue(); + } + return new HashToken(this.input, begin, this.p, name, value, this.file); + } + remaining() { + return this.input.slice(this.p, this.N); + } + advance(step = 1) { + this.p += step; + } + end() { + return this.p >= this.N; + } + readTo(end) { + while (this.p < this.N) { + ++this.p; + if (this.rmatch(end)) + return this.p; + } + return -1; + } + readValue() { + this.skipBlank(); + const begin = this.p; + const variable = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber(); + const props = this.readProperties(!variable); + if (!props.length) + return variable; + return new PropertyAccessToken(variable, props, this.input, begin, this.p); + } + readScopeValue() { + this.skipBlank(); + const begin = this.p; + const props = this.readProperties(); + if (!props.length) + return undefined; + return new PropertyAccessToken(undefined, props, this.input, begin, this.p); + } + readProperties(isBegin = true) { + const props = []; + while (true) { + if (this.peek() === '[') { + this.p++; + const prop = this.readValue() || new IdentifierToken(this.input, this.p, this.p, this.file); + this.assert(this.readTo(']') !== -1, '[ not closed'); + props.push(prop); + continue; + } + if (isBegin && !props.length) { + const prop = this.readNonEmptyIdentifier(); + if (prop) { + props.push(prop); + continue; + } + } + if (this.peek() === '.' && this.peek(1) !== '.') { // skip range syntax + this.p++; + const prop = this.readNonEmptyIdentifier(); + if (!prop) + break; + props.push(prop); + continue; + } + break; + } + return props; + } + readNumber() { + this.skipBlank(); + let decimalFound = false; + let digitFound = false; + let n = 0; + if (this.peekType() & SIGN) + n++; + while (this.p + n <= this.N) { + if (this.peekType(n) & NUMBER) { + digitFound = true; + n++; + } + else if (this.peek(n) === '.' && this.peek(n + 1) !== '.') { + if (decimalFound || !digitFound) + return; + decimalFound = true; + n++; + } + else + break; + } + if (digitFound && !isWord(this.peek(n))) { + const num = new NumberToken(this.input, this.p, this.p + n, this.file); + this.advance(n); + return num; + } + } + readLiteral() { + this.skipBlank(); + const end = this.matchTrie(this.literalTrie); + if (end === -1) + return; + const literal = new LiteralToken(this.input, this.p, end, this.file); + this.p = end; + return literal; + } + readRange() { + this.skipBlank(); + const begin = this.p; + if (this.peek() !== '(') + return; + ++this.p; + const lhs = this.readValueOrThrow(); + this.p += 2; + const rhs = this.readValueOrThrow(); + ++this.p; + return new RangeToken(this.input, begin, this.p, lhs, rhs, this.file); + } + readValueOrThrow() { + const value = this.readValue(); + this.assert(value, () => `unexpected token ${this.snapshot()}, value expected`); + return value; + } + readQuoted() { + this.skipBlank(); + const begin = this.p; + if (!(this.peekType() & QUOTE)) + return; + ++this.p; + let escaped = false; + while (this.p < this.N) { + ++this.p; + if (this.input[this.p - 1] === this.input[begin] && !escaped) + break; + if (escaped) + escaped = false; + else if (this.input[this.p - 1] === '\\') + escaped = true; + } + return new QuotedToken(this.input, begin, this.p, this.file); + } + *readFileNameTemplate(options) { + const { outputDelimiterLeft } = options; + const htmlStopStrings = [',', ' ', outputDelimiterLeft]; + const htmlStopStringSet = new Set(htmlStopStrings); + // break on ',' and ' ', outputDelimiterLeft only stops HTML token + while (this.p < this.N && !htmlStopStringSet.has(this.peek())) { + yield this.match(outputDelimiterLeft) + ? this.readOutputToken(options) + : this.readHTMLToken(htmlStopStrings); + } + } + match(word) { + for (let i = 0; i < word.length; i++) { + if (word[i] !== this.input[this.p + i]) + return false; + } + return true; + } + rmatch(pattern) { + for (let i = 0; i < pattern.length; i++) { + if (pattern[pattern.length - 1 - i] !== this.input[this.p - 1 - i]) + return false; + } + return true; + } + peekType(n = 0) { + return this.p + n >= this.N ? 0 : TYPES[this.input.charCodeAt(this.p + n)]; + } + peek(n = 0) { + return this.p + n >= this.N ? '' : this.input[this.p + n]; + } + skipBlank() { + while (this.peekType() & BLANK) + ++this.p; + } +} + +class ParseStream { + constructor(tokens, parseToken) { + this.handlers = {}; + this.stopRequested = false; + this.tokens = tokens; + this.parseToken = parseToken; + } + on(name, cb) { + this.handlers[name] = cb; + return this; + } + trigger(event, arg) { + const h = this.handlers[event]; + return h ? (h.call(this, arg), true) : false; + } + start() { + this.trigger('start'); + let token; + while (!this.stopRequested && (token = this.tokens.shift())) { + if (this.trigger('token', token)) + continue; + if (isTagToken(token) && this.trigger(`tag:${token.name}`, token)) { + continue; + } + const template = this.parseToken(token, this.tokens); + this.trigger('template', template); + } + if (!this.stopRequested) + this.trigger('end'); + return this; + } + stop() { + this.stopRequested = true; + return this; + } +} + +class TemplateImpl { + constructor(token) { + this.token = token; + } +} + +class Tag extends TemplateImpl { + constructor(token, remainTokens, liquid) { + super(token); + this.name = token.name; + this.liquid = liquid; + this.tokenizer = token.tokenizer; + } +} + +/** + * Key-Value Pairs Representing Tag Arguments + * Example: + * For the markup `, foo:'bar', coo:2 reversed %}`, + * hash['foo'] === 'bar' + * hash['coo'] === 2 + * hash['reversed'] === undefined + */ +class Hash { + constructor(markup, jekyllStyle) { + this.hash = {}; + const tokenizer = new Tokenizer(markup, {}); + for (const hash of tokenizer.readHashes(jekyllStyle)) { + this.hash[hash.name.content] = hash.value; + } + } + *render(ctx) { + const hash = {}; + for (const key of Object.keys(this.hash)) { + hash[key] = this.hash[key] === undefined ? true : yield evalToken(this.hash[key], ctx); + } + return hash; + } +} + +function createTagClass(options) { + return class extends Tag { + constructor(token, tokens, liquid) { + super(token, tokens, liquid); + if (isFunction(options.parse)) { + options.parse.call(this, token, tokens); + } + } + *render(ctx, emitter) { + const hash = (yield new Hash(this.token.args).render(ctx)); + return yield options.render.call(this, ctx, emitter, hash); + } + }; +} + +function isKeyValuePair(arr) { + return isArray(arr); +} + +class Filter { + constructor(name, options, args, liquid) { + this.name = name; + this.handler = isFunction(options) + ? options + : (isFunction(options?.handler) ? options.handler : identify); + this.raw = !isFunction(options) && !!options?.raw; + this.args = args; + this.liquid = liquid; + } + *render(value, context) { + const argv = []; + for (const arg of this.args) { + if (isKeyValuePair(arg)) + argv.push([arg[0], yield evalToken(arg[1], context)]); + else + argv.push(yield evalToken(arg, context)); + } + return yield this.handler.apply({ context, liquid: this.liquid }, [value, ...argv]); + } +} + +class Value { + /** + * @param str the value to be valuated, eg.: "foobar" | truncate: 3 + */ + constructor(input, liquid) { + this.filters = []; + const token = typeof input === 'string' + ? new Tokenizer(input, liquid.options.operators).readFilteredValue() + : input; + this.initial = token.initial; + this.filters = token.filters.map(({ name, args }) => new Filter(name, this.getFilter(liquid, name), args, liquid)); + } + *value(ctx, lenient) { + lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default'); + let val = yield this.initial.evaluate(ctx, lenient); + for (const filter of this.filters) { + val = yield filter.render(val, ctx); + } + return val; + } + getFilter(liquid, name) { + const impl = liquid.filters[name]; + assert(impl || !liquid.options.strictFilters, () => `undefined filter: ${name}`); + return impl; + } +} + +class Output extends TemplateImpl { + constructor(token, liquid) { + super(token); + const tokenizer = new Tokenizer(token.input, liquid.options.operators, token.file, token.contentRange); + this.value = new Value(tokenizer.readFilteredValue(), liquid); + const filters = this.value.filters; + const outputEscape = liquid.options.outputEscape; + if (!filters[filters.length - 1]?.raw && outputEscape) { + filters.push(new Filter(toString.call(outputEscape), outputEscape, [], liquid)); + } + } + *render(ctx, emitter) { + const val = yield this.value.value(ctx, false); + emitter.write(val); + } +} + +class HTML extends TemplateImpl { + constructor(token) { + super(token); + this.str = token.getContent(); + } + *render(ctx, emitter) { + emitter.write(this.str); + } +} + +var LookupType; +(function (LookupType) { + LookupType["Partials"] = "partials"; + LookupType["Layouts"] = "layouts"; + LookupType["Root"] = "root"; +})(LookupType || (LookupType = {})); +class Loader { + constructor(options) { + this.options = options; + if (options.relativeReference) { + const sep = options.fs.sep; + assert(sep, '`fs.sep` is required for relative reference'); + const rRelativePath = new RegExp(['.' + sep, '..' + sep, './', '../'].map(prefix => escapeRegex(prefix)).join('|')); + this.shouldLoadRelative = (referencedFile) => rRelativePath.test(referencedFile); + } + else { + this.shouldLoadRelative = (referencedFile) => false; + } + this.contains = this.options.fs.contains || (() => true); + } + *lookup(file, type, sync, currentFile) { + const { fs } = this.options; + const dirs = this.options[type]; + for (const filepath of this.candidates(file, dirs, currentFile, type !== LookupType.Root)) { + if (sync ? fs.existsSync(filepath) : yield fs.exists(filepath)) + return filepath; + } + throw this.lookupError(file, dirs); + } + *candidates(file, dirs, currentFile, enforceRoot) { + const { fs, extname } = this.options; + if (this.shouldLoadRelative(file) && currentFile) { + const referenced = fs.resolve(this.dirname(currentFile), file, extname); + for (const dir of dirs) { + if (!enforceRoot || this.contains(dir, referenced)) { + // the relatively referenced file is within one of root dirs + yield referenced; + break; + } + } + } + for (const dir of dirs) { + const referenced = fs.resolve(dir, file, extname); + if (!enforceRoot || this.contains(dir, referenced)) { + yield referenced; + } + } + if (fs.fallback !== undefined) { + const filepath = fs.fallback(file); + if (filepath !== undefined) + yield filepath; + } + } + dirname(path) { + const fs = this.options.fs; + assert(fs.dirname, '`fs.dirname` is required for relative reference'); + return fs.dirname(path); + } + lookupError(file, roots) { + const err = new Error('ENOENT'); + err.message = `ENOENT: Failed to lookup "${file}" in "${roots}"`; + err.code = 'ENOENT'; + return err; + } +} + +class Parser { + constructor(liquid) { + this.liquid = liquid; + this.cache = this.liquid.options.cache; + this.fs = this.liquid.options.fs; + this.parseFile = this.cache ? this._parseFileCached : this._parseFile; + this.loader = new Loader(this.liquid.options); + } + parse(html, filepath) { + const tokenizer = new Tokenizer(html, this.liquid.options.operators, filepath); + const tokens = tokenizer.readTopLevelTokens(this.liquid.options); + return this.parseTokens(tokens); + } + parseTokens(tokens) { + let token; + const templates = []; + const errors = []; + while ((token = tokens.shift())) { + try { + templates.push(this.parseToken(token, tokens)); + } + catch (err) { + if (this.liquid.options.catchAllErrors) + errors.push(err); + else + throw err; + } + } + if (errors.length) + throw new LiquidErrors(errors); + return templates; + } + parseToken(token, remainTokens) { + try { + if (isTagToken(token)) { + const TagClass = this.liquid.tags[token.name]; + assert(TagClass, `tag "${token.name}" not found`); + return new TagClass(token, remainTokens, this.liquid); + } + if (isOutputToken(token)) { + return new Output(token, this.liquid); + } + return new HTML(token); + } + catch (e) { + if (LiquidError.is(e)) + throw e; + throw new ParseError(e, token); + } + } + parseStream(tokens) { + return new ParseStream(tokens, (token, tokens) => this.parseToken(token, tokens)); + } + *_parseFileCached(file, sync, type = LookupType.Root, currentFile) { + const cache = this.cache; + const key = this.loader.shouldLoadRelative(file) ? currentFile + ',' + file : type + ':' + file; + const tpls = yield cache.read(key); + if (tpls) + return tpls; + const task = this._parseFile(file, sync, type, currentFile); + // sync mode: exec the task and cache the result + // async mode: cache the task before exec + const taskOrTpl = sync ? yield task : toPromise(task); + cache.write(key, taskOrTpl); + // note: concurrent tasks will be reused, cache for failed task is removed until its end + try { + return yield taskOrTpl; + } + catch (err) { + cache.remove(key); + throw err; + } + } + *_parseFile(file, sync, type = LookupType.Root, currentFile) { + const filepath = yield this.loader.lookup(file, type, sync, currentFile); + return this.liquid.parse(sync ? this.fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath); + } +} + +(function (TokenKind) { + TokenKind[TokenKind["Number"] = 1] = "Number"; + TokenKind[TokenKind["Literal"] = 2] = "Literal"; + TokenKind[TokenKind["Tag"] = 4] = "Tag"; + TokenKind[TokenKind["Output"] = 8] = "Output"; + TokenKind[TokenKind["HTML"] = 16] = "HTML"; + TokenKind[TokenKind["Filter"] = 32] = "Filter"; + TokenKind[TokenKind["Hash"] = 64] = "Hash"; + TokenKind[TokenKind["PropertyAccess"] = 128] = "PropertyAccess"; + TokenKind[TokenKind["Word"] = 256] = "Word"; + TokenKind[TokenKind["Range"] = 512] = "Range"; + TokenKind[TokenKind["Quoted"] = 1024] = "Quoted"; + TokenKind[TokenKind["Operator"] = 2048] = "Operator"; + TokenKind[TokenKind["FilteredValue"] = 4096] = "FilteredValue"; + TokenKind[TokenKind["Delimited"] = 12] = "Delimited"; +})(exports.TokenKind || (exports.TokenKind = {})); + +function isDelimitedToken(val) { + return !!(getKind(val) & exports.TokenKind.Delimited); +} +function isOperatorToken(val) { + return getKind(val) === exports.TokenKind.Operator; +} +function isHTMLToken(val) { + return getKind(val) === exports.TokenKind.HTML; +} +function isOutputToken(val) { + return getKind(val) === exports.TokenKind.Output; +} +function isTagToken(val) { + return getKind(val) === exports.TokenKind.Tag; +} +function isQuotedToken(val) { + return getKind(val) === exports.TokenKind.Quoted; +} +function isLiteralToken(val) { + return getKind(val) === exports.TokenKind.Literal; +} +function isNumberToken(val) { + return getKind(val) === exports.TokenKind.Number; +} +function isPropertyAccessToken(val) { + return getKind(val) === exports.TokenKind.PropertyAccess; +} +function isWordToken(val) { + return getKind(val) === exports.TokenKind.Word; +} +function isRangeToken(val) { + return getKind(val) === exports.TokenKind.Range; +} +function getKind(val) { + return val ? val.kind : -1; +} + +var typeGuards = /*#__PURE__*/Object.freeze({ + __proto__: null, + isDelimitedToken: isDelimitedToken, + isOperatorToken: isOperatorToken, + isHTMLToken: isHTMLToken, + isOutputToken: isOutputToken, + isTagToken: isTagToken, + isQuotedToken: isQuotedToken, + isLiteralToken: isLiteralToken, + isNumberToken: isNumberToken, + isPropertyAccessToken: isPropertyAccessToken, + isWordToken: isWordToken, + isRangeToken: isRangeToken +}); + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +class Context { + constructor(env = {}, opts = defaultOptions, renderOptions = {}) { + /** + * insert a Context-level empty scope, + * for tags like `{% capture %}` `{% assign %}` to operate + */ + this.scopes = [{}]; + this.registers = {}; + this.sync = !!renderOptions.sync; + this.opts = opts; + this.globals = renderOptions.globals ?? opts.globals; + this.environments = isObject(env) ? env : Object(env); + this.strictVariables = renderOptions.strictVariables ?? this.opts.strictVariables; + this.ownPropertyOnly = renderOptions.ownPropertyOnly ?? opts.ownPropertyOnly; + } + getRegister(key) { + return (this.registers[key] = this.registers[key] || {}); + } + setRegister(key, value) { + return (this.registers[key] = value); + } + saveRegister(...keys) { + return keys.map(key => [key, this.getRegister(key)]); + } + restoreRegister(keyValues) { + return keyValues.forEach(([key, value]) => this.setRegister(key, value)); + } + getAll() { + return [this.globals, this.environments, ...this.scopes] + .reduce((ctx, val) => __assign(ctx, val), {}); + } + /** + * @deprecated use `_get()` or `getSync()` instead + */ + get(paths) { + return this.getSync(paths); + } + getSync(paths) { + return toValueSync(this._get(paths)); + } + *_get(paths) { + const scope = this.findScope(paths[0]); + return yield this._getFromScope(scope, paths); + } + /** + * @deprecated use `_get()` instead + */ + getFromScope(scope, paths) { + return toValueSync(this._getFromScope(scope, paths)); + } + *_getFromScope(scope, paths, strictVariables = this.strictVariables) { + if (isString(paths)) + paths = paths.split('.'); + for (let i = 0; i < paths.length; i++) { + scope = yield readProperty(scope, paths[i], this.ownPropertyOnly); + if (strictVariables && isUndefined(scope)) { + throw new InternalUndefinedVariableError(paths.slice(0, i + 1).join('.')); + } + } + return scope; + } + push(ctx) { + return this.scopes.push(ctx); + } + pop() { + return this.scopes.pop(); + } + bottom() { + return this.scopes[0]; + } + findScope(key) { + for (let i = this.scopes.length - 1; i >= 0; i--) { + const candidate = this.scopes[i]; + if (key in candidate) + return candidate; + } + if (key in this.environments) + return this.environments; + return this.globals; + } +} +function readProperty(obj, key, ownPropertyOnly) { + obj = toLiquid(obj); + if (isNil(obj)) + return obj; + if (isArray(obj) && key < 0) + return obj[obj.length + +key]; + const value = readJSProperty(obj, key, ownPropertyOnly); + if (value === undefined && obj instanceof Drop) + return obj.liquidMethodMissing(key); + if (isFunction(value)) + return value.call(obj); + if (key === 'size') + return readSize(obj); + else if (key === 'first') + return readFirst(obj); + else if (key === 'last') + return readLast(obj); + return value; +} +function readJSProperty(obj, key, ownPropertyOnly) { + if (ownPropertyOnly && !Object.hasOwnProperty.call(obj, key) && !(obj instanceof Drop)) + return undefined; + return obj[key]; +} +function readFirst(obj) { + if (isArray(obj)) + return obj[0]; + return obj['first']; +} +function readLast(obj) { + if (isArray(obj)) + return obj[obj.length - 1]; + return obj['last']; +} +function readSize(obj) { + if (obj.hasOwnProperty('size') || obj['size'] !== undefined) + return obj['size']; + if (isArray(obj) || isString(obj)) + return obj.length; + if (typeof obj === 'object') + return Object.keys(obj).length; +} + +var BlockMode; +(function (BlockMode) { + /* store rendered html into blocks */ + BlockMode[BlockMode["OUTPUT"] = 0] = "OUTPUT"; + /* output rendered html directly */ + BlockMode[BlockMode["STORE"] = 1] = "STORE"; +})(BlockMode || (BlockMode = {})); + +const abs = argumentsToValue(Math.abs); +const at_least = argumentsToValue(Math.max); +const at_most = argumentsToValue(Math.min); +const ceil = argumentsToValue(Math.ceil); +const divided_by = argumentsToValue((dividend, divisor, integerArithmetic = false) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor); +const floor = argumentsToValue(Math.floor); +const minus = argumentsToValue((v, arg) => v - arg); +const modulo = argumentsToValue((v, arg) => v % arg); +const times = argumentsToValue((v, arg) => v * arg); +function round(v, arg = 0) { + v = toValue(v); + arg = toValue(arg); + const amp = Math.pow(10, arg); + return Math.round(v * amp) / amp; +} +function plus(v, arg) { + v = toValue(v); + arg = toValue(arg); + return Number(v) + Number(arg); +} + +var mathFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + abs: abs, + at_least: at_least, + at_most: at_most, + ceil: ceil, + divided_by: divided_by, + floor: floor, + minus: minus, + modulo: modulo, + times: times, + round: round, + plus: plus +}); + +const url_decode = (x) => decodeURIComponent(stringify(x)).replace(/\+/g, ' '); +const url_encode = (x) => encodeURIComponent(stringify(x)).replace(/%20/g, '+'); +const cgi_escape = (x) => encodeURIComponent(stringify(x)) + .replace(/%20/g, '+') + .replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase()); +const uri_escape = (x) => encodeURI(stringify(x)) + .replace(/%5B/g, '[') + .replace(/%5D/g, ']'); +const rSlugifyDefault = /[^\p{M}\p{L}\p{Nd}]+/ug; +const rSlugifyReplacers = { + 'raw': /\s+/g, + 'default': rSlugifyDefault, + 'pretty': /[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/ug, + 'ascii': /[^A-Za-z0-9]+/g, + 'latin': rSlugifyDefault, + 'none': null +}; +function slugify(str, mode = 'default', cased = false) { + str = stringify(str); + const replacer = rSlugifyReplacers[mode]; + if (replacer) { + if (mode === 'latin') + str = removeAccents(str); + str = str.replace(replacer, '-').replace(/^-|-$/g, ''); + } + return cased ? str : str.toLowerCase(); +} +function removeAccents(str) { + return str.replace(/[àáâãäå]/g, 'a') + .replace(/[æ]/g, 'ae') + .replace(/[ç]/g, 'c') + .replace(/[èéêë]/g, 'e') + .replace(/[ìíîï]/g, 'i') + .replace(/[ð]/g, 'd') + .replace(/[ñ]/g, 'n') + .replace(/[òóôõöø]/g, 'o') + .replace(/[ùúûü]/g, 'u') + .replace(/[ýÿ]/g, 'y') + .replace(/[ß]/g, 'ss') + .replace(/[œ]/g, 'oe') + .replace(/[þ]/g, 'th') + .replace(/[ẞ]/g, 'SS') + .replace(/[Œ]/g, 'OE') + .replace(/[Þ]/g, 'TH'); +} + +var urlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + url_decode: url_decode, + url_encode: url_encode, + cgi_escape: cgi_escape, + uri_escape: uri_escape, + slugify: slugify +}); + +const join = argumentsToValue((v, arg) => toArray(v).join(arg === undefined ? ' ' : arg)); +const last$1 = argumentsToValue((v) => isArray(v) ? last(v) : ''); +const first = argumentsToValue((v) => isArray(v) ? v[0] : ''); +const reverse = argumentsToValue((v) => [...toArray(v)].reverse()); +function* sort(arr, property) { + const values = []; + for (const item of toArray(arr)) { + values.push([ + item, + property ? yield this.context._getFromScope(item, stringify(property).split('.'), false) : item + ]); + } + return values.sort((lhs, rhs) => { + const lvalue = lhs[1]; + const rvalue = rhs[1]; + return lvalue < rvalue ? -1 : (lvalue > rvalue ? 1 : 0); + }).map(tuple => tuple[0]); +} +function sort_natural(input, property) { + const propertyString = stringify(property); + const compare = property === undefined + ? caseInsensitiveCompare + : (lhs, rhs) => caseInsensitiveCompare(lhs[propertyString], rhs[propertyString]); + return [...toArray(input)].sort(compare); +} +const size = (v) => (v && v.length) || 0; +function* map(arr, property) { + const results = []; + for (const item of toArray(arr)) { + results.push(yield this.context._getFromScope(item, stringify(property), false)); + } + return results; +} +function* sum(arr, property) { + let sum = 0; + for (const item of toArray(arr)) { + const data = Number(property ? yield this.context._getFromScope(item, stringify(property), false) : item); + sum += Number.isNaN(data) ? 0 : data; + } + return sum; +} +function compact(arr) { + return toArray(arr).filter(x => !isNil(toValue(x))); +} +function concat(v, arg = []) { + return toArray(v).concat(toArray(arg)); +} +function push(v, arg) { + return concat(v, [arg]); +} +function unshift(v, arg) { + const clone = [...toArray(v)]; + clone.unshift(arg); + return clone; +} +function pop(v) { + const clone = [...toArray(v)]; + clone.pop(); + return clone; +} +function shift(v) { + const clone = [...toArray(v)]; + clone.shift(); + return clone; +} +function slice(v, begin, length = 1) { + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + begin = begin < 0 ? v.length + begin : begin; + return v.slice(begin, begin + length); +} +function* where(arr, property, expected) { + const values = []; + arr = toArray(arr); + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of arr) { + values.push(yield evalToken(token, new Context(item))); + } + return arr.filter((_, i) => { + if (expected === undefined) + return isTruthy(values[i], this.context); + return equals(values[i], expected); + }); +} +function* where_exp(arr, itemName, exp) { + const filtered = []; + const keyTemplate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const value = yield keyTemplate.value(new Context({ [itemName]: item })); + if (value) + filtered.push(item); + } + return filtered; +} +function* group_by(arr, property) { + const map = new Map(); + arr = toArray(arr); + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of arr) { + const key = yield evalToken(token, new Context(item)); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + } + return [...map.entries()].map(([name, items]) => ({ name, items })); +} +function* group_by_exp(arr, itemName, exp) { + const map = new Map(); + const keyTemplate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const key = yield keyTemplate.value(new Context({ [itemName]: item })); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + } + return [...map.entries()].map(([name, items]) => ({ name, items })); +} +function* find(arr, property, expected) { + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of toArray(arr)) { + const value = yield evalToken(token, new Context(item)); + if (equals(value, expected)) + return item; + } + return null; +} +function* find_exp(arr, itemName, exp) { + const predicate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const value = yield predicate.value(new Context({ [itemName]: item })); + if (value) + return item; + } + return null; +} +function uniq(arr) { + arr = toValue(arr); + const u = {}; + return (arr || []).filter(val => { + if (hasOwnProperty.call(u, String(val))) + return false; + u[String(val)] = true; + return true; + }); +} +function sample(v, count = 1) { + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + const shuffled = [...v].sort(() => Math.random() - 0.5); + if (count === 1) + return shuffled[0]; + return shuffled.slice(0, count); +} + +var arrayFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + join: join, + last: last$1, + first: first, + reverse: reverse, + sort: sort, + sort_natural: sort_natural, + size: size, + map: map, + sum: sum, + compact: compact, + concat: concat, + push: push, + unshift: unshift, + pop: pop, + shift: shift, + slice: slice, + where: where, + where_exp: where_exp, + group_by: group_by, + group_by_exp: group_by_exp, + find: find, + find_exp: find_exp, + uniq: uniq, + sample: sample +}); + +function date(v, format, timezoneOffset) { + const date = parseDate(v, this.context.opts, timezoneOffset); + if (!date) + return v; + format = toValue(format); + format = isNil(format) ? this.context.opts.dateFormat : stringify(format); + return strftime(date, format); +} +function date_to_xmlschema(v) { + return date.call(this, v, '%Y-%m-%dT%H:%M:%S%:z'); +} +function date_to_rfc822(v) { + return date.call(this, v, '%a, %d %b %Y %H:%M:%S %z'); +} +function date_to_string(v, type, style) { + return stringify_date.call(this, v, '%b', type, style); +} +function date_to_long_string(v, type, style) { + return stringify_date.call(this, v, '%B', type, style); +} +function stringify_date(v, month_type, type, style) { + const date = parseDate(v, this.context.opts); + if (!date) + return v; + if (type === 'ordinal') { + const d = date.getDate(); + return style === 'US' + ? strftime(date, `${month_type} ${d}%q, %Y`) + : strftime(date, `${d}%q ${month_type} %Y`); + } + return strftime(date, `%d ${month_type} %Y`); +} +function parseDate(v, opts, timezoneOffset) { + let date; + v = toValue(v); + if (v === 'now' || v === 'today') { + date = new Date(); + } + else if (isNumber(v)) { + date = new Date(v * 1000); + } + else if (isString(v)) { + if (/^\d+$/.test(v)) { + date = new Date(+v * 1000); + } + else if (opts.preserveTimezones) { + date = TimezoneDate.createDateFixedToTimezone(v); + } + else { + date = new Date(v); + } + } + else { + date = v; + } + if (!isValidDate(date)) + return; + if (timezoneOffset !== undefined) { + date = new TimezoneDate(date, timezoneOffset); + } + else if (!(date instanceof TimezoneDate) && opts.timezoneOffset !== undefined) { + date = new TimezoneDate(date, opts.timezoneOffset); + } + return date; +} +function isValidDate(date) { + return (date instanceof Date || date instanceof TimezoneDate) && !isNaN(date.getTime()); +} + +var dateFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + date: date, + date_to_xmlschema: date_to_xmlschema, + date_to_rfc822: date_to_rfc822, + date_to_string: date_to_string, + date_to_long_string: date_to_long_string +}); + +/** + * String related filters + * + * * prefer stringify() to String() since `undefined`, `null` should eval '' + */ +const rCJKWord = /[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu; +// Word boundary followed by word characters (for detecting words) +const rNonCJKWord = /[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu; +function append(v, arg) { + assert(arguments.length === 2, 'append expect 2 arguments'); + return stringify(v) + stringify(arg); +} +function prepend(v, arg) { + assert(arguments.length === 2, 'prepend expect 2 arguments'); + return stringify(arg) + stringify(v); +} +function lstrip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v).replace(new RegExp(`^[${chars}]+`, 'g'), ''); + } + return stringify(v).replace(/^\s+/, ''); +} +function downcase(v) { + return stringify(v).toLowerCase(); +} +function upcase(str) { + return stringify(str).toUpperCase(); +} +function remove(v, arg) { + return stringify(v).split(stringify(arg)).join(''); +} +function remove_first(v, l) { + return stringify(v).replace(stringify(l), ''); +} +function remove_last(v, l) { + const str = stringify(v); + const pattern = stringify(l); + const index = str.lastIndexOf(pattern); + if (index === -1) + return str; + return str.substring(0, index) + str.substring(index + pattern.length); +} +function rstrip(str, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(str).replace(new RegExp(`[${chars}]+$`, 'g'), ''); + } + return stringify(str).replace(/\s+$/, ''); +} +function split(v, arg) { + const arr = stringify(v).split(stringify(arg)); + // align to ruby split, which is the behavior of shopify/liquid + // see: https://ruby-doc.org/core-2.4.0/String.html#method-i-split + while (arr.length && arr[arr.length - 1] === '') + arr.pop(); + return arr; +} +function strip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v) + .replace(new RegExp(`^[${chars}]+`, 'g'), '') + .replace(new RegExp(`[${chars}]+$`, 'g'), ''); + } + return stringify(v).trim(); +} +function strip_newlines(v) { + return stringify(v).replace(/\r?\n/gm, ''); +} +function capitalize(str) { + str = stringify(str); + return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); +} +function replace(v, pattern, replacement) { + return stringify(v).split(stringify(pattern)).join(replacement); +} +function replace_first(v, arg1, arg2) { + return stringify(v).replace(stringify(arg1), arg2); +} +function replace_last(v, arg1, arg2) { + const str = stringify(v); + const pattern = stringify(arg1); + const index = str.lastIndexOf(pattern); + if (index === -1) + return str; + const replacement = stringify(arg2); + return str.substring(0, index) + replacement + str.substring(index + pattern.length); +} +function truncate(v, l = 50, o = '...') { + v = stringify(v); + if (v.length <= l) + return v; + return v.substring(0, l - o.length) + o; +} +function truncatewords(v, words = 15, o = '...') { + const arr = stringify(v).split(/\s+/); + if (words <= 0) + words = 1; + let ret = arr.slice(0, words).join(' '); + if (arr.length >= words) + ret += o; + return ret; +} +function normalize_whitespace(v) { + v = stringify(v); + return v.replace(/\s+/g, ' '); +} +function number_of_words(input, mode) { + input = stringify(input).trim(); + if (!input) + return 0; + switch (mode) { + case 'cjk': + // Count CJK characters and words + return (input.match(rCJKWord) || []).length + (input.match(rNonCJKWord) || []).length; + case 'auto': + // Count CJK characters, if none, count words + return rCJKWord.test(input) + ? input.match(rCJKWord).length + (input.match(rNonCJKWord) || []).length + : input.split(/\s+/).length; + default: + // Count words only + return input.split(/\s+/).length; + } +} +function array_to_sentence_string(array, connector = 'and') { + switch (array.length) { + case 0: + return ''; + case 1: + return array[0]; + case 2: + return `${array[0]} ${connector} ${array[1]}`; + default: + return `${array.slice(0, -1).join(', ')}, ${connector} ${array[array.length - 1]}`; + } +} + +var stringFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + append: append, + prepend: prepend, + lstrip: lstrip, + downcase: downcase, + upcase: upcase, + remove: remove, + remove_first: remove_first, + remove_last: remove_last, + rstrip: rstrip, + split: split, + strip: strip, + strip_newlines: strip_newlines, + capitalize: capitalize, + replace: replace, + replace_first: replace_first, + replace_last: replace_last, + truncate: truncate, + truncatewords: truncatewords, + normalize_whitespace: normalize_whitespace, + number_of_words: number_of_words, + array_to_sentence_string: array_to_sentence_string +}); + +const filters = { + ...htmlFilters, + ...mathFilters, + ...urlFilters, + ...arrayFilters, + ...dateFilters, + ...stringFilters, + ...misc +}; + +class AssignTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.key = this.tokenizer.readIdentifier().content; + this.tokenizer.assert(this.key, 'expected variable name'); + this.tokenizer.skipBlank(); + this.tokenizer.assert(this.tokenizer.peek() === '=', 'expected "="'); + this.tokenizer.advance(); + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + } + *render(ctx) { + ctx.bottom()[this.key] = yield this.value.value(ctx, this.liquid.options.lenientIf); + } +} + +const MODIFIERS = ['offset', 'limit', 'reversed']; +class ForTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const variable = this.tokenizer.readIdentifier(); + const inStr = this.tokenizer.readIdentifier(); + const collection = this.tokenizer.readValue(); + if (!variable.size() || inStr.content !== 'in' || !collection) { + throw new Error(`illegal tag: ${token.getText()}`); + } + this.variable = variable.content; + this.collection = collection; + this.hash = new Hash(this.tokenizer.remaining()); + this.templates = []; + this.elseTemplates = []; + let p; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('start', () => (p = this.templates)) + .on('tag:else', () => (p = this.elseTemplates)) + .on('tag:endfor', () => stream.stop()) + .on('template', (tpl) => p.push(tpl)) + .on('end', () => { + throw new Error(`tag ${token.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + let collection = toEnumerable(yield evalToken(this.collection, ctx)); + if (!collection.length) { + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + return; + } + const continueKey = 'continue-' + this.variable + '-' + this.collection.getText(); + ctx.push({ continue: ctx.getRegister(continueKey) }); + const hash = yield this.hash.render(ctx); + ctx.pop(); + const modifiers = this.liquid.options.orderedFilterParameters + ? Object.keys(hash).filter(x => MODIFIERS.includes(x)) + : MODIFIERS.filter(x => hash[x] !== undefined); + collection = modifiers.reduce((collection, modifier) => { + if (modifier === 'offset') + return offset(collection, hash['offset']); + if (modifier === 'limit') + return limit(collection, hash['limit']); + return reversed(collection); + }, collection); + ctx.setRegister(continueKey, (hash['offset'] || 0) + collection.length); + const scope = { forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) }; + ctx.push(scope); + for (const item of collection) { + scope[this.variable] = item; + yield r.renderTemplates(this.templates, ctx, emitter); + if (emitter['break']) { + emitter['break'] = false; + break; + } + emitter['continue'] = false; + scope.forloop.next(); + } + ctx.pop(); + } +} +function reversed(arr) { + return [...arr].reverse(); +} +function offset(arr, count) { + return arr.slice(count); +} +function limit(arr, count) { + return arr.slice(0, count); +} + +class CaptureTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.templates = []; + this.variable = this.readVariableName(); + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcapture') + return; + this.templates.push(liquid.parser.parseToken(token, remainTokens)); + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + *render(ctx) { + const r = this.liquid.renderer; + const html = yield r.renderTemplates(this.templates, ctx); + ctx.bottom()[this.variable] = html; + } + readVariableName() { + const word = this.tokenizer.readIdentifier().content; + if (word) + return word; + const quoted = this.tokenizer.readQuoted(); + if (quoted) + return evalQuotedToken(quoted); + throw this.tokenizer.error('invalid capture name'); + } +} + +class CaseTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + this.elseTemplates = []; + let p = []; + let elseCount = 0; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('tag:when', (token) => { + if (elseCount > 0) { + return; + } + p = []; + const values = []; + while (!token.tokenizer.end()) { + values.push(token.tokenizer.readValueOrThrow()); + token.tokenizer.skipBlank(); + if (token.tokenizer.peek() === ',') { + token.tokenizer.readTo(','); + } + else { + token.tokenizer.readTo('or'); + } + } + this.branches.push({ + values, + templates: p + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endcase', () => stream.stop()) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { + throw new Error(`tag ${tagToken.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + const target = toValue(yield this.value.value(ctx, ctx.opts.lenientIf)); + let branchHit = false; + for (const branch of this.branches) { + for (const valueToken of branch.values) { + const value = yield evalToken(valueToken, ctx, ctx.opts.lenientIf); + if (equals(target, value)) { + yield r.renderTemplates(branch.templates, ctx, emitter); + branchHit = true; + break; + } + } + } + if (!branchHit) { + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } + } +} + +class CommentTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcomment') + return; + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + render() { } +} + +class RenderTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const tokenizer = this.tokenizer; + this.file = parseFilePath(tokenizer, this.liquid); + this.currentFile = token.file; + while (!tokenizer.end()) { + tokenizer.skipBlank(); + const begin = tokenizer.p; + const keyword = tokenizer.readIdentifier(); + if (keyword.content === 'with' || keyword.content === 'for') { + tokenizer.skipBlank(); + // can be normal key/value pair, like "with: true" + if (tokenizer.peek() !== ':') { + const value = tokenizer.readValue(); + // can be normal key, like "with," + if (value) { + const beforeAs = tokenizer.p; + const asStr = tokenizer.readIdentifier(); + let alias; + if (asStr.content === 'as') + alias = tokenizer.readIdentifier(); + else + tokenizer.p = beforeAs; + this[keyword.content] = { value, alias: alias && alias.content }; + tokenizer.skipBlank(); + if (tokenizer.peek() === ',') + tokenizer.advance(); + continue; // matched! + } + } + } + /** + * restore cursor if with/for not matched + */ + tokenizer.p = begin; + break; + } + this.hash = new Hash(tokenizer.remaining()); + } + *render(ctx, emitter) { + const { liquid, hash } = this; + const filepath = (yield renderFilePath(this['file'], ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables }); + const scope = childCtx.bottom(); + __assign(scope, yield hash.render(ctx)); + if (this['with']) { + const { value, alias } = this['with']; + scope[alias || filepath] = yield evalToken(value, ctx); + } + if (this['for']) { + const { value, alias } = this['for']; + const collection = toEnumerable(yield evalToken(value, ctx)); + scope['forloop'] = new ForloopDrop(collection.length, value.getText(), alias); + for (const item of collection) { + scope[alias] = item; + const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])); + yield liquid.renderer.renderTemplates(templates, childCtx, emitter); + scope['forloop'].next(); + } + } + else { + const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])); + yield liquid.renderer.renderTemplates(templates, childCtx, emitter); + } + } +} +/** + * @return null for "none", + * @return Template[] for quoted with tags and/or filters + * @return Token for expression (not quoted) + * @throws TypeError if cannot read next token + */ +function parseFilePath(tokenizer, liquid) { + if (liquid.options.dynamicPartials) { + const file = tokenizer.readValue(); + tokenizer.assert(file, 'illegal file path'); + if (file.getText() === 'none') + return; + if (isQuotedToken(file)) { + // for filenames like "files/{{file}}", eval as liquid template + const templates = liquid.parse(evalQuotedToken(file)); + return optimize(templates); + } + return file; + } + const tokens = [...tokenizer.readFileNameTemplate(liquid.options)]; + const templates = optimize(liquid.parser.parseTokens(tokens)); + return templates === 'none' ? undefined : templates; +} +function optimize(templates) { + // for filenames like "files/file.liquid", extract the string directly + if (templates.length === 1 && isHTMLToken(templates[0].token)) + return templates[0].token.getContent(); + return templates; +} +function* renderFilePath(file, ctx, liquid) { + if (typeof file === 'string') + return file; + if (Array.isArray(file)) + return liquid.renderer.renderTemplates(file, ctx); + return yield evalToken(file, ctx); +} + +class IncludeTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const { tokenizer } = token; + this['file'] = parseFilePath(tokenizer, this.liquid); + this['currentFile'] = token.file; + const begin = tokenizer.p; + const withStr = tokenizer.readIdentifier(); + if (withStr.content === 'with') { + tokenizer.skipBlank(); + if (tokenizer.peek() !== ':') { + this.withVar = tokenizer.readValue(); + } + else + tokenizer.p = begin; + } + else + tokenizer.p = begin; + this.hash = new Hash(tokenizer.remaining(), this.liquid.options.jekyllInclude); + } + *render(ctx, emitter) { + const { liquid, hash, withVar } = this; + const { renderer } = liquid; + const filepath = (yield renderFilePath(this['file'], ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const saved = ctx.saveRegister('blocks', 'blockMode'); + ctx.setRegister('blocks', {}); + ctx.setRegister('blockMode', BlockMode.OUTPUT); + const scope = (yield hash.render(ctx)); + if (withVar) + scope[filepath] = yield evalToken(withVar, ctx); + const templates = (yield liquid._parsePartialFile(filepath, ctx.sync, this['currentFile'])); + ctx.push(ctx.opts.jekyllInclude ? { include: scope } : scope); + yield renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + ctx.restoreRegister(saved); + } +} + +class DecrementTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.variable = this.tokenizer.readIdentifier().content; + } + render(context, emitter) { + const scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + emitter.write(stringify(--scope[this.variable])); + } +} + +class CycleTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.candidates = []; + const group = this.tokenizer.readValue(); + this.tokenizer.skipBlank(); + if (group) { + if (this.tokenizer.peek() === ':') { + this.group = group; + this.tokenizer.advance(); + } + else + this.candidates.push(group); + } + while (!this.tokenizer.end()) { + const value = this.tokenizer.readValue(); + if (value) + this.candidates.push(value); + this.tokenizer.readTo(','); + } + this.tokenizer.assert(this.candidates.length, () => `empty candidates: "${token.getText()}"`); + } + *render(ctx, emitter) { + const group = (yield evalToken(this.group, ctx)); + const fingerprint = `cycle:${group}:` + this.candidates.join(','); + const groups = ctx.getRegister('cycle'); + let idx = groups[fingerprint]; + if (idx === undefined) { + idx = groups[fingerprint] = 0; + } + const candidate = this.candidates[idx]; + idx = (idx + 1) % this.candidates.length; + groups[fingerprint] = idx; + return yield evalToken(candidate, ctx); + } +} + +class IfTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + let p = []; + let elseCount = 0; + liquid.parser.parseStream(remainTokens) + .on('start', () => this.branches.push({ + value: new Value(tagToken.args, this.liquid), + templates: (p = []) + })) + .on('tag:elsif', (token) => { + if (elseCount > 0) { + p = []; + return; + } + this.branches.push({ + value: new Value(token.args, this.liquid), + templates: (p = []) + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endif', function () { this.stop(); }) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`); }) + .start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + for (const { value, templates } of this.branches) { + const v = yield value.value(ctx, ctx.opts.lenientIf); + if (isTruthy(v, ctx)) { + yield r.renderTemplates(templates, ctx, emitter); + return; + } + } + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } +} + +class IncrementTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.variable = this.tokenizer.readIdentifier().content; + } + render(context, emitter) { + const scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + const val = scope[this.variable]; + scope[this.variable]++; + emitter.write(stringify(val)); + } +} + +class LayoutTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.file = parseFilePath(this.tokenizer, this.liquid); + this['currentFile'] = token.file; + this.args = new Hash(this.tokenizer.remaining()); + this.templates = this.liquid.parser.parseTokens(remainTokens); + } + *render(ctx, emitter) { + const { liquid, args, file } = this; + const { renderer } = liquid; + if (file === undefined) { + ctx.setRegister('blockMode', BlockMode.OUTPUT); + yield renderer.renderTemplates(this.templates, ctx, emitter); + return; + } + const filepath = (yield renderFilePath(this.file, ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const templates = (yield liquid._parseLayoutFile(filepath, ctx.sync, this['currentFile'])); + // render remaining contents and store rendered results + ctx.setRegister('blockMode', BlockMode.STORE); + const html = yield renderer.renderTemplates(this.templates, ctx); + const blocks = ctx.getRegister('blocks'); + // set whole content to anonymous block if anonymous doesn't specified + if (blocks[''] === undefined) + blocks[''] = (parent, emitter) => emitter.write(html); + ctx.setRegister('blockMode', BlockMode.OUTPUT); + // render the layout file use stored blocks + ctx.push((yield args.render(ctx))); + yield renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + } +} + +class BlockTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.templates = []; + const match = /\w+/.exec(token.args); + this.block = match ? match[0] : ''; + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endblock') + return; + const template = liquid.parser.parseToken(token, remainTokens); + this.templates.push(template); + } + throw new Error(`tag ${token.getText()} not closed`); + } + *render(ctx, emitter) { + const blockRender = this.getBlockRender(ctx); + if (ctx.getRegister('blockMode') === BlockMode.STORE) { + ctx.getRegister('blocks')[this.block] = blockRender; + } + else { + yield blockRender(new BlockDrop(), emitter); + } + } + getBlockRender(ctx) { + const { liquid, templates } = this; + const renderChild = ctx.getRegister('blocks')[this.block]; + const renderCurrent = function* (superBlock, emitter) { + // add {{ block.super }} support when rendering + ctx.push({ block: superBlock }); + yield liquid.renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + }; + return renderChild + ? (superBlock, emitter) => renderChild(new BlockDrop(() => renderCurrent(superBlock, emitter)), emitter) + : renderCurrent; + } +} + +class RawTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.tokens = []; + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endraw') + return; + this.tokens.push(token); + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + render() { + return this.tokens.map((token) => token.getText()).join(''); + } +} + +class TablerowloopDrop extends ForloopDrop { + constructor(length, cols, collection, variable) { + super(length, collection, variable); + this.length = length; + this.cols = cols; + } + row() { + return Math.floor(this.i / this.cols) + 1; + } + col0() { + return (this.i % this.cols); + } + col() { + return this.col0() + 1; + } + col_first() { + return this.col0() === 0; + } + col_last() { + return this.col() === this.cols; + } +} + +class TablerowTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + const variable = this.tokenizer.readIdentifier(); + this.tokenizer.skipBlank(); + const predicate = this.tokenizer.readIdentifier(); + const collectionToken = this.tokenizer.readValue(); + if (predicate.content !== 'in' || !collectionToken) { + throw new Error(`illegal tag: ${tagToken.getText()}`); + } + this.variable = variable.content; + this.collection = collectionToken; + this.args = new Hash(this.tokenizer.remaining()); + this.templates = []; + let p; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('start', () => (p = this.templates)) + .on('tag:endtablerow', () => stream.stop()) + .on('template', (tpl) => p.push(tpl)) + .on('end', () => { + throw new Error(`tag ${tagToken.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + let collection = toEnumerable(yield evalToken(this.collection, ctx)); + const args = (yield this.args.render(ctx)); + const offset = args.offset || 0; + const limit = (args.limit === undefined) ? collection.length : args.limit; + collection = collection.slice(offset, offset + limit); + const cols = args.cols || collection.length; + const r = this.liquid.renderer; + const tablerowloop = new TablerowloopDrop(collection.length, cols, this.collection.getText(), this.variable); + const scope = { tablerowloop }; + ctx.push(scope); + for (let idx = 0; idx < collection.length; idx++, tablerowloop.next()) { + scope[this.variable] = collection[idx]; + if (tablerowloop.col0() === 0) { + if (tablerowloop.row() !== 1) + emitter.write(''); + emitter.write(``); + } + emitter.write(``); + yield r.renderTemplates(this.templates, ctx, emitter); + emitter.write(''); + } + if (collection.length) + emitter.write(''); + ctx.pop(); + } +} + +class UnlessTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + let p = []; + let elseCount = 0; + this.liquid.parser.parseStream(remainTokens) + .on('start', () => this.branches.push({ + value: new Value(tagToken.args, this.liquid), + test: isFalsy, + templates: (p = []) + })) + .on('tag:elsif', (token) => { + if (elseCount > 0) { + p = []; + return; + } + this.branches.push({ + value: new Value(token.args, this.liquid), + test: isTruthy, + templates: (p = []) + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endunless', function () { this.stop(); }) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`); }) + .start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + for (const { value, test, templates } of this.branches) { + const v = yield value.value(ctx, ctx.opts.lenientIf); + if (test(v, ctx)) { + yield r.renderTemplates(templates, ctx, emitter); + return; + } + } + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } +} + +class BreakTag extends Tag { + render(ctx, emitter) { + emitter['break'] = true; + } +} + +class ContinueTag extends Tag { + render(ctx, emitter) { + emitter['continue'] = true; + } +} + +class EchoTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.tokenizer.skipBlank(); + if (!this.tokenizer.end()) { + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + } + } + *render(ctx, emitter) { + if (!this.value) + return; + const val = yield this.value.value(ctx, false); + emitter.write(val); + } +} + +class LiquidTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const tokens = this.tokenizer.readLiquidTagTokens(this.liquid.options); + this.templates = this.liquid.parser.parseTokens(tokens); + } + *render(ctx, emitter) { + yield this.liquid.renderer.renderTemplates(this.templates, ctx, emitter); + } +} + +class InlineCommentTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + if (tagToken.args.search(/\n\s*[^#\s]/g) !== -1) { + throw new Error('every line of an inline comment must start with a \'#\' character'); + } + } + render() { } +} + +const tags = { + assign: AssignTag, + 'for': ForTag, + capture: CaptureTag, + 'case': CaseTag, + comment: CommentTag, + include: IncludeTag, + render: RenderTag, + decrement: DecrementTag, + increment: IncrementTag, + cycle: CycleTag, + 'if': IfTag, + layout: LayoutTag, + block: BlockTag, + raw: RawTag, + tablerow: TablerowTag, + unless: UnlessTag, + 'break': BreakTag, + 'continue': ContinueTag, + echo: EchoTag, + liquid: LiquidTag, + '#': InlineCommentTag +}; + +class Liquid { + constructor(opts = {}) { + this.renderer = new Render(); + this.filters = {}; + this.tags = {}; + this.options = normalize(opts); + this.parser = new Parser(this); + forOwn(tags, (conf, name) => this.registerTag(name, conf)); + forOwn(filters, (handler, name) => this.registerFilter(name, handler)); + } + parse(html, filepath) { + return this.parser.parse(html, filepath); + } + _render(tpl, scope, renderOptions) { + const ctx = scope instanceof Context ? scope : new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplates(tpl, ctx); + } + async render(tpl, scope, renderOptions) { + return toPromise(this._render(tpl, scope, { ...renderOptions, sync: false })); + } + renderSync(tpl, scope, renderOptions) { + return toValueSync(this._render(tpl, scope, { ...renderOptions, sync: true })); + } + renderToNodeStream(tpl, scope, renderOptions = {}) { + const ctx = new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplatesToNodeStream(tpl, ctx); + } + _parseAndRender(html, scope, renderOptions) { + const tpl = this.parse(html); + return this._render(tpl, scope, renderOptions); + } + async parseAndRender(html, scope, renderOptions) { + return toPromise(this._parseAndRender(html, scope, { ...renderOptions, sync: false })); + } + parseAndRenderSync(html, scope, renderOptions) { + return toValueSync(this._parseAndRender(html, scope, { ...renderOptions, sync: true })); + } + _parsePartialFile(file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Partials, currentFile); + } + _parseLayoutFile(file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile); + } + _parseFile(file, sync, lookupType, currentFile) { + return this.parser.parseFile(file, sync, lookupType, currentFile); + } + async parseFile(file, lookupType) { + return toPromise(this.parser.parseFile(file, false, lookupType)); + } + parseFileSync(file, lookupType) { + return toValueSync(this.parser.parseFile(file, true, lookupType)); + } + *_renderFile(file, ctx, renderFileOptions) { + const templates = (yield this._parseFile(file, renderFileOptions.sync, renderFileOptions.lookupType)); + return yield this._render(templates, ctx, renderFileOptions); + } + async renderFile(file, ctx, renderFileOptions) { + return toPromise(this._renderFile(file, ctx, { ...renderFileOptions, sync: false })); + } + renderFileSync(file, ctx, renderFileOptions) { + return toValueSync(this._renderFile(file, ctx, { ...renderFileOptions, sync: true })); + } + async renderFileToNodeStream(file, scope, renderOptions) { + const templates = await this.parseFile(file); + return this.renderToNodeStream(templates, scope, renderOptions); + } + _evalValue(str, scope) { + const value = new Value(str, this); + const ctx = scope instanceof Context ? scope : new Context(scope, this.options); + return value.value(ctx); + } + async evalValue(str, scope) { + return toPromise(this._evalValue(str, scope)); + } + evalValueSync(str, scope) { + return toValueSync(this._evalValue(str, scope)); + } + registerFilter(name, filter) { + this.filters[name] = filter; + } + registerTag(name, tag) { + this.tags[name] = isFunction(tag) ? tag : createTagClass(tag); + } + plugin(plugin) { + return plugin.call(this, Liquid); + } + express() { + const self = this; // eslint-disable-line + let firstCall = true; + return function (filePath, ctx, callback) { + if (firstCall) { + firstCall = false; + const dirs = normalizeDirectoryList(this.root); + self.options.root.unshift(...dirs); + self.options.layouts.unshift(...dirs); + self.options.partials.unshift(...dirs); + } + self.renderFile(filePath, ctx).then(html => callback(null, html), callback); + }; + } +} + +/* istanbul ignore file */ +const version = '10.14.0'; + +exports.AssertionError = AssertionError; +exports.AssignTag = AssignTag; +exports.BlockTag = BlockTag; +exports.BreakTag = BreakTag; +exports.CaptureTag = CaptureTag; +exports.CaseTag = CaseTag; +exports.CommentTag = CommentTag; +exports.Context = Context; +exports.ContinueTag = ContinueTag; +exports.CycleTag = CycleTag; +exports.DecrementTag = DecrementTag; +exports.Drop = Drop; +exports.EchoTag = EchoTag; +exports.Expression = Expression; +exports.Filter = Filter; +exports.ForTag = ForTag; +exports.Hash = Hash; +exports.IfTag = IfTag; +exports.IncludeTag = IncludeTag; +exports.IncrementTag = IncrementTag; +exports.InlineCommentTag = InlineCommentTag; +exports.LayoutTag = LayoutTag; +exports.Liquid = Liquid; +exports.LiquidError = LiquidError; +exports.LiquidTag = LiquidTag; +exports.Output = Output; +exports.ParseError = ParseError; +exports.ParseStream = ParseStream; +exports.RawTag = RawTag; +exports.RenderError = RenderError; +exports.RenderTag = RenderTag; +exports.TablerowTag = TablerowTag; +exports.Tag = Tag; +exports.TagToken = TagToken; +exports.TimezoneDate = TimezoneDate; +exports.Token = Token; +exports.TokenizationError = TokenizationError; +exports.Tokenizer = Tokenizer; +exports.TypeGuards = typeGuards; +exports.UndefinedVariableError = UndefinedVariableError; +exports.UnlessTag = UnlessTag; +exports.Value = Value; +exports.assert = assert; +exports.createTrie = createTrie; +exports.defaultOperators = defaultOperators; +exports.defaultOptions = defaultOptions; +exports.evalQuotedToken = evalQuotedToken; +exports.evalToken = evalToken; +exports.filters = filters; +exports.isFalsy = isFalsy; +exports.isTruthy = isTruthy; +exports.tags = tags; +exports.toPromise = toPromise; +exports.toValue = toValue; +exports.toValueSync = toValueSync; +exports.version = version; diff --git a/node_modules/liquidjs/dist/liquid.node.esm.js b/node_modules/liquidjs/dist/liquid.node.esm.js new file mode 100644 index 0000000..b5326e8 --- /dev/null +++ b/node_modules/liquidjs/dist/liquid.node.esm.js @@ -0,0 +1,4046 @@ +/* + * liquidjs@10.14.0, https://github.com/harttle/liquidjs + * (c) 2016-2024 harttle + * Released under the MIT License. + */ +import { PassThrough } from 'stream'; +import { sep, extname, resolve as resolve$1, dirname as dirname$1 } from 'path'; +import { statSync, readFileSync as readFileSync$1, stat, readFile as readFile$1 } from 'fs'; + +class Token { + constructor(kind, input, begin, end, file) { + this.kind = kind; + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + } + getText() { + return this.input.slice(this.begin, this.end); + } + getPosition() { + let [row, col] = [1, 1]; + for (let i = 0; i < this.begin; i++) { + if (this.input[i] === '\n') { + row++; + col = 1; + } + else + col++; + } + return [row, col]; + } + size() { + return this.end - this.begin; + } +} + +class Drop { + liquidMethodMissing(key) { + return undefined; + } +} + +const toString$1 = Object.prototype.toString; +const toLowerCase = String.prototype.toLowerCase; +const hasOwnProperty = Object.hasOwnProperty; +function isString(value) { + return typeof value === 'string'; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function isFunction(value) { + return typeof value === 'function'; +} +function isPromise(val) { + return val && isFunction(val.then); +} +function isIterator(val) { + return val && isFunction(val.next) && isFunction(val.throw) && isFunction(val.return); +} +function escapeRegex(str) { + return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); +} +function promisify(fn) { + return function (...args) { + return new Promise((resolve, reject) => { + fn(...args, (err, result) => { + err ? reject(err) : resolve(result); + }); + }); + }; +} +function stringify(value) { + value = toValue(value); + if (isString(value)) + return value; + if (isNil(value)) + return ''; + if (isArray(value)) + return value.map(x => stringify(x)).join(''); + return String(value); +} +function toEnumerable(val) { + val = toValue(val); + if (isArray(val)) + return val; + if (isString(val) && val.length > 0) + return [val]; + if (isIterable(val)) + return Array.from(val); + if (isObject(val)) + return Object.keys(val).map((key) => [key, val[key]]); + return []; +} +function toArray(val) { + val = toValue(val); + if (isNil(val)) + return []; + if (isArray(val)) + return val; + return [val]; +} +function toValue(value) { + return (value instanceof Drop && isFunction(value.valueOf)) ? value.valueOf() : value; +} +function isNumber(value) { + return typeof value === 'number'; +} +function toLiquid(value) { + if (value && isFunction(value.toLiquid)) + return toLiquid(value.toLiquid()); + return value; +} +function isNil(value) { + return value == null; +} +function isUndefined(value) { + return value === undefined; +} +function isArray(value) { + // be compatible with IE 8 + return toString$1.call(value) === '[object Array]'; +} +function isIterable(value) { + return isObject(value) && Symbol.iterator in value; +} +/* + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * The iteratee is invoked with three arguments: (value, key, object). + * Iteratee functions may exit iteration early by explicitly returning false. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @return {Object} Returns object. + */ +function forOwn(obj, iteratee) { + obj = obj || {}; + for (const k in obj) { + if (hasOwnProperty.call(obj, k)) { + if (iteratee(obj[k], k, obj) === false) + break; + } + } + return obj; +} +function last(arr) { + return arr[arr.length - 1]; +} +/* + * Checks if value is the language type of Object. + * (e.g. arrays, functions, objects, regexes, new Number(0), and new String('')) + * @param {any} value The value to check. + * @return {Boolean} Returns true if value is an object, else false. + */ +function isObject(value) { + const type = typeof value; + return value !== null && (type === 'object' || type === 'function'); +} +function range(start, stop, step = 1) { + const arr = []; + for (let i = start; i < stop; i += step) { + arr.push(i); + } + return arr; +} +function padStart(str, length, ch = ' ') { + return pad(str, length, ch, (str, ch) => ch + str); +} +function padEnd(str, length, ch = ' ') { + return pad(str, length, ch, (str, ch) => str + ch); +} +function pad(str, length, ch, add) { + str = String(str); + let n = length - str.length; + while (n-- > 0) + str = add(str, ch); + return str; +} +function identify(val) { + return val; +} +function changeCase(str) { + const hasLowerCase = [...str].some(ch => ch >= 'a' && ch <= 'z'); + return hasLowerCase ? str.toUpperCase() : str.toLowerCase(); +} +function ellipsis(str, N) { + return str.length > N ? str.slice(0, N - 3) + '...' : str; +} +// compare string in case-insensitive way, undefined values to the tail +function caseInsensitiveCompare(a, b) { + if (a == null && b == null) + return 0; + if (a == null) + return 1; + if (b == null) + return -1; + a = toLowerCase.call(a); + b = toLowerCase.call(b); + if (a < b) + return -1; + if (a > b) + return 1; + return 0; +} +function argumentsToValue(fn) { + return (...args) => fn(...args.map(toValue)); +} +function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +} + +/** + * targeting ES5, extends Error won't create a proper prototype chain, need a trait to keep track of classes + */ +const TRAIT = '__liquidClass__'; +class LiquidError extends Error { + constructor(err, token) { + /** + * note: for ES5 targeting, `this` will be replaced by return value of Error(), + * thus everything on `this` will be lost, avoid calling `LiquidError` methods here + */ + super(typeof err === 'string' ? err : err.message); + this.context = ''; + if (typeof err !== 'string') + Object.defineProperty(this, 'originalError', { value: err, enumerable: false }); + Object.defineProperty(this, 'token', { value: token, enumerable: false }); + Object.defineProperty(this, TRAIT, { value: 'LiquidError', enumerable: false }); + } + update() { + Object.defineProperty(this, 'context', { value: mkContext(this.token), enumerable: false }); + this.message = mkMessage(this.message, this.token); + this.stack = this.message + '\n' + this.context + + '\n' + this.stack; + if (this.originalError) + this.stack += '\nFrom ' + this.originalError.stack; + } + static is(obj) { + return (obj === null || obj === void 0 ? void 0 : obj[TRAIT]) === 'LiquidError'; + } +} +class TokenizationError extends LiquidError { + constructor(message, token) { + super(message, token); + this.name = 'TokenizationError'; + super.update(); + } +} +class ParseError extends LiquidError { + constructor(err, token) { + super(err, token); + this.name = 'ParseError'; + this.message = err.message; + super.update(); + } +} +class RenderError extends LiquidError { + constructor(err, tpl) { + super(err, tpl.token); + this.name = 'RenderError'; + this.message = err.message; + super.update(); + } + static is(obj) { + return obj.name === 'RenderError'; + } +} +class LiquidErrors extends LiquidError { + constructor(errors) { + super(errors[0], errors[0].token); + this.errors = errors; + this.name = 'LiquidErrors'; + const s = errors.length > 1 ? 's' : ''; + this.message = `${errors.length} error${s} found`; + super.update(); + } + static is(obj) { + return obj.name === 'LiquidErrors'; + } +} +class UndefinedVariableError extends LiquidError { + constructor(err, token) { + super(err, token); + this.name = 'UndefinedVariableError'; + this.message = err.message; + super.update(); + } +} +// only used internally; raised where we don't have token information, +// so it can't be an UndefinedVariableError. +class InternalUndefinedVariableError extends Error { + constructor(variableName) { + super(`undefined variable: ${variableName}`); + this.name = 'InternalUndefinedVariableError'; + this.variableName = variableName; + } +} +class AssertionError extends Error { + constructor(message) { + super(message); + this.name = 'AssertionError'; + this.message = message + ''; + } +} +function mkContext(token) { + const [line, col] = token.getPosition(); + const lines = token.input.split('\n'); + const begin = Math.max(line - 2, 1); + const end = Math.min(line + 3, lines.length); + const context = range(begin, end + 1) + .map(lineNumber => { + const rowIndicator = (lineNumber === line) ? '>> ' : ' '; + const num = padStart(String(lineNumber), String(end).length); + let text = `${rowIndicator}${num}| `; + const colIndicator = lineNumber === line + ? '\n' + padStart('^', col + text.length) + : ''; + text += lines[lineNumber - 1]; + text += colIndicator; + return text; + }) + .join('\n'); + return context; +} +function mkMessage(msg, token) { + if (token.file) + msg += `, file:${token.file}`; + const [line, col] = token.getPosition(); + msg += `, line:${line}, col:${col}`; + return msg; +} + +// **DO NOT CHANGE THIS FILE** +// +// This file is generated by bin/character-gen.js +// bitmask character types to boost performance +const TYPES = [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 4, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 8, 0, 0, 0, 0, 8, 0, 0, 0, 64, 0, 65, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]; +const WORD = 1; +const BLANK = 4; +const QUOTE = 8; +const INLINE_BLANK = 16; +const NUMBER = 32; +const SIGN = 64; +const PUNCTUATION = 128; +function isWord(char) { + const code = char.charCodeAt(0); + return code >= 128 ? !TYPES[code] : !!(TYPES[code] & WORD); +} +TYPES[160] = TYPES[5760] = TYPES[6158] = TYPES[8192] = TYPES[8193] = TYPES[8194] = TYPES[8195] = TYPES[8196] = TYPES[8197] = TYPES[8198] = TYPES[8199] = TYPES[8200] = TYPES[8201] = TYPES[8202] = TYPES[8232] = TYPES[8233] = TYPES[8239] = TYPES[8287] = TYPES[12288] = BLANK; +TYPES[8220] = TYPES[8221] = PUNCTUATION; + +function assert(predicate, message) { + if (!predicate) { + const msg = typeof message === 'function' + ? message() + : (message || `expect ${predicate} to be true`); + throw new AssertionError(msg); + } +} + +class NullDrop extends Drop { + equals(value) { + return isNil(toValue(value)); + } + gt() { + return false; + } + geq() { + return false; + } + lt() { + return false; + } + leq() { + return false; + } + valueOf() { + return null; + } +} + +class EmptyDrop extends Drop { + equals(value) { + if (value instanceof EmptyDrop) + return false; + value = toValue(value); + if (isString(value) || isArray(value)) + return value.length === 0; + if (isObject(value)) + return Object.keys(value).length === 0; + return false; + } + gt() { + return false; + } + geq() { + return false; + } + lt() { + return false; + } + leq() { + return false; + } + valueOf() { + return ''; + } +} + +class BlankDrop extends EmptyDrop { + equals(value) { + if (value === false) + return true; + if (isNil(toValue(value))) + return true; + if (isString(value)) + return /^\s*$/.test(value); + return super.equals(value); + } +} + +class ForloopDrop extends Drop { + constructor(length, collection, variable) { + super(); + this.i = 0; + this.length = length; + this.name = `${variable}-${collection}`; + } + next() { + this.i++; + } + index0() { + return this.i; + } + index() { + return this.i + 1; + } + first() { + return this.i === 0; + } + last() { + return this.i === this.length - 1; + } + rindex() { + return this.length - this.i; + } + rindex0() { + return this.length - this.i - 1; + } + valueOf() { + return JSON.stringify(this); + } +} + +class BlockDrop extends Drop { + constructor( + // the block render from layout template + superBlockRender = () => '') { + super(); + this.superBlockRender = superBlockRender; + } + /** + * Provide parent access in child block by + * {{ block.super }} + */ + super() { + return this.superBlockRender(); + } +} + +function isComparable(arg) { + return (arg && + isFunction(arg.equals) && + isFunction(arg.gt) && + isFunction(arg.geq) && + isFunction(arg.lt) && + isFunction(arg.leq)); +} + +const nil = new NullDrop(); +const literalValues = { + 'true': true, + 'false': false, + 'nil': nil, + 'null': nil, + 'empty': new EmptyDrop(), + 'blank': new BlankDrop() +}; + +function createTrie(input) { + const trie = {}; + for (const [name, data] of Object.entries(input)) { + let node = trie; + for (let i = 0; i < name.length; i++) { + const c = name[i]; + node[c] = node[c] || {}; + if (i === name.length - 1 && isWord(name[i])) { + node[c].needBoundary = true; + } + node = node[c]; + } + node.data = data; + node.end = true; + } + return trie; +} + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +// convert an async iterator to a Promise +function toPromise(val) { + return __awaiter(this, void 0, void 0, function* () { + if (!isIterator(val)) + return val; + let value; + let done = false; + let next = 'next'; + do { + const state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + try { + if (isIterator(value)) + value = toPromise(value); + if (isPromise(value)) + value = yield value; + } + catch (err) { + next = 'throw'; + value = err; + } + } while (!done); + return value; + }); +} +// convert an async iterator to a value in a synchronous manner +function toValueSync(val) { + if (!isIterator(val)) + return val; + let value; + let done = false; + let next = 'next'; + do { + const state = val[next](value); + done = state.done; + value = state.value; + next = 'next'; + if (isIterator(value)) { + try { + value = toValueSync(value); + } + catch (err) { + next = 'throw'; + value = err; + } + } + } while (!done); + return value; +} + +const rFormat = /%([-_0^#:]+)?(\d+)?([EO])?(.)/; +const monthNames = [ + 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', + 'September', 'October', 'November', 'December' +]; +const dayNames = [ + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' +]; +const monthNamesShort = monthNames.map(abbr); +const dayNamesShort = dayNames.map(abbr); +function abbr(str) { + return str.slice(0, 3); +} +// prototype extensions +function daysInMonth(d) { + const feb = isLeapYear(d) ? 29 : 28; + return [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +} +function getDayOfYear(d) { + let num = 0; + for (let i = 0; i < d.getMonth(); ++i) { + num += daysInMonth(d)[i]; + } + return num + d.getDate(); +} +function getWeekOfYear(d, startDay) { + // Skip to startDay of this week + const now = getDayOfYear(d) + (startDay - d.getDay()); + // Find the first startDay of the year + const jan1 = new Date(d.getFullYear(), 0, 1); + const then = (7 - jan1.getDay() + startDay); + return String(Math.floor((now - then) / 7) + 1); +} +function isLeapYear(d) { + const year = d.getFullYear(); + return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year))); +} +function ordinal(d) { + const date = d.getDate(); + if ([11, 12, 13].includes(date)) + return 'th'; + switch (date % 10) { + case 1: return 'st'; + case 2: return 'nd'; + case 3: return 'rd'; + default: return 'th'; + } +} +function century(d) { + return parseInt(d.getFullYear().toString().substring(0, 2), 10); +} +// default to 0 +const padWidths = { + d: 2, + e: 2, + H: 2, + I: 2, + j: 3, + k: 2, + l: 2, + L: 3, + m: 2, + M: 2, + S: 2, + U: 2, + W: 2 +}; +// default to '0' +const padChars = { + a: ' ', + A: ' ', + b: ' ', + B: ' ', + c: ' ', + e: ' ', + k: ' ', + l: ' ', + p: ' ', + P: ' ' +}; +function getTimezoneOffset(d, opts) { + const nOffset = Math.abs(d.getTimezoneOffset()); + const h = Math.floor(nOffset / 60); + const m = nOffset % 60; + return (d.getTimezoneOffset() > 0 ? '-' : '+') + + padStart(h, 2, '0') + + (opts.flags[':'] ? ':' : '') + + padStart(m, 2, '0'); +} +const formatCodes = { + a: (d) => dayNamesShort[d.getDay()], + A: (d) => dayNames[d.getDay()], + b: (d) => monthNamesShort[d.getMonth()], + B: (d) => monthNames[d.getMonth()], + c: (d) => d.toLocaleString(), + C: (d) => century(d), + d: (d) => d.getDate(), + e: (d) => d.getDate(), + H: (d) => d.getHours(), + I: (d) => String(d.getHours() % 12 || 12), + j: (d) => getDayOfYear(d), + k: (d) => d.getHours(), + l: (d) => String(d.getHours() % 12 || 12), + L: (d) => d.getMilliseconds(), + m: (d) => d.getMonth() + 1, + M: (d) => d.getMinutes(), + N: (d, opts) => { + const width = Number(opts.width) || 9; + const str = String(d.getMilliseconds()).slice(0, width); + return padEnd(str, width, '0'); + }, + p: (d) => (d.getHours() < 12 ? 'AM' : 'PM'), + P: (d) => (d.getHours() < 12 ? 'am' : 'pm'), + q: (d) => ordinal(d), + s: (d) => Math.round(d.getTime() / 1000), + S: (d) => d.getSeconds(), + u: (d) => d.getDay() || 7, + U: (d) => getWeekOfYear(d, 0), + w: (d) => d.getDay(), + W: (d) => getWeekOfYear(d, 1), + x: (d) => d.toLocaleDateString(), + X: (d) => d.toLocaleTimeString(), + y: (d) => d.getFullYear().toString().slice(2, 4), + Y: (d) => d.getFullYear(), + z: getTimezoneOffset, + Z: (d, opts) => { + if (d.getTimezoneName) { + return d.getTimezoneName() || getTimezoneOffset(d, opts); + } + return (typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : ''); + }, + 't': () => '\t', + 'n': () => '\n', + '%': () => '%' +}; +formatCodes.h = formatCodes.b; +function strftime(d, formatStr) { + let output = ''; + let remaining = formatStr; + let match; + while ((match = rFormat.exec(remaining))) { + output += remaining.slice(0, match.index); + remaining = remaining.slice(match.index + match[0].length); + output += format(d, match); + } + return output + remaining; +} +function format(d, match) { + const [input, flagStr = '', width, modifier, conversion] = match; + const convert = formatCodes[conversion]; + if (!convert) + return input; + const flags = {}; + for (const flag of flagStr) + flags[flag] = true; + let ret = String(convert(d, { flags, width, modifier })); + let padChar = padChars[conversion] || '0'; + let padWidth = width || padWidths[conversion] || 0; + if (flags['^']) + ret = ret.toUpperCase(); + else if (flags['#']) + ret = changeCase(ret); + if (flags['_']) + padChar = ' '; + else if (flags['0']) + padChar = '0'; + if (flags['-']) + padWidth = 0; + return padStart(ret, padWidth, padChar); +} + +// one minute in milliseconds +const OneMinute = 60000; +const ISO8601_TIMEZONE_PATTERN = /([zZ]|([+-])(\d{2}):(\d{2}))$/; +/** + * A date implementation with timezone info, just like Ruby date + * + * Implementation: + * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods + * - rewrite getTimezoneOffset() to trick strftime + */ +class TimezoneDate { + constructor(init, timezone) { + this.date = init instanceof TimezoneDate + ? init.date + : new Date(init); + this.timezoneOffset = isString(timezone) ? TimezoneDate.getTimezoneOffset(timezone, this.date) : timezone; + this.timezoneName = isString(timezone) ? timezone : ''; + const diff = (this.date.getTimezoneOffset() - this.timezoneOffset) * OneMinute; + const time = this.date.getTime() + diff; + this.displayDate = new Date(time); + } + getTime() { + return this.displayDate.getTime(); + } + getMilliseconds() { + return this.displayDate.getMilliseconds(); + } + getSeconds() { + return this.displayDate.getSeconds(); + } + getMinutes() { + return this.displayDate.getMinutes(); + } + getHours() { + return this.displayDate.getHours(); + } + getDay() { + return this.displayDate.getDay(); + } + getDate() { + return this.displayDate.getDate(); + } + getMonth() { + return this.displayDate.getMonth(); + } + getFullYear() { + return this.displayDate.getFullYear(); + } + toLocaleString(locale, init) { + if (init === null || init === void 0 ? void 0 : init.timeZone) { + return this.date.toLocaleString(locale, init); + } + return this.displayDate.toLocaleString(locale, init); + } + toLocaleTimeString(locale) { + return this.displayDate.toLocaleTimeString(locale); + } + toLocaleDateString(locale) { + return this.displayDate.toLocaleDateString(locale); + } + getTimezoneOffset() { + return this.timezoneOffset; + } + getTimezoneName() { + return this.timezoneName; + } + /** + * Create a Date object fixed to it's declared Timezone. Both + * - 2021-08-06T02:29:00.000Z and + * - 2021-08-06T02:29:00.000+08:00 + * will always be displayed as + * - 2021-08-06 02:29:00 + * regardless timezoneOffset in JavaScript realm + * + * The implementation hack: + * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`, + * we create a different Date to trick strftime, it's both simpler and more performant. + * Given that a template is expected to be parsed fewer times than rendered. + */ + static createDateFixedToTimezone(dateString) { + const m = dateString.match(ISO8601_TIMEZONE_PATTERN); + // representing a UTC timestamp + if (m && m[1] === 'Z') { + return new TimezoneDate(+new Date(dateString), 0); + } + // has a timezone specified + if (m && m[2] && m[3] && m[4]) { + const [, , sign, hours, minutes] = m; + const offset = (sign === '+' ? -1 : 1) * (parseInt(hours, 10) * 60 + parseInt(minutes, 10)); + return new TimezoneDate(+new Date(dateString), offset); + } + return new Date(dateString); + } + static getTimezoneOffset(timezoneName, date = new Date()) { + const localDateString = date.toLocaleString('en-US', { timeZone: timezoneName }); + const utcDateString = date.toLocaleString('en-US', { timeZone: 'UTC' }); + const localDate = new Date(localDateString); + const utcDate = new Date(utcDateString); + return (+utcDate - +localDate) / (60 * 1000); + } +} + +class DelimitedToken extends Token { + constructor(kind, [contentBegin, contentEnd], input, begin, end, trimLeft, trimRight, file) { + super(kind, input, begin, end, file); + this.trimLeft = false; + this.trimRight = false; + const tl = input[contentBegin] === '-'; + const tr = input[contentEnd - 1] === '-'; + let l = tl ? contentBegin + 1 : contentBegin; + let r = tr ? contentEnd - 1 : contentEnd; + while (l < r && (TYPES[input.charCodeAt(l)] & BLANK)) + l++; + while (r > l && (TYPES[input.charCodeAt(r - 1)] & BLANK)) + r--; + this.contentRange = [l, r]; + this.trimLeft = tl || trimLeft; + this.trimRight = tr || trimRight; + } + get content() { + return this.input.slice(this.contentRange[0], this.contentRange[1]); + } +} + +class TagToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + const { trimTagLeft, trimTagRight, tagDelimiterLeft, tagDelimiterRight } = options; + const [valueBegin, valueEnd] = [begin + tagDelimiterLeft.length, end - tagDelimiterRight.length]; + super(TokenKind.Tag, [valueBegin, valueEnd], input, begin, end, trimTagLeft, trimTagRight, file); + this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange); + this.name = this.tokenizer.readTagName(); + this.tokenizer.assert(this.name, `illegal tag syntax, tag name expected`); + this.tokenizer.skipBlank(); + } + get args() { + return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]); + } +} + +class OutputToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + const { trimOutputLeft, trimOutputRight, outputDelimiterLeft, outputDelimiterRight } = options; + const valueRange = [begin + outputDelimiterLeft.length, end - outputDelimiterRight.length]; + super(TokenKind.Output, valueRange, input, begin, end, trimOutputLeft, trimOutputRight, file); + } +} + +class HTMLToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.HTML, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.trimLeft = 0; + this.trimRight = 0; + } + getContent() { + return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight); + } +} + +class NumberToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Number, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = Number(this.getText()); + } +} + +class IdentifierToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Word, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = this.getText(); + } + isNumber(allowSign = false) { + const begin = allowSign && TYPES[this.input.charCodeAt(this.begin)] & SIGN + ? this.begin + 1 + : this.begin; + for (let i = begin; i < this.end; i++) { + if (!(TYPES[this.input.charCodeAt(i)] & NUMBER)) + return false; + } + return true; + } +} + +class LiteralToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Literal, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.literal = this.getText(); + this.content = literalValues[this.literal]; + } +} + +const operatorPrecedences = { + '==': 2, + '!=': 2, + '>': 2, + '<': 2, + '>=': 2, + '<=': 2, + 'contains': 2, + 'not': 1, + 'and': 0, + 'or': 0 +}; +const operatorTypes = { + '==': 0 /* OperatorType.Binary */, + '!=': 0 /* OperatorType.Binary */, + '>': 0 /* OperatorType.Binary */, + '<': 0 /* OperatorType.Binary */, + '>=': 0 /* OperatorType.Binary */, + '<=': 0 /* OperatorType.Binary */, + 'contains': 0 /* OperatorType.Binary */, + 'not': 1 /* OperatorType.Unary */, + 'and': 0 /* OperatorType.Binary */, + 'or': 0 /* OperatorType.Binary */ +}; +class OperatorToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Operator, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.operator = this.getText(); + } + getPrecedence() { + const key = this.getText(); + return key in operatorPrecedences ? operatorPrecedences[key] : 1; + } +} + +class PropertyAccessToken extends Token { + constructor(variable, props, input, begin, end, file) { + super(TokenKind.PropertyAccess, input, begin, end, file); + this.variable = variable; + this.props = props; + } +} + +class FilterToken extends Token { + constructor(name, args, input, begin, end, file) { + super(TokenKind.Filter, input, begin, end, file); + this.name = name; + this.args = args; + } +} + +class HashToken extends Token { + constructor(input, begin, end, name, value, file) { + super(TokenKind.Hash, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.name = name; + this.value = value; + this.file = file; + } +} + +const rHex = /[\da-fA-F]/; +const rOct = /[0-7]/; +const escapeChar = { + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t', + v: '\x0B' +}; +function hexVal(c) { + const code = c.charCodeAt(0); + if (code >= 97) + return code - 87; + if (code >= 65) + return code - 55; + return code - 48; +} +function parseStringLiteral(str) { + let ret = ''; + for (let i = 1; i < str.length - 1; i++) { + if (str[i] !== '\\') { + ret += str[i]; + continue; + } + if (escapeChar[str[i + 1]] !== undefined) { + ret += escapeChar[str[++i]]; + } + else if (str[i + 1] === 'u') { + let val = 0; + let j = i + 2; + while (j <= i + 5 && rHex.test(str[j])) { + val = val * 16 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + else if (!rOct.test(str[i + 1])) { + ret += str[++i]; + } + else { + let j = i + 1; + let val = 0; + while (j <= i + 3 && rOct.test(str[j])) { + val = val * 8 + hexVal(str[j++]); + } + i = j - 1; + ret += String.fromCharCode(val); + } + } + return ret; +} + +class QuotedToken extends Token { + constructor(input, begin, end, file) { + super(TokenKind.Quoted, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + this.content = parseStringLiteral(this.getText()); + } +} + +class RangeToken extends Token { + constructor(input, begin, end, lhs, rhs, file) { + super(TokenKind.Range, input, begin, end, file); + this.input = input; + this.begin = begin; + this.end = end; + this.lhs = lhs; + this.rhs = rhs; + this.file = file; + } +} + +/** + * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}` + */ +class LiquidTagToken extends DelimitedToken { + constructor(input, begin, end, options, file) { + super(TokenKind.Tag, [begin, end], input, begin, end, false, false, file); + this.tokenizer = new Tokenizer(input, options.operators, file, this.contentRange); + this.name = this.tokenizer.readTagName(); + this.tokenizer.assert(this.name, 'illegal liquid tag syntax'); + this.tokenizer.skipBlank(); + this.args = this.tokenizer.remaining(); + } +} + +/** + * value expression with optional filters + * e.g. + * {% assign foo="bar" | append: "coo" %} + */ +class FilteredValueToken extends Token { + constructor(initial, filters, input, begin, end, file) { + super(TokenKind.FilteredValue, input, begin, end, file); + this.initial = initial; + this.filters = filters; + this.input = input; + this.begin = begin; + this.end = end; + this.file = file; + } +} + +class SimpleEmitter { + constructor() { + this.buffer = ''; + } + write(html) { + this.buffer += stringify(html); + } +} + +class StreamedEmitter { + constructor() { + this.buffer = ''; + this.stream = new PassThrough(); + } + write(html) { + this.stream.write(stringify(html)); + } + error(err) { + this.stream.emit('error', err); + } + end() { + this.stream.end(); + } +} + +class KeepingTypeEmitter { + constructor() { + this.buffer = ''; + } + write(html) { + html = toValue(html); + // This will only preserve the type if the value is isolated. + // I.E: + // {{ my-port }} -> 42 + // {{ my-host }}:{{ my-port }} -> 'host:42' + if (typeof html !== 'string' && this.buffer === '') { + this.buffer = html; + } + else { + this.buffer = stringify(this.buffer) + stringify(html); + } + } +} + +class Render { + renderTemplatesToNodeStream(templates, ctx) { + const emitter = new StreamedEmitter(); + Promise.resolve().then(() => toPromise(this.renderTemplates(templates, ctx, emitter))) + .then(() => emitter.end(), err => emitter.error(err)); + return emitter.stream; + } + *renderTemplates(templates, ctx, emitter) { + if (!emitter) { + emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter(); + } + const errors = []; + for (const tpl of templates) { + try { + // if tpl.render supports emitter, it'll return empty `html` + const html = yield tpl.render(ctx, emitter); + // if not, it'll return an `html`, write to the emitter for it + html && emitter.write(html); + if (emitter['break'] || emitter['continue']) + break; + } + catch (e) { + const err = LiquidError.is(e) ? e : new RenderError(e, tpl); + if (ctx.opts.catchAllErrors) + errors.push(err); + else + throw err; + } + } + if (errors.length) { + throw new LiquidErrors(errors); + } + return emitter.buffer; + } +} + +class Expression { + constructor(tokens) { + this.postfix = [...toPostfix(tokens)]; + } + *evaluate(ctx, lenient) { + assert(ctx, 'unable to evaluate: context not defined'); + const operands = []; + for (const token of this.postfix) { + if (isOperatorToken(token)) { + const r = operands.pop(); + let result; + if (operatorTypes[token.operator] === 1 /* OperatorType.Unary */) { + result = yield ctx.opts.operators[token.operator](r, ctx); + } + else { + const l = operands.pop(); + result = yield ctx.opts.operators[token.operator](l, r, ctx); + } + operands.push(result); + } + else { + operands.push(yield evalToken(token, ctx, lenient)); + } + } + return operands[0]; + } + valid() { + return !!this.postfix.length; + } +} +function* evalToken(token, ctx, lenient = false) { + if (!token) + return; + if ('content' in token) + return token.content; + if (isPropertyAccessToken(token)) + return yield evalPropertyAccessToken(token, ctx, lenient); + if (isRangeToken(token)) + return yield evalRangeToken(token, ctx); +} +function* evalPropertyAccessToken(token, ctx, lenient) { + const props = []; + for (const prop of token.props) { + props.push((yield evalToken(prop, ctx, false))); + } + try { + if (token.variable) { + const variable = yield evalToken(token.variable, ctx, lenient); + return yield ctx._getFromScope(variable, props); + } + else { + return yield ctx._get(props); + } + } + catch (e) { + if (lenient && e.name === 'InternalUndefinedVariableError') + return null; + throw (new UndefinedVariableError(e, token)); + } +} +function evalQuotedToken(token) { + return token.content; +} +function* evalRangeToken(token, ctx) { + const low = yield evalToken(token.lhs, ctx); + const high = yield evalToken(token.rhs, ctx); + return range(+low, +high + 1); +} +function* toPostfix(tokens) { + const ops = []; + for (const token of tokens) { + if (isOperatorToken(token)) { + while (ops.length && ops[ops.length - 1].getPrecedence() > token.getPrecedence()) { + yield ops.pop(); + } + ops.push(token); + } + else + yield token; + } + while (ops.length) { + yield ops.pop(); + } +} + +function isTruthy(val, ctx) { + return !isFalsy(val, ctx); +} +function isFalsy(val, ctx) { + val = toValue(val); + if (ctx.opts.jsTruthy) { + return !val; + } + else { + return val === false || undefined === val || val === null; + } +} + +const defaultOperators = { + '==': equals, + '!=': (l, r) => !equals(l, r), + '>': (l, r) => { + if (isComparable(l)) + return l.gt(r); + if (isComparable(r)) + return r.lt(l); + return toValue(l) > toValue(r); + }, + '<': (l, r) => { + if (isComparable(l)) + return l.lt(r); + if (isComparable(r)) + return r.gt(l); + return toValue(l) < toValue(r); + }, + '>=': (l, r) => { + if (isComparable(l)) + return l.geq(r); + if (isComparable(r)) + return r.leq(l); + return toValue(l) >= toValue(r); + }, + '<=': (l, r) => { + if (isComparable(l)) + return l.leq(r); + if (isComparable(r)) + return r.geq(l); + return toValue(l) <= toValue(r); + }, + 'contains': (l, r) => { + l = toValue(l); + if (isArray(l)) + return l.some((i) => equals(i, r)); + if (isFunction(l === null || l === void 0 ? void 0 : l.indexOf)) + return l.indexOf(toValue(r)) > -1; + return false; + }, + 'not': (v, ctx) => isFalsy(toValue(v), ctx), + 'and': (l, r, ctx) => isTruthy(toValue(l), ctx) && isTruthy(toValue(r), ctx), + 'or': (l, r, ctx) => isTruthy(toValue(l), ctx) || isTruthy(toValue(r), ctx) +}; +function equals(lhs, rhs) { + if (isComparable(lhs)) + return lhs.equals(rhs); + if (isComparable(rhs)) + return rhs.equals(lhs); + lhs = toValue(lhs); + rhs = toValue(rhs); + if (isArray(lhs)) { + return isArray(rhs) && arrayEquals(lhs, rhs); + } + return lhs === rhs; +} +function arrayEquals(lhs, rhs) { + if (lhs.length !== rhs.length) + return false; + return !lhs.some((value, i) => !equals(value, rhs[i])); +} + +class Node { + constructor(key, value, next, prev) { + this.key = key; + this.value = value; + this.next = next; + this.prev = prev; + } +} +class LRU { + constructor(limit, size = 0) { + this.limit = limit; + this.size = size; + this.cache = {}; + this.head = new Node('HEAD', null, null, null); + this.tail = new Node('TAIL', null, null, null); + this.head.next = this.tail; + this.tail.prev = this.head; + } + write(key, value) { + if (this.cache[key]) { + this.cache[key].value = value; + } + else { + const node = new Node(key, value, this.head.next, this.head); + this.head.next.prev = node; + this.head.next = node; + this.cache[key] = node; + this.size++; + this.ensureLimit(); + } + } + read(key) { + if (!this.cache[key]) + return; + const { value } = this.cache[key]; + this.remove(key); + this.write(key, value); + return value; + } + remove(key) { + const node = this.cache[key]; + node.prev.next = node.next; + node.next.prev = node.prev; + delete this.cache[key]; + this.size--; + } + clear() { + this.head.next = this.tail; + this.tail.prev = this.head; + this.size = 0; + this.cache = {}; + } + ensureLimit() { + if (this.size > this.limit) + this.remove(this.tail.prev.key); + } +} + +const requireResolve = require.resolve; + +const statAsync = promisify(stat); +const readFileAsync = promisify(readFile$1); +function exists(filepath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield statAsync(filepath); + return true; + } + catch (err) { + return false; + } + }); +} +function readFile(filepath) { + return readFileAsync(filepath, 'utf8'); +} +function existsSync(filepath) { + try { + statSync(filepath); + return true; + } + catch (err) { + return false; + } +} +function readFileSync(filepath) { + return readFileSync$1(filepath, 'utf8'); +} +function resolve(root, file, ext) { + if (!extname(file)) + file += ext; + return resolve$1(root, file); +} +function fallback(file) { + try { + return requireResolve(file); + } + catch (e) { } +} +function dirname(filepath) { + return dirname$1(filepath); +} +function contains(root, file) { + root = resolve$1(root); + root = root.endsWith(sep) ? root : root + sep; + return file.startsWith(root); +} + +var fs = /*#__PURE__*/Object.freeze({ + __proto__: null, + exists: exists, + readFile: readFile, + existsSync: existsSync, + readFileSync: readFileSync, + resolve: resolve, + fallback: fallback, + dirname: dirname, + contains: contains, + sep: sep +}); + +function defaultFilter(value, defaultValue, ...args) { + value = toValue(value); + if (isArray(value) || isString(value)) + return value.length ? value : defaultValue; + if (value === false && (new Map(args)).get('allow_false')) + return false; + return isFalsy(value, this.context) ? defaultValue : value; +} +function json(value, space = 0) { + return JSON.stringify(value, null, space); +} +function inspect(value, space = 0) { + const ancestors = []; + return JSON.stringify(value, function (_key, value) { + if (typeof value !== 'object' || value === null) + return value; + // `this` is the object that value is contained in, i.e., its direct parent. + while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) + ancestors.pop(); + if (ancestors.includes(value)) + return '[Circular]'; + ancestors.push(value); + return value; + }, space); +} +function to_integer(value) { + return Number(value); +} +const raw = { + raw: true, + handler: identify +}; +var misc = { + default: defaultFilter, + raw, + jsonify: json, + to_integer, + json, + inspect +}; + +const escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; +const unescapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; +function escape(str) { + return stringify(str).replace(/&|<|>|"|'/g, m => escapeMap[m]); +} +function xml_escape(str) { + return escape(str); +} +function unescape(str) { + return stringify(str).replace(/&(amp|lt|gt|#34|#39);/g, m => unescapeMap[m]); +} +function escape_once(str) { + return escape(unescape(stringify(str))); +} +function newline_to_br(v) { + return stringify(v).replace(/\r?\n/gm, '
    \n'); +} +function strip_html(v) { + return stringify(v).replace(/||<.*?>|/g, ''); +} + +var htmlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + escape: escape, + xml_escape: xml_escape, + escape_once: escape_once, + newline_to_br: newline_to_br, + strip_html: strip_html +}); + +const defaultOptions = { + root: ['.'], + layouts: ['.'], + partials: ['.'], + relativeReference: true, + jekyllInclude: false, + cache: undefined, + extname: '', + fs: fs, + dynamicPartials: true, + jsTruthy: false, + dateFormat: '%A, %B %-e, %Y at %-l:%M %P %z', + trimTagRight: false, + trimTagLeft: false, + trimOutputRight: false, + trimOutputLeft: false, + greedy: true, + tagDelimiterLeft: '{%', + tagDelimiterRight: '%}', + outputDelimiterLeft: '{{', + outputDelimiterRight: '}}', + preserveTimezones: false, + strictFilters: false, + strictVariables: false, + ownPropertyOnly: true, + lenientIf: false, + globals: {}, + keepOutputType: false, + operators: defaultOperators +}; +function normalize(options) { + if (options.hasOwnProperty('root')) { + if (!options.hasOwnProperty('partials')) + options.partials = options.root; + if (!options.hasOwnProperty('layouts')) + options.layouts = options.root; + } + if (options.hasOwnProperty('cache')) { + let cache; + if (typeof options.cache === 'number') + cache = options.cache > 0 ? new LRU(options.cache) : undefined; + else if (typeof options.cache === 'object') + cache = options.cache; + else + cache = options.cache ? new LRU(1024) : undefined; + options.cache = cache; + } + options = Object.assign(Object.assign(Object.assign({}, defaultOptions), (options.jekyllInclude ? { dynamicPartials: false } : {})), options); + if ((!options.fs.dirname || !options.fs.sep) && options.relativeReference) { + console.warn('[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning'); + options.relativeReference = false; + } + options.root = normalizeDirectoryList(options.root); + options.partials = normalizeDirectoryList(options.partials); + options.layouts = normalizeDirectoryList(options.layouts); + options.outputEscape = options.outputEscape && getOutputEscapeFunction(options.outputEscape); + return options; +} +function getOutputEscapeFunction(nameOrFunction) { + if (nameOrFunction === 'escape') + return escape; + if (nameOrFunction === 'json') + return misc.json; + assert(isFunction(nameOrFunction), '`outputEscape` need to be of type string or function'); + return nameOrFunction; +} +function normalizeDirectoryList(value) { + let list = []; + if (isArray(value)) + list = value; + if (isString(value)) + list = [value]; + return list; +} + +function whiteSpaceCtrl(tokens, options) { + let inRaw = false; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + if (!isDelimitedToken(token)) + continue; + if (!inRaw && token.trimLeft) { + trimLeft(tokens[i - 1], options.greedy); + } + if (isTagToken(token)) { + if (token.name === 'raw') + inRaw = true; + else if (token.name === 'endraw') + inRaw = false; + } + if (!inRaw && token.trimRight) { + trimRight(tokens[i + 1], options.greedy); + } + } +} +function trimLeft(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + const mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.end - 1 - token.trimRight)] & mask) + token.trimRight++; +} +function trimRight(token, greedy) { + if (!token || !isHTMLToken(token)) + return; + const mask = greedy ? BLANK : INLINE_BLANK; + while (TYPES[token.input.charCodeAt(token.begin + token.trimLeft)] & mask) + token.trimLeft++; + if (token.input.charAt(token.begin + token.trimLeft) === '\n') + token.trimLeft++; +} + +class Tokenizer { + constructor(input, operators = defaultOptions.operators, file, range) { + this.input = input; + this.file = file; + this.rawBeginAt = -1; + this.p = range ? range[0] : 0; + this.N = range ? range[1] : input.length; + this.opTrie = createTrie(operators); + this.literalTrie = createTrie(literalValues); + } + readExpression() { + return new Expression(this.readExpressionTokens()); + } + *readExpressionTokens() { + while (this.p < this.N) { + const operator = this.readOperator(); + if (operator) { + yield operator; + continue; + } + const operand = this.readValue(); + if (operand) { + yield operand; + continue; + } + return; + } + } + readOperator() { + this.skipBlank(); + const end = this.matchTrie(this.opTrie); + if (end === -1) + return; + return new OperatorToken(this.input, this.p, (this.p = end), this.file); + } + matchTrie(trie) { + let node = trie; + let i = this.p; + let info; + while (node[this.input[i]] && i < this.N) { + node = node[this.input[i++]]; + if (node['end']) + info = node; + } + if (!info) + return -1; + if (info['needBoundary'] && isWord(this.peek(i - this.p))) + return -1; + return i; + } + readFilteredValue() { + const begin = this.p; + const initial = this.readExpression(); + this.assert(initial.valid(), `invalid value expression: ${this.snapshot()}`); + const filters = this.readFilters(); + return new FilteredValueToken(initial, filters, this.input, begin, this.p, this.file); + } + readFilters() { + const filters = []; + while (true) { + const filter = this.readFilter(); + if (!filter) + return filters; + filters.push(filter); + } + } + readFilter() { + this.skipBlank(); + if (this.end()) + return null; + this.assert(this.peek() === '|', `expected "|" before filter`); + this.p++; + const begin = this.p; + const name = this.readIdentifier(); + if (!name.size()) { + this.assert(this.end(), `expected filter name`); + return null; + } + const args = []; + this.skipBlank(); + if (this.peek() === ':') { + do { + ++this.p; + const arg = this.readFilterArg(); + arg && args.push(arg); + this.skipBlank(); + this.assert(this.end() || this.peek() === ',' || this.peek() === '|', () => `unexpected character ${this.snapshot()}`); + } while (this.peek() === ','); + } + else if (this.peek() === '|' || this.end()) ; + else { + throw this.error('expected ":" after filter name'); + } + return new FilterToken(name.getText(), args, this.input, begin, this.p, this.file); + } + readFilterArg() { + const key = this.readValue(); + if (!key) + return; + this.skipBlank(); + if (this.peek() !== ':') + return key; + ++this.p; + const value = this.readValue(); + return [key.getText(), value]; + } + readTopLevelTokens(options = defaultOptions) { + const tokens = []; + while (this.p < this.N) { + const token = this.readTopLevelToken(options); + tokens.push(token); + } + whiteSpaceCtrl(tokens, options); + return tokens; + } + readTopLevelToken(options) { + const { tagDelimiterLeft, outputDelimiterLeft } = options; + if (this.rawBeginAt > -1) + return this.readEndrawOrRawContent(options); + if (this.match(tagDelimiterLeft)) + return this.readTagToken(options); + if (this.match(outputDelimiterLeft)) + return this.readOutputToken(options); + return this.readHTMLToken([tagDelimiterLeft, outputDelimiterLeft]); + } + readHTMLToken(stopStrings) { + const begin = this.p; + while (this.p < this.N) { + if (stopStrings.some(str => this.match(str))) + break; + ++this.p; + } + return new HTMLToken(this.input, begin, this.p, this.file); + } + readTagToken(options = defaultOptions) { + const { file, input } = this; + const begin = this.p; + if (this.readToDelimiter(options.tagDelimiterRight) === -1) { + throw this.error(`tag ${this.snapshot(begin)} not closed`, begin); + } + const token = new TagToken(input, begin, this.p, options, file); + if (token.name === 'raw') + this.rawBeginAt = begin; + return token; + } + readToDelimiter(delimiter, respectQuoted = false) { + this.skipBlank(); + while (this.p < this.N) { + if (respectQuoted && (this.peekType() & QUOTE)) { + this.readQuoted(); + continue; + } + ++this.p; + if (this.rmatch(delimiter)) + return this.p; + } + return -1; + } + readOutputToken(options = defaultOptions) { + const { file, input } = this; + const { outputDelimiterRight } = options; + const begin = this.p; + if (this.readToDelimiter(outputDelimiterRight, true) === -1) { + throw this.error(`output ${this.snapshot(begin)} not closed`, begin); + } + return new OutputToken(input, begin, this.p, options, file); + } + readEndrawOrRawContent(options) { + const { tagDelimiterLeft, tagDelimiterRight } = options; + const begin = this.p; + let leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + while (this.p < this.N) { + if (this.readIdentifier().getText() !== 'endraw') { + leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length; + continue; + } + while (this.p <= this.N) { + if (this.rmatch(tagDelimiterRight)) { + const end = this.p; + if (begin === leftPos) { + this.rawBeginAt = -1; + return new TagToken(this.input, begin, end, options, this.file); + } + else { + this.p = leftPos; + return new HTMLToken(this.input, begin, leftPos, this.file); + } + } + if (this.rmatch(tagDelimiterLeft)) + break; + this.p++; + } + } + throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, begin); + } + readLiquidTagTokens(options = defaultOptions) { + const tokens = []; + while (this.p < this.N) { + const token = this.readLiquidTagToken(options); + token && tokens.push(token); + } + return tokens; + } + readLiquidTagToken(options) { + this.skipBlank(); + if (this.end()) + return; + const begin = this.p; + this.readToDelimiter('\n'); + const end = this.p; + return new LiquidTagToken(this.input, begin, end, options, this.file); + } + error(msg, pos = this.p) { + return new TokenizationError(msg, new IdentifierToken(this.input, pos, this.N, this.file)); + } + assert(pred, msg, pos) { + if (!pred) + throw this.error(typeof msg === 'function' ? msg() : msg, pos); + } + snapshot(begin = this.p) { + return JSON.stringify(ellipsis(this.input.slice(begin, this.N), 32)); + } + /** + * @deprecated use #readIdentifier instead + */ + readWord() { + return this.readIdentifier(); + } + readIdentifier() { + this.skipBlank(); + const begin = this.p; + while (!this.end() && isWord(this.peek())) + ++this.p; + return new IdentifierToken(this.input, begin, this.p, this.file); + } + readNonEmptyIdentifier() { + const id = this.readIdentifier(); + return id.size() ? id : undefined; + } + readTagName() { + this.skipBlank(); + // Handle inline comment tags + if (this.input[this.p] === '#') + return this.input.slice(this.p, ++this.p); + return this.readIdentifier().getText(); + } + readHashes(jekyllStyle) { + const hashes = []; + while (true) { + const hash = this.readHash(jekyllStyle); + if (!hash) + return hashes; + hashes.push(hash); + } + } + readHash(jekyllStyle) { + this.skipBlank(); + if (this.peek() === ',') + ++this.p; + const begin = this.p; + const name = this.readNonEmptyIdentifier(); + if (!name) + return; + let value; + this.skipBlank(); + const sep = jekyllStyle ? '=' : ':'; + if (this.peek() === sep) { + ++this.p; + value = this.readValue(); + } + return new HashToken(this.input, begin, this.p, name, value, this.file); + } + remaining() { + return this.input.slice(this.p, this.N); + } + advance(step = 1) { + this.p += step; + } + end() { + return this.p >= this.N; + } + readTo(end) { + while (this.p < this.N) { + ++this.p; + if (this.rmatch(end)) + return this.p; + } + return -1; + } + readValue() { + this.skipBlank(); + const begin = this.p; + const variable = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber(); + const props = this.readProperties(!variable); + if (!props.length) + return variable; + return new PropertyAccessToken(variable, props, this.input, begin, this.p); + } + readScopeValue() { + this.skipBlank(); + const begin = this.p; + const props = this.readProperties(); + if (!props.length) + return undefined; + return new PropertyAccessToken(undefined, props, this.input, begin, this.p); + } + readProperties(isBegin = true) { + const props = []; + while (true) { + if (this.peek() === '[') { + this.p++; + const prop = this.readValue() || new IdentifierToken(this.input, this.p, this.p, this.file); + this.assert(this.readTo(']') !== -1, '[ not closed'); + props.push(prop); + continue; + } + if (isBegin && !props.length) { + const prop = this.readNonEmptyIdentifier(); + if (prop) { + props.push(prop); + continue; + } + } + if (this.peek() === '.' && this.peek(1) !== '.') { // skip range syntax + this.p++; + const prop = this.readNonEmptyIdentifier(); + if (!prop) + break; + props.push(prop); + continue; + } + break; + } + return props; + } + readNumber() { + this.skipBlank(); + let decimalFound = false; + let digitFound = false; + let n = 0; + if (this.peekType() & SIGN) + n++; + while (this.p + n <= this.N) { + if (this.peekType(n) & NUMBER) { + digitFound = true; + n++; + } + else if (this.peek(n) === '.' && this.peek(n + 1) !== '.') { + if (decimalFound || !digitFound) + return; + decimalFound = true; + n++; + } + else + break; + } + if (digitFound && !isWord(this.peek(n))) { + const num = new NumberToken(this.input, this.p, this.p + n, this.file); + this.advance(n); + return num; + } + } + readLiteral() { + this.skipBlank(); + const end = this.matchTrie(this.literalTrie); + if (end === -1) + return; + const literal = new LiteralToken(this.input, this.p, end, this.file); + this.p = end; + return literal; + } + readRange() { + this.skipBlank(); + const begin = this.p; + if (this.peek() !== '(') + return; + ++this.p; + const lhs = this.readValueOrThrow(); + this.p += 2; + const rhs = this.readValueOrThrow(); + ++this.p; + return new RangeToken(this.input, begin, this.p, lhs, rhs, this.file); + } + readValueOrThrow() { + const value = this.readValue(); + this.assert(value, () => `unexpected token ${this.snapshot()}, value expected`); + return value; + } + readQuoted() { + this.skipBlank(); + const begin = this.p; + if (!(this.peekType() & QUOTE)) + return; + ++this.p; + let escaped = false; + while (this.p < this.N) { + ++this.p; + if (this.input[this.p - 1] === this.input[begin] && !escaped) + break; + if (escaped) + escaped = false; + else if (this.input[this.p - 1] === '\\') + escaped = true; + } + return new QuotedToken(this.input, begin, this.p, this.file); + } + *readFileNameTemplate(options) { + const { outputDelimiterLeft } = options; + const htmlStopStrings = [',', ' ', outputDelimiterLeft]; + const htmlStopStringSet = new Set(htmlStopStrings); + // break on ',' and ' ', outputDelimiterLeft only stops HTML token + while (this.p < this.N && !htmlStopStringSet.has(this.peek())) { + yield this.match(outputDelimiterLeft) + ? this.readOutputToken(options) + : this.readHTMLToken(htmlStopStrings); + } + } + match(word) { + for (let i = 0; i < word.length; i++) { + if (word[i] !== this.input[this.p + i]) + return false; + } + return true; + } + rmatch(pattern) { + for (let i = 0; i < pattern.length; i++) { + if (pattern[pattern.length - 1 - i] !== this.input[this.p - 1 - i]) + return false; + } + return true; + } + peekType(n = 0) { + return this.p + n >= this.N ? 0 : TYPES[this.input.charCodeAt(this.p + n)]; + } + peek(n = 0) { + return this.p + n >= this.N ? '' : this.input[this.p + n]; + } + skipBlank() { + while (this.peekType() & BLANK) + ++this.p; + } +} + +class ParseStream { + constructor(tokens, parseToken) { + this.handlers = {}; + this.stopRequested = false; + this.tokens = tokens; + this.parseToken = parseToken; + } + on(name, cb) { + this.handlers[name] = cb; + return this; + } + trigger(event, arg) { + const h = this.handlers[event]; + return h ? (h.call(this, arg), true) : false; + } + start() { + this.trigger('start'); + let token; + while (!this.stopRequested && (token = this.tokens.shift())) { + if (this.trigger('token', token)) + continue; + if (isTagToken(token) && this.trigger(`tag:${token.name}`, token)) { + continue; + } + const template = this.parseToken(token, this.tokens); + this.trigger('template', template); + } + if (!this.stopRequested) + this.trigger('end'); + return this; + } + stop() { + this.stopRequested = true; + return this; + } +} + +class TemplateImpl { + constructor(token) { + this.token = token; + } +} + +class Tag extends TemplateImpl { + constructor(token, remainTokens, liquid) { + super(token); + this.name = token.name; + this.liquid = liquid; + this.tokenizer = token.tokenizer; + } +} + +/** + * Key-Value Pairs Representing Tag Arguments + * Example: + * For the markup `, foo:'bar', coo:2 reversed %}`, + * hash['foo'] === 'bar' + * hash['coo'] === 2 + * hash['reversed'] === undefined + */ +class Hash { + constructor(markup, jekyllStyle) { + this.hash = {}; + const tokenizer = new Tokenizer(markup, {}); + for (const hash of tokenizer.readHashes(jekyllStyle)) { + this.hash[hash.name.content] = hash.value; + } + } + *render(ctx) { + const hash = {}; + for (const key of Object.keys(this.hash)) { + hash[key] = this.hash[key] === undefined ? true : yield evalToken(this.hash[key], ctx); + } + return hash; + } +} + +function createTagClass(options) { + return class extends Tag { + constructor(token, tokens, liquid) { + super(token, tokens, liquid); + if (isFunction(options.parse)) { + options.parse.call(this, token, tokens); + } + } + *render(ctx, emitter) { + const hash = (yield new Hash(this.token.args).render(ctx)); + return yield options.render.call(this, ctx, emitter, hash); + } + }; +} + +function isKeyValuePair(arr) { + return isArray(arr); +} + +class Filter { + constructor(name, options, args, liquid) { + this.name = name; + this.handler = isFunction(options) + ? options + : (isFunction(options === null || options === void 0 ? void 0 : options.handler) ? options.handler : identify); + this.raw = !isFunction(options) && !!(options === null || options === void 0 ? void 0 : options.raw); + this.args = args; + this.liquid = liquid; + } + *render(value, context) { + const argv = []; + for (const arg of this.args) { + if (isKeyValuePair(arg)) + argv.push([arg[0], yield evalToken(arg[1], context)]); + else + argv.push(yield evalToken(arg, context)); + } + return yield this.handler.apply({ context, liquid: this.liquid }, [value, ...argv]); + } +} + +class Value { + /** + * @param str the value to be valuated, eg.: "foobar" | truncate: 3 + */ + constructor(input, liquid) { + this.filters = []; + const token = typeof input === 'string' + ? new Tokenizer(input, liquid.options.operators).readFilteredValue() + : input; + this.initial = token.initial; + this.filters = token.filters.map(({ name, args }) => new Filter(name, this.getFilter(liquid, name), args, liquid)); + } + *value(ctx, lenient) { + lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default'); + let val = yield this.initial.evaluate(ctx, lenient); + for (const filter of this.filters) { + val = yield filter.render(val, ctx); + } + return val; + } + getFilter(liquid, name) { + const impl = liquid.filters[name]; + assert(impl || !liquid.options.strictFilters, () => `undefined filter: ${name}`); + return impl; + } +} + +class Output extends TemplateImpl { + constructor(token, liquid) { + var _a; + super(token); + const tokenizer = new Tokenizer(token.input, liquid.options.operators, token.file, token.contentRange); + this.value = new Value(tokenizer.readFilteredValue(), liquid); + const filters = this.value.filters; + const outputEscape = liquid.options.outputEscape; + if (!((_a = filters[filters.length - 1]) === null || _a === void 0 ? void 0 : _a.raw) && outputEscape) { + filters.push(new Filter(toString.call(outputEscape), outputEscape, [], liquid)); + } + } + *render(ctx, emitter) { + const val = yield this.value.value(ctx, false); + emitter.write(val); + } +} + +class HTML extends TemplateImpl { + constructor(token) { + super(token); + this.str = token.getContent(); + } + *render(ctx, emitter) { + emitter.write(this.str); + } +} + +var LookupType; +(function (LookupType) { + LookupType["Partials"] = "partials"; + LookupType["Layouts"] = "layouts"; + LookupType["Root"] = "root"; +})(LookupType || (LookupType = {})); +class Loader { + constructor(options) { + this.options = options; + if (options.relativeReference) { + const sep = options.fs.sep; + assert(sep, '`fs.sep` is required for relative reference'); + const rRelativePath = new RegExp(['.' + sep, '..' + sep, './', '../'].map(prefix => escapeRegex(prefix)).join('|')); + this.shouldLoadRelative = (referencedFile) => rRelativePath.test(referencedFile); + } + else { + this.shouldLoadRelative = (referencedFile) => false; + } + this.contains = this.options.fs.contains || (() => true); + } + *lookup(file, type, sync, currentFile) { + const { fs } = this.options; + const dirs = this.options[type]; + for (const filepath of this.candidates(file, dirs, currentFile, type !== LookupType.Root)) { + if (sync ? fs.existsSync(filepath) : yield fs.exists(filepath)) + return filepath; + } + throw this.lookupError(file, dirs); + } + *candidates(file, dirs, currentFile, enforceRoot) { + const { fs, extname } = this.options; + if (this.shouldLoadRelative(file) && currentFile) { + const referenced = fs.resolve(this.dirname(currentFile), file, extname); + for (const dir of dirs) { + if (!enforceRoot || this.contains(dir, referenced)) { + // the relatively referenced file is within one of root dirs + yield referenced; + break; + } + } + } + for (const dir of dirs) { + const referenced = fs.resolve(dir, file, extname); + if (!enforceRoot || this.contains(dir, referenced)) { + yield referenced; + } + } + if (fs.fallback !== undefined) { + const filepath = fs.fallback(file); + if (filepath !== undefined) + yield filepath; + } + } + dirname(path) { + const fs = this.options.fs; + assert(fs.dirname, '`fs.dirname` is required for relative reference'); + return fs.dirname(path); + } + lookupError(file, roots) { + const err = new Error('ENOENT'); + err.message = `ENOENT: Failed to lookup "${file}" in "${roots}"`; + err.code = 'ENOENT'; + return err; + } +} + +class Parser { + constructor(liquid) { + this.liquid = liquid; + this.cache = this.liquid.options.cache; + this.fs = this.liquid.options.fs; + this.parseFile = this.cache ? this._parseFileCached : this._parseFile; + this.loader = new Loader(this.liquid.options); + } + parse(html, filepath) { + const tokenizer = new Tokenizer(html, this.liquid.options.operators, filepath); + const tokens = tokenizer.readTopLevelTokens(this.liquid.options); + return this.parseTokens(tokens); + } + parseTokens(tokens) { + let token; + const templates = []; + const errors = []; + while ((token = tokens.shift())) { + try { + templates.push(this.parseToken(token, tokens)); + } + catch (err) { + if (this.liquid.options.catchAllErrors) + errors.push(err); + else + throw err; + } + } + if (errors.length) + throw new LiquidErrors(errors); + return templates; + } + parseToken(token, remainTokens) { + try { + if (isTagToken(token)) { + const TagClass = this.liquid.tags[token.name]; + assert(TagClass, `tag "${token.name}" not found`); + return new TagClass(token, remainTokens, this.liquid); + } + if (isOutputToken(token)) { + return new Output(token, this.liquid); + } + return new HTML(token); + } + catch (e) { + if (LiquidError.is(e)) + throw e; + throw new ParseError(e, token); + } + } + parseStream(tokens) { + return new ParseStream(tokens, (token, tokens) => this.parseToken(token, tokens)); + } + *_parseFileCached(file, sync, type = LookupType.Root, currentFile) { + const cache = this.cache; + const key = this.loader.shouldLoadRelative(file) ? currentFile + ',' + file : type + ':' + file; + const tpls = yield cache.read(key); + if (tpls) + return tpls; + const task = this._parseFile(file, sync, type, currentFile); + // sync mode: exec the task and cache the result + // async mode: cache the task before exec + const taskOrTpl = sync ? yield task : toPromise(task); + cache.write(key, taskOrTpl); + // note: concurrent tasks will be reused, cache for failed task is removed until its end + try { + return yield taskOrTpl; + } + catch (err) { + cache.remove(key); + throw err; + } + } + *_parseFile(file, sync, type = LookupType.Root, currentFile) { + const filepath = yield this.loader.lookup(file, type, sync, currentFile); + return this.liquid.parse(sync ? this.fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath); + } +} + +var TokenKind; +(function (TokenKind) { + TokenKind[TokenKind["Number"] = 1] = "Number"; + TokenKind[TokenKind["Literal"] = 2] = "Literal"; + TokenKind[TokenKind["Tag"] = 4] = "Tag"; + TokenKind[TokenKind["Output"] = 8] = "Output"; + TokenKind[TokenKind["HTML"] = 16] = "HTML"; + TokenKind[TokenKind["Filter"] = 32] = "Filter"; + TokenKind[TokenKind["Hash"] = 64] = "Hash"; + TokenKind[TokenKind["PropertyAccess"] = 128] = "PropertyAccess"; + TokenKind[TokenKind["Word"] = 256] = "Word"; + TokenKind[TokenKind["Range"] = 512] = "Range"; + TokenKind[TokenKind["Quoted"] = 1024] = "Quoted"; + TokenKind[TokenKind["Operator"] = 2048] = "Operator"; + TokenKind[TokenKind["FilteredValue"] = 4096] = "FilteredValue"; + TokenKind[TokenKind["Delimited"] = 12] = "Delimited"; +})(TokenKind || (TokenKind = {})); + +function isDelimitedToken(val) { + return !!(getKind(val) & TokenKind.Delimited); +} +function isOperatorToken(val) { + return getKind(val) === TokenKind.Operator; +} +function isHTMLToken(val) { + return getKind(val) === TokenKind.HTML; +} +function isOutputToken(val) { + return getKind(val) === TokenKind.Output; +} +function isTagToken(val) { + return getKind(val) === TokenKind.Tag; +} +function isQuotedToken(val) { + return getKind(val) === TokenKind.Quoted; +} +function isLiteralToken(val) { + return getKind(val) === TokenKind.Literal; +} +function isNumberToken(val) { + return getKind(val) === TokenKind.Number; +} +function isPropertyAccessToken(val) { + return getKind(val) === TokenKind.PropertyAccess; +} +function isWordToken(val) { + return getKind(val) === TokenKind.Word; +} +function isRangeToken(val) { + return getKind(val) === TokenKind.Range; +} +function getKind(val) { + return val ? val.kind : -1; +} + +var typeGuards = /*#__PURE__*/Object.freeze({ + __proto__: null, + isDelimitedToken: isDelimitedToken, + isOperatorToken: isOperatorToken, + isHTMLToken: isHTMLToken, + isOutputToken: isOutputToken, + isTagToken: isTagToken, + isQuotedToken: isQuotedToken, + isLiteralToken: isLiteralToken, + isNumberToken: isNumberToken, + isPropertyAccessToken: isPropertyAccessToken, + isWordToken: isWordToken, + isRangeToken: isRangeToken +}); + +class Context { + constructor(env = {}, opts = defaultOptions, renderOptions = {}) { + var _a, _b, _c; + /** + * insert a Context-level empty scope, + * for tags like `{% capture %}` `{% assign %}` to operate + */ + this.scopes = [{}]; + this.registers = {}; + this.sync = !!renderOptions.sync; + this.opts = opts; + this.globals = (_a = renderOptions.globals) !== null && _a !== void 0 ? _a : opts.globals; + this.environments = isObject(env) ? env : Object(env); + this.strictVariables = (_b = renderOptions.strictVariables) !== null && _b !== void 0 ? _b : this.opts.strictVariables; + this.ownPropertyOnly = (_c = renderOptions.ownPropertyOnly) !== null && _c !== void 0 ? _c : opts.ownPropertyOnly; + } + getRegister(key) { + return (this.registers[key] = this.registers[key] || {}); + } + setRegister(key, value) { + return (this.registers[key] = value); + } + saveRegister(...keys) { + return keys.map(key => [key, this.getRegister(key)]); + } + restoreRegister(keyValues) { + return keyValues.forEach(([key, value]) => this.setRegister(key, value)); + } + getAll() { + return [this.globals, this.environments, ...this.scopes] + .reduce((ctx, val) => __assign(ctx, val), {}); + } + /** + * @deprecated use `_get()` or `getSync()` instead + */ + get(paths) { + return this.getSync(paths); + } + getSync(paths) { + return toValueSync(this._get(paths)); + } + *_get(paths) { + const scope = this.findScope(paths[0]); + return yield this._getFromScope(scope, paths); + } + /** + * @deprecated use `_get()` instead + */ + getFromScope(scope, paths) { + return toValueSync(this._getFromScope(scope, paths)); + } + *_getFromScope(scope, paths, strictVariables = this.strictVariables) { + if (isString(paths)) + paths = paths.split('.'); + for (let i = 0; i < paths.length; i++) { + scope = yield readProperty(scope, paths[i], this.ownPropertyOnly); + if (strictVariables && isUndefined(scope)) { + throw new InternalUndefinedVariableError(paths.slice(0, i + 1).join('.')); + } + } + return scope; + } + push(ctx) { + return this.scopes.push(ctx); + } + pop() { + return this.scopes.pop(); + } + bottom() { + return this.scopes[0]; + } + findScope(key) { + for (let i = this.scopes.length - 1; i >= 0; i--) { + const candidate = this.scopes[i]; + if (key in candidate) + return candidate; + } + if (key in this.environments) + return this.environments; + return this.globals; + } +} +function readProperty(obj, key, ownPropertyOnly) { + obj = toLiquid(obj); + if (isNil(obj)) + return obj; + if (isArray(obj) && key < 0) + return obj[obj.length + +key]; + const value = readJSProperty(obj, key, ownPropertyOnly); + if (value === undefined && obj instanceof Drop) + return obj.liquidMethodMissing(key); + if (isFunction(value)) + return value.call(obj); + if (key === 'size') + return readSize(obj); + else if (key === 'first') + return readFirst(obj); + else if (key === 'last') + return readLast(obj); + return value; +} +function readJSProperty(obj, key, ownPropertyOnly) { + if (ownPropertyOnly && !Object.hasOwnProperty.call(obj, key) && !(obj instanceof Drop)) + return undefined; + return obj[key]; +} +function readFirst(obj) { + if (isArray(obj)) + return obj[0]; + return obj['first']; +} +function readLast(obj) { + if (isArray(obj)) + return obj[obj.length - 1]; + return obj['last']; +} +function readSize(obj) { + if (obj.hasOwnProperty('size') || obj['size'] !== undefined) + return obj['size']; + if (isArray(obj) || isString(obj)) + return obj.length; + if (typeof obj === 'object') + return Object.keys(obj).length; +} + +var BlockMode; +(function (BlockMode) { + /* store rendered html into blocks */ + BlockMode[BlockMode["OUTPUT"] = 0] = "OUTPUT"; + /* output rendered html directly */ + BlockMode[BlockMode["STORE"] = 1] = "STORE"; +})(BlockMode || (BlockMode = {})); + +const abs = argumentsToValue(Math.abs); +const at_least = argumentsToValue(Math.max); +const at_most = argumentsToValue(Math.min); +const ceil = argumentsToValue(Math.ceil); +const divided_by = argumentsToValue((dividend, divisor, integerArithmetic = false) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor); +const floor = argumentsToValue(Math.floor); +const minus = argumentsToValue((v, arg) => v - arg); +const modulo = argumentsToValue((v, arg) => v % arg); +const times = argumentsToValue((v, arg) => v * arg); +function round(v, arg = 0) { + v = toValue(v); + arg = toValue(arg); + const amp = Math.pow(10, arg); + return Math.round(v * amp) / amp; +} +function plus(v, arg) { + v = toValue(v); + arg = toValue(arg); + return Number(v) + Number(arg); +} + +var mathFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + abs: abs, + at_least: at_least, + at_most: at_most, + ceil: ceil, + divided_by: divided_by, + floor: floor, + minus: minus, + modulo: modulo, + times: times, + round: round, + plus: plus +}); + +const url_decode = (x) => decodeURIComponent(stringify(x)).replace(/\+/g, ' '); +const url_encode = (x) => encodeURIComponent(stringify(x)).replace(/%20/g, '+'); +const cgi_escape = (x) => encodeURIComponent(stringify(x)) + .replace(/%20/g, '+') + .replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase()); +const uri_escape = (x) => encodeURI(stringify(x)) + .replace(/%5B/g, '[') + .replace(/%5D/g, ']'); +const rSlugifyDefault = /[^\p{M}\p{L}\p{Nd}]+/ug; +const rSlugifyReplacers = { + 'raw': /\s+/g, + 'default': rSlugifyDefault, + 'pretty': /[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/ug, + 'ascii': /[^A-Za-z0-9]+/g, + 'latin': rSlugifyDefault, + 'none': null +}; +function slugify(str, mode = 'default', cased = false) { + str = stringify(str); + const replacer = rSlugifyReplacers[mode]; + if (replacer) { + if (mode === 'latin') + str = removeAccents(str); + str = str.replace(replacer, '-').replace(/^-|-$/g, ''); + } + return cased ? str : str.toLowerCase(); +} +function removeAccents(str) { + return str.replace(/[àáâãäå]/g, 'a') + .replace(/[æ]/g, 'ae') + .replace(/[ç]/g, 'c') + .replace(/[èéêë]/g, 'e') + .replace(/[ìíîï]/g, 'i') + .replace(/[ð]/g, 'd') + .replace(/[ñ]/g, 'n') + .replace(/[òóôõöø]/g, 'o') + .replace(/[ùúûü]/g, 'u') + .replace(/[ýÿ]/g, 'y') + .replace(/[ß]/g, 'ss') + .replace(/[œ]/g, 'oe') + .replace(/[þ]/g, 'th') + .replace(/[ẞ]/g, 'SS') + .replace(/[Œ]/g, 'OE') + .replace(/[Þ]/g, 'TH'); +} + +var urlFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + url_decode: url_decode, + url_encode: url_encode, + cgi_escape: cgi_escape, + uri_escape: uri_escape, + slugify: slugify +}); + +const join = argumentsToValue((v, arg) => toArray(v).join(arg === undefined ? ' ' : arg)); +const last$1 = argumentsToValue((v) => isArray(v) ? last(v) : ''); +const first = argumentsToValue((v) => isArray(v) ? v[0] : ''); +const reverse = argumentsToValue((v) => [...toArray(v)].reverse()); +function* sort(arr, property) { + const values = []; + for (const item of toArray(arr)) { + values.push([ + item, + property ? yield this.context._getFromScope(item, stringify(property).split('.'), false) : item + ]); + } + return values.sort((lhs, rhs) => { + const lvalue = lhs[1]; + const rvalue = rhs[1]; + return lvalue < rvalue ? -1 : (lvalue > rvalue ? 1 : 0); + }).map(tuple => tuple[0]); +} +function sort_natural(input, property) { + const propertyString = stringify(property); + const compare = property === undefined + ? caseInsensitiveCompare + : (lhs, rhs) => caseInsensitiveCompare(lhs[propertyString], rhs[propertyString]); + return [...toArray(input)].sort(compare); +} +const size = (v) => (v && v.length) || 0; +function* map(arr, property) { + const results = []; + for (const item of toArray(arr)) { + results.push(yield this.context._getFromScope(item, stringify(property), false)); + } + return results; +} +function* sum(arr, property) { + let sum = 0; + for (const item of toArray(arr)) { + const data = Number(property ? yield this.context._getFromScope(item, stringify(property), false) : item); + sum += Number.isNaN(data) ? 0 : data; + } + return sum; +} +function compact(arr) { + return toArray(arr).filter(x => !isNil(toValue(x))); +} +function concat(v, arg = []) { + return toArray(v).concat(toArray(arg)); +} +function push(v, arg) { + return concat(v, [arg]); +} +function unshift(v, arg) { + const clone = [...toArray(v)]; + clone.unshift(arg); + return clone; +} +function pop(v) { + const clone = [...toArray(v)]; + clone.pop(); + return clone; +} +function shift(v) { + const clone = [...toArray(v)]; + clone.shift(); + return clone; +} +function slice(v, begin, length = 1) { + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + begin = begin < 0 ? v.length + begin : begin; + return v.slice(begin, begin + length); +} +function* where(arr, property, expected) { + const values = []; + arr = toArray(arr); + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of arr) { + values.push(yield evalToken(token, new Context(item))); + } + return arr.filter((_, i) => { + if (expected === undefined) + return isTruthy(values[i], this.context); + return equals(values[i], expected); + }); +} +function* where_exp(arr, itemName, exp) { + const filtered = []; + const keyTemplate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const value = yield keyTemplate.value(new Context({ [itemName]: item })); + if (value) + filtered.push(item); + } + return filtered; +} +function* group_by(arr, property) { + const map = new Map(); + arr = toArray(arr); + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of arr) { + const key = yield evalToken(token, new Context(item)); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + } + return [...map.entries()].map(([name, items]) => ({ name, items })); +} +function* group_by_exp(arr, itemName, exp) { + const map = new Map(); + const keyTemplate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const key = yield keyTemplate.value(new Context({ [itemName]: item })); + if (!map.has(key)) + map.set(key, []); + map.get(key).push(item); + } + return [...map.entries()].map(([name, items]) => ({ name, items })); +} +function* find(arr, property, expected) { + const token = new Tokenizer(stringify(property)).readScopeValue(); + for (const item of toArray(arr)) { + const value = yield evalToken(token, new Context(item)); + if (equals(value, expected)) + return item; + } + return null; +} +function* find_exp(arr, itemName, exp) { + const predicate = new Value(stringify(exp), this.liquid); + for (const item of toArray(arr)) { + const value = yield predicate.value(new Context({ [itemName]: item })); + if (value) + return item; + } + return null; +} +function uniq(arr) { + arr = toValue(arr); + const u = {}; + return (arr || []).filter(val => { + if (hasOwnProperty.call(u, String(val))) + return false; + u[String(val)] = true; + return true; + }); +} +function sample(v, count = 1) { + v = toValue(v); + if (isNil(v)) + return []; + if (!isArray(v)) + v = stringify(v); + const shuffled = [...v].sort(() => Math.random() - 0.5); + if (count === 1) + return shuffled[0]; + return shuffled.slice(0, count); +} + +var arrayFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + join: join, + last: last$1, + first: first, + reverse: reverse, + sort: sort, + sort_natural: sort_natural, + size: size, + map: map, + sum: sum, + compact: compact, + concat: concat, + push: push, + unshift: unshift, + pop: pop, + shift: shift, + slice: slice, + where: where, + where_exp: where_exp, + group_by: group_by, + group_by_exp: group_by_exp, + find: find, + find_exp: find_exp, + uniq: uniq, + sample: sample +}); + +function date(v, format, timezoneOffset) { + const date = parseDate(v, this.context.opts, timezoneOffset); + if (!date) + return v; + format = toValue(format); + format = isNil(format) ? this.context.opts.dateFormat : stringify(format); + return strftime(date, format); +} +function date_to_xmlschema(v) { + return date.call(this, v, '%Y-%m-%dT%H:%M:%S%:z'); +} +function date_to_rfc822(v) { + return date.call(this, v, '%a, %d %b %Y %H:%M:%S %z'); +} +function date_to_string(v, type, style) { + return stringify_date.call(this, v, '%b', type, style); +} +function date_to_long_string(v, type, style) { + return stringify_date.call(this, v, '%B', type, style); +} +function stringify_date(v, month_type, type, style) { + const date = parseDate(v, this.context.opts); + if (!date) + return v; + if (type === 'ordinal') { + const d = date.getDate(); + return style === 'US' + ? strftime(date, `${month_type} ${d}%q, %Y`) + : strftime(date, `${d}%q ${month_type} %Y`); + } + return strftime(date, `%d ${month_type} %Y`); +} +function parseDate(v, opts, timezoneOffset) { + let date; + v = toValue(v); + if (v === 'now' || v === 'today') { + date = new Date(); + } + else if (isNumber(v)) { + date = new Date(v * 1000); + } + else if (isString(v)) { + if (/^\d+$/.test(v)) { + date = new Date(+v * 1000); + } + else if (opts.preserveTimezones) { + date = TimezoneDate.createDateFixedToTimezone(v); + } + else { + date = new Date(v); + } + } + else { + date = v; + } + if (!isValidDate(date)) + return; + if (timezoneOffset !== undefined) { + date = new TimezoneDate(date, timezoneOffset); + } + else if (!(date instanceof TimezoneDate) && opts.timezoneOffset !== undefined) { + date = new TimezoneDate(date, opts.timezoneOffset); + } + return date; +} +function isValidDate(date) { + return (date instanceof Date || date instanceof TimezoneDate) && !isNaN(date.getTime()); +} + +var dateFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + date: date, + date_to_xmlschema: date_to_xmlschema, + date_to_rfc822: date_to_rfc822, + date_to_string: date_to_string, + date_to_long_string: date_to_long_string +}); + +/** + * String related filters + * + * * prefer stringify() to String() since `undefined`, `null` should eval '' + */ +const rCJKWord = /[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu; +// Word boundary followed by word characters (for detecting words) +const rNonCJKWord = /[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu; +function append(v, arg) { + assert(arguments.length === 2, 'append expect 2 arguments'); + return stringify(v) + stringify(arg); +} +function prepend(v, arg) { + assert(arguments.length === 2, 'prepend expect 2 arguments'); + return stringify(arg) + stringify(v); +} +function lstrip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v).replace(new RegExp(`^[${chars}]+`, 'g'), ''); + } + return stringify(v).replace(/^\s+/, ''); +} +function downcase(v) { + return stringify(v).toLowerCase(); +} +function upcase(str) { + return stringify(str).toUpperCase(); +} +function remove(v, arg) { + return stringify(v).split(stringify(arg)).join(''); +} +function remove_first(v, l) { + return stringify(v).replace(stringify(l), ''); +} +function remove_last(v, l) { + const str = stringify(v); + const pattern = stringify(l); + const index = str.lastIndexOf(pattern); + if (index === -1) + return str; + return str.substring(0, index) + str.substring(index + pattern.length); +} +function rstrip(str, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(str).replace(new RegExp(`[${chars}]+$`, 'g'), ''); + } + return stringify(str).replace(/\s+$/, ''); +} +function split(v, arg) { + const arr = stringify(v).split(stringify(arg)); + // align to ruby split, which is the behavior of shopify/liquid + // see: https://ruby-doc.org/core-2.4.0/String.html#method-i-split + while (arr.length && arr[arr.length - 1] === '') + arr.pop(); + return arr; +} +function strip(v, chars) { + if (chars) { + chars = escapeRegExp(stringify(chars)); + return stringify(v) + .replace(new RegExp(`^[${chars}]+`, 'g'), '') + .replace(new RegExp(`[${chars}]+$`, 'g'), ''); + } + return stringify(v).trim(); +} +function strip_newlines(v) { + return stringify(v).replace(/\r?\n/gm, ''); +} +function capitalize(str) { + str = stringify(str); + return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); +} +function replace(v, pattern, replacement) { + return stringify(v).split(stringify(pattern)).join(replacement); +} +function replace_first(v, arg1, arg2) { + return stringify(v).replace(stringify(arg1), arg2); +} +function replace_last(v, arg1, arg2) { + const str = stringify(v); + const pattern = stringify(arg1); + const index = str.lastIndexOf(pattern); + if (index === -1) + return str; + const replacement = stringify(arg2); + return str.substring(0, index) + replacement + str.substring(index + pattern.length); +} +function truncate(v, l = 50, o = '...') { + v = stringify(v); + if (v.length <= l) + return v; + return v.substring(0, l - o.length) + o; +} +function truncatewords(v, words = 15, o = '...') { + const arr = stringify(v).split(/\s+/); + if (words <= 0) + words = 1; + let ret = arr.slice(0, words).join(' '); + if (arr.length >= words) + ret += o; + return ret; +} +function normalize_whitespace(v) { + v = stringify(v); + return v.replace(/\s+/g, ' '); +} +function number_of_words(input, mode) { + input = stringify(input).trim(); + if (!input) + return 0; + switch (mode) { + case 'cjk': + // Count CJK characters and words + return (input.match(rCJKWord) || []).length + (input.match(rNonCJKWord) || []).length; + case 'auto': + // Count CJK characters, if none, count words + return rCJKWord.test(input) + ? input.match(rCJKWord).length + (input.match(rNonCJKWord) || []).length + : input.split(/\s+/).length; + default: + // Count words only + return input.split(/\s+/).length; + } +} +function array_to_sentence_string(array, connector = 'and') { + switch (array.length) { + case 0: + return ''; + case 1: + return array[0]; + case 2: + return `${array[0]} ${connector} ${array[1]}`; + default: + return `${array.slice(0, -1).join(', ')}, ${connector} ${array[array.length - 1]}`; + } +} + +var stringFilters = /*#__PURE__*/Object.freeze({ + __proto__: null, + append: append, + prepend: prepend, + lstrip: lstrip, + downcase: downcase, + upcase: upcase, + remove: remove, + remove_first: remove_first, + remove_last: remove_last, + rstrip: rstrip, + split: split, + strip: strip, + strip_newlines: strip_newlines, + capitalize: capitalize, + replace: replace, + replace_first: replace_first, + replace_last: replace_last, + truncate: truncate, + truncatewords: truncatewords, + normalize_whitespace: normalize_whitespace, + number_of_words: number_of_words, + array_to_sentence_string: array_to_sentence_string +}); + +const filters = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, htmlFilters), mathFilters), urlFilters), arrayFilters), dateFilters), stringFilters), misc); + +class AssignTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.key = this.tokenizer.readIdentifier().content; + this.tokenizer.assert(this.key, 'expected variable name'); + this.tokenizer.skipBlank(); + this.tokenizer.assert(this.tokenizer.peek() === '=', 'expected "="'); + this.tokenizer.advance(); + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + } + *render(ctx) { + ctx.bottom()[this.key] = yield this.value.value(ctx, this.liquid.options.lenientIf); + } +} + +const MODIFIERS = ['offset', 'limit', 'reversed']; +class ForTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const variable = this.tokenizer.readIdentifier(); + const inStr = this.tokenizer.readIdentifier(); + const collection = this.tokenizer.readValue(); + if (!variable.size() || inStr.content !== 'in' || !collection) { + throw new Error(`illegal tag: ${token.getText()}`); + } + this.variable = variable.content; + this.collection = collection; + this.hash = new Hash(this.tokenizer.remaining()); + this.templates = []; + this.elseTemplates = []; + let p; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('start', () => (p = this.templates)) + .on('tag:else', () => (p = this.elseTemplates)) + .on('tag:endfor', () => stream.stop()) + .on('template', (tpl) => p.push(tpl)) + .on('end', () => { + throw new Error(`tag ${token.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + let collection = toEnumerable(yield evalToken(this.collection, ctx)); + if (!collection.length) { + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + return; + } + const continueKey = 'continue-' + this.variable + '-' + this.collection.getText(); + ctx.push({ continue: ctx.getRegister(continueKey) }); + const hash = yield this.hash.render(ctx); + ctx.pop(); + const modifiers = this.liquid.options.orderedFilterParameters + ? Object.keys(hash).filter(x => MODIFIERS.includes(x)) + : MODIFIERS.filter(x => hash[x] !== undefined); + collection = modifiers.reduce((collection, modifier) => { + if (modifier === 'offset') + return offset(collection, hash['offset']); + if (modifier === 'limit') + return limit(collection, hash['limit']); + return reversed(collection); + }, collection); + ctx.setRegister(continueKey, (hash['offset'] || 0) + collection.length); + const scope = { forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) }; + ctx.push(scope); + for (const item of collection) { + scope[this.variable] = item; + yield r.renderTemplates(this.templates, ctx, emitter); + if (emitter['break']) { + emitter['break'] = false; + break; + } + emitter['continue'] = false; + scope.forloop.next(); + } + ctx.pop(); + } +} +function reversed(arr) { + return [...arr].reverse(); +} +function offset(arr, count) { + return arr.slice(count); +} +function limit(arr, count) { + return arr.slice(0, count); +} + +class CaptureTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.templates = []; + this.variable = this.readVariableName(); + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcapture') + return; + this.templates.push(liquid.parser.parseToken(token, remainTokens)); + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + *render(ctx) { + const r = this.liquid.renderer; + const html = yield r.renderTemplates(this.templates, ctx); + ctx.bottom()[this.variable] = html; + } + readVariableName() { + const word = this.tokenizer.readIdentifier().content; + if (word) + return word; + const quoted = this.tokenizer.readQuoted(); + if (quoted) + return evalQuotedToken(quoted); + throw this.tokenizer.error('invalid capture name'); + } +} + +class CaseTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + this.elseTemplates = []; + let p = []; + let elseCount = 0; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('tag:when', (token) => { + if (elseCount > 0) { + return; + } + p = []; + const values = []; + while (!token.tokenizer.end()) { + values.push(token.tokenizer.readValueOrThrow()); + token.tokenizer.skipBlank(); + if (token.tokenizer.peek() === ',') { + token.tokenizer.readTo(','); + } + else { + token.tokenizer.readTo('or'); + } + } + this.branches.push({ + values, + templates: p + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endcase', () => stream.stop()) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { + throw new Error(`tag ${tagToken.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + const target = toValue(yield this.value.value(ctx, ctx.opts.lenientIf)); + let branchHit = false; + for (const branch of this.branches) { + for (const valueToken of branch.values) { + const value = yield evalToken(valueToken, ctx, ctx.opts.lenientIf); + if (equals(target, value)) { + yield r.renderTemplates(branch.templates, ctx, emitter); + branchHit = true; + break; + } + } + } + if (!branchHit) { + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } + } +} + +class CommentTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endcomment') + return; + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + render() { } +} + +class RenderTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const tokenizer = this.tokenizer; + this.file = parseFilePath(tokenizer, this.liquid); + this.currentFile = token.file; + while (!tokenizer.end()) { + tokenizer.skipBlank(); + const begin = tokenizer.p; + const keyword = tokenizer.readIdentifier(); + if (keyword.content === 'with' || keyword.content === 'for') { + tokenizer.skipBlank(); + // can be normal key/value pair, like "with: true" + if (tokenizer.peek() !== ':') { + const value = tokenizer.readValue(); + // can be normal key, like "with," + if (value) { + const beforeAs = tokenizer.p; + const asStr = tokenizer.readIdentifier(); + let alias; + if (asStr.content === 'as') + alias = tokenizer.readIdentifier(); + else + tokenizer.p = beforeAs; + this[keyword.content] = { value, alias: alias && alias.content }; + tokenizer.skipBlank(); + if (tokenizer.peek() === ',') + tokenizer.advance(); + continue; // matched! + } + } + } + /** + * restore cursor if with/for not matched + */ + tokenizer.p = begin; + break; + } + this.hash = new Hash(tokenizer.remaining()); + } + *render(ctx, emitter) { + const { liquid, hash } = this; + const filepath = (yield renderFilePath(this['file'], ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables }); + const scope = childCtx.bottom(); + __assign(scope, yield hash.render(ctx)); + if (this['with']) { + const { value, alias } = this['with']; + scope[alias || filepath] = yield evalToken(value, ctx); + } + if (this['for']) { + const { value, alias } = this['for']; + const collection = toEnumerable(yield evalToken(value, ctx)); + scope['forloop'] = new ForloopDrop(collection.length, value.getText(), alias); + for (const item of collection) { + scope[alias] = item; + const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])); + yield liquid.renderer.renderTemplates(templates, childCtx, emitter); + scope['forloop'].next(); + } + } + else { + const templates = (yield liquid._parsePartialFile(filepath, childCtx.sync, this['currentFile'])); + yield liquid.renderer.renderTemplates(templates, childCtx, emitter); + } + } +} +/** + * @return null for "none", + * @return Template[] for quoted with tags and/or filters + * @return Token for expression (not quoted) + * @throws TypeError if cannot read next token + */ +function parseFilePath(tokenizer, liquid) { + if (liquid.options.dynamicPartials) { + const file = tokenizer.readValue(); + tokenizer.assert(file, 'illegal file path'); + if (file.getText() === 'none') + return; + if (isQuotedToken(file)) { + // for filenames like "files/{{file}}", eval as liquid template + const templates = liquid.parse(evalQuotedToken(file)); + return optimize(templates); + } + return file; + } + const tokens = [...tokenizer.readFileNameTemplate(liquid.options)]; + const templates = optimize(liquid.parser.parseTokens(tokens)); + return templates === 'none' ? undefined : templates; +} +function optimize(templates) { + // for filenames like "files/file.liquid", extract the string directly + if (templates.length === 1 && isHTMLToken(templates[0].token)) + return templates[0].token.getContent(); + return templates; +} +function* renderFilePath(file, ctx, liquid) { + if (typeof file === 'string') + return file; + if (Array.isArray(file)) + return liquid.renderer.renderTemplates(file, ctx); + return yield evalToken(file, ctx); +} + +class IncludeTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const { tokenizer } = token; + this['file'] = parseFilePath(tokenizer, this.liquid); + this['currentFile'] = token.file; + const begin = tokenizer.p; + const withStr = tokenizer.readIdentifier(); + if (withStr.content === 'with') { + tokenizer.skipBlank(); + if (tokenizer.peek() !== ':') { + this.withVar = tokenizer.readValue(); + } + else + tokenizer.p = begin; + } + else + tokenizer.p = begin; + this.hash = new Hash(tokenizer.remaining(), this.liquid.options.jekyllInclude); + } + *render(ctx, emitter) { + const { liquid, hash, withVar } = this; + const { renderer } = liquid; + const filepath = (yield renderFilePath(this['file'], ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const saved = ctx.saveRegister('blocks', 'blockMode'); + ctx.setRegister('blocks', {}); + ctx.setRegister('blockMode', BlockMode.OUTPUT); + const scope = (yield hash.render(ctx)); + if (withVar) + scope[filepath] = yield evalToken(withVar, ctx); + const templates = (yield liquid._parsePartialFile(filepath, ctx.sync, this['currentFile'])); + ctx.push(ctx.opts.jekyllInclude ? { include: scope } : scope); + yield renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + ctx.restoreRegister(saved); + } +} + +class DecrementTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.variable = this.tokenizer.readIdentifier().content; + } + render(context, emitter) { + const scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + emitter.write(stringify(--scope[this.variable])); + } +} + +class CycleTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.candidates = []; + const group = this.tokenizer.readValue(); + this.tokenizer.skipBlank(); + if (group) { + if (this.tokenizer.peek() === ':') { + this.group = group; + this.tokenizer.advance(); + } + else + this.candidates.push(group); + } + while (!this.tokenizer.end()) { + const value = this.tokenizer.readValue(); + if (value) + this.candidates.push(value); + this.tokenizer.readTo(','); + } + this.tokenizer.assert(this.candidates.length, () => `empty candidates: "${token.getText()}"`); + } + *render(ctx, emitter) { + const group = (yield evalToken(this.group, ctx)); + const fingerprint = `cycle:${group}:` + this.candidates.join(','); + const groups = ctx.getRegister('cycle'); + let idx = groups[fingerprint]; + if (idx === undefined) { + idx = groups[fingerprint] = 0; + } + const candidate = this.candidates[idx]; + idx = (idx + 1) % this.candidates.length; + groups[fingerprint] = idx; + return yield evalToken(candidate, ctx); + } +} + +class IfTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + let p = []; + let elseCount = 0; + liquid.parser.parseStream(remainTokens) + .on('start', () => this.branches.push({ + value: new Value(tagToken.args, this.liquid), + templates: (p = []) + })) + .on('tag:elsif', (token) => { + if (elseCount > 0) { + p = []; + return; + } + this.branches.push({ + value: new Value(token.args, this.liquid), + templates: (p = []) + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endif', function () { this.stop(); }) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`); }) + .start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + for (const { value, templates } of this.branches) { + const v = yield value.value(ctx, ctx.opts.lenientIf); + if (isTruthy(v, ctx)) { + yield r.renderTemplates(templates, ctx, emitter); + return; + } + } + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } +} + +class IncrementTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.variable = this.tokenizer.readIdentifier().content; + } + render(context, emitter) { + const scope = context.environments; + if (!isNumber(scope[this.variable])) { + scope[this.variable] = 0; + } + const val = scope[this.variable]; + scope[this.variable]++; + emitter.write(stringify(val)); + } +} + +class LayoutTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.file = parseFilePath(this.tokenizer, this.liquid); + this['currentFile'] = token.file; + this.args = new Hash(this.tokenizer.remaining()); + this.templates = this.liquid.parser.parseTokens(remainTokens); + } + *render(ctx, emitter) { + const { liquid, args, file } = this; + const { renderer } = liquid; + if (file === undefined) { + ctx.setRegister('blockMode', BlockMode.OUTPUT); + yield renderer.renderTemplates(this.templates, ctx, emitter); + return; + } + const filepath = (yield renderFilePath(this.file, ctx, liquid)); + assert(filepath, () => `illegal file path "${filepath}"`); + const templates = (yield liquid._parseLayoutFile(filepath, ctx.sync, this['currentFile'])); + // render remaining contents and store rendered results + ctx.setRegister('blockMode', BlockMode.STORE); + const html = yield renderer.renderTemplates(this.templates, ctx); + const blocks = ctx.getRegister('blocks'); + // set whole content to anonymous block if anonymous doesn't specified + if (blocks[''] === undefined) + blocks[''] = (parent, emitter) => emitter.write(html); + ctx.setRegister('blockMode', BlockMode.OUTPUT); + // render the layout file use stored blocks + ctx.push((yield args.render(ctx))); + yield renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + } +} + +class BlockTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.templates = []; + const match = /\w+/.exec(token.args); + this.block = match ? match[0] : ''; + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endblock') + return; + const template = liquid.parser.parseToken(token, remainTokens); + this.templates.push(template); + } + throw new Error(`tag ${token.getText()} not closed`); + } + *render(ctx, emitter) { + const blockRender = this.getBlockRender(ctx); + if (ctx.getRegister('blockMode') === BlockMode.STORE) { + ctx.getRegister('blocks')[this.block] = blockRender; + } + else { + yield blockRender(new BlockDrop(), emitter); + } + } + getBlockRender(ctx) { + const { liquid, templates } = this; + const renderChild = ctx.getRegister('blocks')[this.block]; + const renderCurrent = function* (superBlock, emitter) { + // add {{ block.super }} support when rendering + ctx.push({ block: superBlock }); + yield liquid.renderer.renderTemplates(templates, ctx, emitter); + ctx.pop(); + }; + return renderChild + ? (superBlock, emitter) => renderChild(new BlockDrop(() => renderCurrent(superBlock, emitter)), emitter) + : renderCurrent; + } +} + +class RawTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.tokens = []; + while (remainTokens.length) { + const token = remainTokens.shift(); + if (isTagToken(token) && token.name === 'endraw') + return; + this.tokens.push(token); + } + throw new Error(`tag ${tagToken.getText()} not closed`); + } + render() { + return this.tokens.map((token) => token.getText()).join(''); + } +} + +class TablerowloopDrop extends ForloopDrop { + constructor(length, cols, collection, variable) { + super(length, collection, variable); + this.length = length; + this.cols = cols; + } + row() { + return Math.floor(this.i / this.cols) + 1; + } + col0() { + return (this.i % this.cols); + } + col() { + return this.col0() + 1; + } + col_first() { + return this.col0() === 0; + } + col_last() { + return this.col() === this.cols; + } +} + +class TablerowTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + const variable = this.tokenizer.readIdentifier(); + this.tokenizer.skipBlank(); + const predicate = this.tokenizer.readIdentifier(); + const collectionToken = this.tokenizer.readValue(); + if (predicate.content !== 'in' || !collectionToken) { + throw new Error(`illegal tag: ${tagToken.getText()}`); + } + this.variable = variable.content; + this.collection = collectionToken; + this.args = new Hash(this.tokenizer.remaining()); + this.templates = []; + let p; + const stream = this.liquid.parser.parseStream(remainTokens) + .on('start', () => (p = this.templates)) + .on('tag:endtablerow', () => stream.stop()) + .on('template', (tpl) => p.push(tpl)) + .on('end', () => { + throw new Error(`tag ${tagToken.getText()} not closed`); + }); + stream.start(); + } + *render(ctx, emitter) { + let collection = toEnumerable(yield evalToken(this.collection, ctx)); + const args = (yield this.args.render(ctx)); + const offset = args.offset || 0; + const limit = (args.limit === undefined) ? collection.length : args.limit; + collection = collection.slice(offset, offset + limit); + const cols = args.cols || collection.length; + const r = this.liquid.renderer; + const tablerowloop = new TablerowloopDrop(collection.length, cols, this.collection.getText(), this.variable); + const scope = { tablerowloop }; + ctx.push(scope); + for (let idx = 0; idx < collection.length; idx++, tablerowloop.next()) { + scope[this.variable] = collection[idx]; + if (tablerowloop.col0() === 0) { + if (tablerowloop.row() !== 1) + emitter.write(''); + emitter.write(``); + } + emitter.write(``); + yield r.renderTemplates(this.templates, ctx, emitter); + emitter.write(''); + } + if (collection.length) + emitter.write(''); + ctx.pop(); + } +} + +class UnlessTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + this.branches = []; + this.elseTemplates = []; + let p = []; + let elseCount = 0; + this.liquid.parser.parseStream(remainTokens) + .on('start', () => this.branches.push({ + value: new Value(tagToken.args, this.liquid), + test: isFalsy, + templates: (p = []) + })) + .on('tag:elsif', (token) => { + if (elseCount > 0) { + p = []; + return; + } + this.branches.push({ + value: new Value(token.args, this.liquid), + test: isTruthy, + templates: (p = []) + }); + }) + .on('tag:else', () => { + elseCount++; + p = this.elseTemplates; + }) + .on('tag:endunless', function () { this.stop(); }) + .on('template', (tpl) => { + if (p !== this.elseTemplates || elseCount === 1) { + p.push(tpl); + } + }) + .on('end', () => { throw new Error(`tag ${tagToken.getText()} not closed`); }) + .start(); + } + *render(ctx, emitter) { + const r = this.liquid.renderer; + for (const { value, test, templates } of this.branches) { + const v = yield value.value(ctx, ctx.opts.lenientIf); + if (test(v, ctx)) { + yield r.renderTemplates(templates, ctx, emitter); + return; + } + } + yield r.renderTemplates(this.elseTemplates, ctx, emitter); + } +} + +class BreakTag extends Tag { + render(ctx, emitter) { + emitter['break'] = true; + } +} + +class ContinueTag extends Tag { + render(ctx, emitter) { + emitter['continue'] = true; + } +} + +class EchoTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + this.tokenizer.skipBlank(); + if (!this.tokenizer.end()) { + this.value = new Value(this.tokenizer.readFilteredValue(), this.liquid); + } + } + *render(ctx, emitter) { + if (!this.value) + return; + const val = yield this.value.value(ctx, false); + emitter.write(val); + } +} + +class LiquidTag extends Tag { + constructor(token, remainTokens, liquid) { + super(token, remainTokens, liquid); + const tokens = this.tokenizer.readLiquidTagTokens(this.liquid.options); + this.templates = this.liquid.parser.parseTokens(tokens); + } + *render(ctx, emitter) { + yield this.liquid.renderer.renderTemplates(this.templates, ctx, emitter); + } +} + +class InlineCommentTag extends Tag { + constructor(tagToken, remainTokens, liquid) { + super(tagToken, remainTokens, liquid); + if (tagToken.args.search(/\n\s*[^#\s]/g) !== -1) { + throw new Error('every line of an inline comment must start with a \'#\' character'); + } + } + render() { } +} + +const tags = { + assign: AssignTag, + 'for': ForTag, + capture: CaptureTag, + 'case': CaseTag, + comment: CommentTag, + include: IncludeTag, + render: RenderTag, + decrement: DecrementTag, + increment: IncrementTag, + cycle: CycleTag, + 'if': IfTag, + layout: LayoutTag, + block: BlockTag, + raw: RawTag, + tablerow: TablerowTag, + unless: UnlessTag, + 'break': BreakTag, + 'continue': ContinueTag, + echo: EchoTag, + liquid: LiquidTag, + '#': InlineCommentTag +}; + +class Liquid { + constructor(opts = {}) { + this.renderer = new Render(); + this.filters = {}; + this.tags = {}; + this.options = normalize(opts); + this.parser = new Parser(this); + forOwn(tags, (conf, name) => this.registerTag(name, conf)); + forOwn(filters, (handler, name) => this.registerFilter(name, handler)); + } + parse(html, filepath) { + return this.parser.parse(html, filepath); + } + _render(tpl, scope, renderOptions) { + const ctx = scope instanceof Context ? scope : new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplates(tpl, ctx); + } + render(tpl, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._render(tpl, scope, Object.assign(Object.assign({}, renderOptions), { sync: false }))); + }); + } + renderSync(tpl, scope, renderOptions) { + return toValueSync(this._render(tpl, scope, Object.assign(Object.assign({}, renderOptions), { sync: true }))); + } + renderToNodeStream(tpl, scope, renderOptions = {}) { + const ctx = new Context(scope, this.options, renderOptions); + return this.renderer.renderTemplatesToNodeStream(tpl, ctx); + } + _parseAndRender(html, scope, renderOptions) { + const tpl = this.parse(html); + return this._render(tpl, scope, renderOptions); + } + parseAndRender(html, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._parseAndRender(html, scope, Object.assign(Object.assign({}, renderOptions), { sync: false }))); + }); + } + parseAndRenderSync(html, scope, renderOptions) { + return toValueSync(this._parseAndRender(html, scope, Object.assign(Object.assign({}, renderOptions), { sync: true }))); + } + _parsePartialFile(file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Partials, currentFile); + } + _parseLayoutFile(file, sync, currentFile) { + return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile); + } + _parseFile(file, sync, lookupType, currentFile) { + return this.parser.parseFile(file, sync, lookupType, currentFile); + } + parseFile(file, lookupType) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this.parser.parseFile(file, false, lookupType)); + }); + } + parseFileSync(file, lookupType) { + return toValueSync(this.parser.parseFile(file, true, lookupType)); + } + *_renderFile(file, ctx, renderFileOptions) { + const templates = (yield this._parseFile(file, renderFileOptions.sync, renderFileOptions.lookupType)); + return yield this._render(templates, ctx, renderFileOptions); + } + renderFile(file, ctx, renderFileOptions) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._renderFile(file, ctx, Object.assign(Object.assign({}, renderFileOptions), { sync: false }))); + }); + } + renderFileSync(file, ctx, renderFileOptions) { + return toValueSync(this._renderFile(file, ctx, Object.assign(Object.assign({}, renderFileOptions), { sync: true }))); + } + renderFileToNodeStream(file, scope, renderOptions) { + return __awaiter(this, void 0, void 0, function* () { + const templates = yield this.parseFile(file); + return this.renderToNodeStream(templates, scope, renderOptions); + }); + } + _evalValue(str, scope) { + const value = new Value(str, this); + const ctx = scope instanceof Context ? scope : new Context(scope, this.options); + return value.value(ctx); + } + evalValue(str, scope) { + return __awaiter(this, void 0, void 0, function* () { + return toPromise(this._evalValue(str, scope)); + }); + } + evalValueSync(str, scope) { + return toValueSync(this._evalValue(str, scope)); + } + registerFilter(name, filter) { + this.filters[name] = filter; + } + registerTag(name, tag) { + this.tags[name] = isFunction(tag) ? tag : createTagClass(tag); + } + plugin(plugin) { + return plugin.call(this, Liquid); + } + express() { + const self = this; // eslint-disable-line + let firstCall = true; + return function (filePath, ctx, callback) { + if (firstCall) { + firstCall = false; + const dirs = normalizeDirectoryList(this.root); + self.options.root.unshift(...dirs); + self.options.layouts.unshift(...dirs); + self.options.partials.unshift(...dirs); + } + self.renderFile(filePath, ctx).then(html => callback(null, html), callback); + }; + } +} + +/* istanbul ignore file */ +const version = '10.14.0'; + +export { AssertionError, AssignTag, BlockTag, BreakTag, CaptureTag, CaseTag, CommentTag, Context, ContinueTag, CycleTag, DecrementTag, Drop, EchoTag, Expression, Filter, ForTag, Hash, IfTag, IncludeTag, IncrementTag, InlineCommentTag, LayoutTag, Liquid, LiquidError, LiquidTag, Output, ParseError, ParseStream, RawTag, RenderError, RenderTag, TablerowTag, Tag, TagToken, TimezoneDate, Token, TokenKind, TokenizationError, Tokenizer, typeGuards as TypeGuards, UndefinedVariableError, UnlessTag, Value, assert, createTrie, defaultOperators, defaultOptions, evalQuotedToken, evalToken, filters, isFalsy, isTruthy, tags, toPromise, toValue, toValueSync, version }; diff --git a/node_modules/liquidjs/dist/parser/filter-arg.d.ts b/node_modules/liquidjs/dist/parser/filter-arg.d.ts new file mode 100644 index 0000000..dfe7996 --- /dev/null +++ b/node_modules/liquidjs/dist/parser/filter-arg.d.ts @@ -0,0 +1,5 @@ +import { ValueToken } from '../tokens/value-token'; +type KeyValuePair = [string?, ValueToken?]; +export type FilterArg = ValueToken | KeyValuePair; +export declare function isKeyValuePair(arr: FilterArg): arr is KeyValuePair; +export {}; diff --git a/node_modules/liquidjs/dist/parser/index.d.ts b/node_modules/liquidjs/dist/parser/index.d.ts new file mode 100644 index 0000000..931955e --- /dev/null +++ b/node_modules/liquidjs/dist/parser/index.d.ts @@ -0,0 +1,4 @@ +export * from './tokenizer'; +export * from './parser'; +export * from './parse-stream'; +export * from './token-kind'; diff --git a/node_modules/liquidjs/dist/parser/parse-stream.d.ts b/node_modules/liquidjs/dist/parser/parse-stream.d.ts new file mode 100644 index 0000000..83b97d7 --- /dev/null +++ b/node_modules/liquidjs/dist/parser/parse-stream.d.ts @@ -0,0 +1,15 @@ +import { Token, TopLevelToken } from '../tokens'; +import { Template } from '../template'; +type ParseToken = ((token: T, remainTokens: T[]) => Template); +export declare class ParseStream { + private tokens; + private handlers; + private stopRequested; + private parseToken; + constructor(tokens: T[], parseToken: ParseToken); + on(name: string, cb: (this: ParseStream, arg: T2) => void): ParseStream; + private trigger; + start(): this; + stop(): this; +} +export {}; diff --git a/node_modules/liquidjs/dist/parser/parse-stream.spec.d.ts b/node_modules/liquidjs/dist/parser/parse-stream.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/parser/parse-stream.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/parser/parser.d.ts b/node_modules/liquidjs/dist/parser/parser.d.ts new file mode 100644 index 0000000..cab17d6 --- /dev/null +++ b/node_modules/liquidjs/dist/parser/parser.d.ts @@ -0,0 +1,19 @@ +import { ParseStream } from './parse-stream'; +import { TopLevelToken } from '../tokens'; +import { Template, Output, HTML } from '../template'; +import { LookupType } from '../fs'; +import type { Liquid } from '../liquid'; +export declare class Parser { + parseFile: (file: string, sync?: boolean, type?: LookupType, currentFile?: string) => Generator; + private liquid; + private fs; + private cache?; + private loader; + constructor(liquid: Liquid); + parse(html: string, filepath?: string): Template[]; + parseTokens(tokens: TopLevelToken[]): Template[]; + parseToken(token: TopLevelToken, remainTokens: TopLevelToken[]): import("../template").Tag | Output | HTML; + parseStream(tokens: TopLevelToken[]): ParseStream; + private _parseFileCached; + private _parseFile; +} diff --git a/node_modules/liquidjs/dist/parser/token-kind.d.ts b/node_modules/liquidjs/dist/parser/token-kind.d.ts new file mode 100644 index 0000000..47bec4f --- /dev/null +++ b/node_modules/liquidjs/dist/parser/token-kind.d.ts @@ -0,0 +1,16 @@ +export declare enum TokenKind { + Number = 1, + Literal = 2, + Tag = 4, + Output = 8, + HTML = 16, + Filter = 32, + Hash = 64, + PropertyAccess = 128, + Word = 256, + Range = 512, + Quoted = 1024, + Operator = 2048, + FilteredValue = 4096, + Delimited = 12 +} diff --git a/node_modules/liquidjs/dist/parser/tokenizer.d.ts b/node_modules/liquidjs/dist/parser/tokenizer.d.ts new file mode 100644 index 0000000..e9e4ad2 --- /dev/null +++ b/node_modules/liquidjs/dist/parser/tokenizer.d.ts @@ -0,0 +1,62 @@ +import { FilteredValueToken, TagToken, HTMLToken, HashToken, QuotedToken, LiquidTagToken, OutputToken, ValueToken, Token, RangeToken, FilterToken, TopLevelToken, OperatorToken, LiteralToken, IdentifierToken, NumberToken } from '../tokens'; +import { Trie, TokenizationError } from '../util'; +import { Operators, Expression } from '../render'; +import { NormalizedFullOptions } from '../liquid-options'; +import { FilterArg } from './filter-arg'; +export declare class Tokenizer { + input: string; + file?: string | undefined; + p: number; + N: number; + private rawBeginAt; + private opTrie; + private literalTrie; + constructor(input: string, operators?: Operators, file?: string | undefined, range?: [number, number]); + readExpression(): Expression; + readExpressionTokens(): IterableIterator; + readOperator(): OperatorToken | undefined; + matchTrie(trie: Trie): number; + readFilteredValue(): FilteredValueToken; + readFilters(): FilterToken[]; + readFilter(): FilterToken | null; + readFilterArg(): FilterArg | undefined; + readTopLevelTokens(options?: NormalizedFullOptions): TopLevelToken[]; + readTopLevelToken(options: NormalizedFullOptions): TopLevelToken; + readHTMLToken(stopStrings: string[]): HTMLToken; + readTagToken(options?: NormalizedFullOptions): TagToken; + readToDelimiter(delimiter: string, respectQuoted?: boolean): number; + readOutputToken(options?: NormalizedFullOptions): OutputToken; + readEndrawOrRawContent(options: NormalizedFullOptions): HTMLToken | TagToken; + readLiquidTagTokens(options?: NormalizedFullOptions): LiquidTagToken[]; + readLiquidTagToken(options: NormalizedFullOptions): LiquidTagToken | undefined; + error(msg: string, pos?: number): TokenizationError; + assert(pred: unknown, msg: string | (() => string), pos?: number): void; + snapshot(begin?: number): string; + /** + * @deprecated use #readIdentifier instead + */ + readWord(): IdentifierToken; + readIdentifier(): IdentifierToken; + readNonEmptyIdentifier(): IdentifierToken | undefined; + readTagName(): string; + readHashes(jekyllStyle?: boolean): HashToken[]; + readHash(jekyllStyle?: boolean): HashToken | undefined; + remaining(): string; + advance(step?: number): void; + end(): boolean; + readTo(end: string): number; + readValue(): ValueToken | undefined; + readScopeValue(): ValueToken | undefined; + private readProperties; + readNumber(): NumberToken | undefined; + readLiteral(): LiteralToken | undefined; + readRange(): RangeToken | undefined; + readValueOrThrow(): ValueToken; + readQuoted(): QuotedToken | undefined; + readFileNameTemplate(options: NormalizedFullOptions): IterableIterator; + match(word: string): boolean; + rmatch(pattern: string): boolean; + peekType(n?: number): number; + peek(n?: number): string; + skipBlank(): void; +} diff --git a/node_modules/liquidjs/dist/parser/tokenizer.spec.d.ts b/node_modules/liquidjs/dist/parser/tokenizer.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/parser/tokenizer.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts b/node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts new file mode 100644 index 0000000..a1cbdcd --- /dev/null +++ b/node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts @@ -0,0 +1,3 @@ +import { Token } from '../tokens'; +import { NormalizedFullOptions } from '../liquid-options'; +export declare function whiteSpaceCtrl(tokens: Token[], options: NormalizedFullOptions): void; diff --git a/node_modules/liquidjs/dist/render/boolean.d.ts b/node_modules/liquidjs/dist/render/boolean.d.ts new file mode 100644 index 0000000..6354075 --- /dev/null +++ b/node_modules/liquidjs/dist/render/boolean.d.ts @@ -0,0 +1,3 @@ +import { Context } from '../context/context'; +export declare function isTruthy(val: any, ctx: Context): boolean; +export declare function isFalsy(val: any, ctx: Context): boolean; diff --git a/node_modules/liquidjs/dist/render/boolean.spec.d.ts b/node_modules/liquidjs/dist/render/boolean.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/render/boolean.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/render/expression.d.ts b/node_modules/liquidjs/dist/render/expression.d.ts new file mode 100644 index 0000000..df595eb --- /dev/null +++ b/node_modules/liquidjs/dist/render/expression.d.ts @@ -0,0 +1,10 @@ +import { QuotedToken, Token } from '../tokens'; +import type { Context } from '../context'; +export declare class Expression { + private postfix; + constructor(tokens: IterableIterator); + evaluate(ctx: Context, lenient?: boolean): Generator; + valid(): boolean; +} +export declare function evalToken(token: Token | undefined, ctx: Context, lenient?: boolean): IterableIterator; +export declare function evalQuotedToken(token: QuotedToken): string; diff --git a/node_modules/liquidjs/dist/render/expression.spec.d.ts b/node_modules/liquidjs/dist/render/expression.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/render/expression.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/render/index.d.ts b/node_modules/liquidjs/dist/render/index.d.ts new file mode 100644 index 0000000..c0ed824 --- /dev/null +++ b/node_modules/liquidjs/dist/render/index.d.ts @@ -0,0 +1,4 @@ +export * from './render'; +export * from './expression'; +export * from './operator'; +export * from './boolean'; diff --git a/node_modules/liquidjs/dist/render/operator.d.ts b/node_modules/liquidjs/dist/render/operator.d.ts new file mode 100644 index 0000000..146ada8 --- /dev/null +++ b/node_modules/liquidjs/dist/render/operator.d.ts @@ -0,0 +1,7 @@ +import { Context } from '../context'; +export type UnaryOperatorHandler = (operand: any, ctx: Context) => boolean; +export type BinaryOperatorHandler = (lhs: any, rhs: any, ctx: Context) => boolean; +export type OperatorHandler = UnaryOperatorHandler | BinaryOperatorHandler; +export type Operators = Record; +export declare const defaultOperators: Operators; +export declare function equals(lhs: any, rhs: any): boolean; diff --git a/node_modules/liquidjs/dist/render/render.d.ts b/node_modules/liquidjs/dist/render/render.d.ts new file mode 100644 index 0000000..e724c60 --- /dev/null +++ b/node_modules/liquidjs/dist/render/render.d.ts @@ -0,0 +1,8 @@ +/// +import { Context } from '../context'; +import { Template } from '../template'; +import { Emitter } from '../emitters'; +export declare class Render { + renderTemplatesToNodeStream(templates: Template[], ctx: Context): NodeJS.ReadableStream; + renderTemplates(templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator; +} diff --git a/node_modules/liquidjs/dist/render/render.spec.d.ts b/node_modules/liquidjs/dist/render/render.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/render/render.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/render/string.d.ts b/node_modules/liquidjs/dist/render/string.d.ts new file mode 100644 index 0000000..ed1794b --- /dev/null +++ b/node_modules/liquidjs/dist/render/string.d.ts @@ -0,0 +1 @@ +export declare function parseStringLiteral(str: string): string; diff --git a/node_modules/liquidjs/dist/render/string.spec.d.ts b/node_modules/liquidjs/dist/render/string.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/render/string.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/tags/assign.d.ts b/node_modules/liquidjs/dist/tags/assign.d.ts new file mode 100644 index 0000000..4e261b9 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/assign.d.ts @@ -0,0 +1,7 @@ +import { Liquid, TopLevelToken, TagToken, Context, Tag } from '..'; +export default class extends Tag { + private key; + private value; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/block.d.ts b/node_modules/liquidjs/dist/tags/block.d.ts new file mode 100644 index 0000000..e8ee569 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/block.d.ts @@ -0,0 +1,8 @@ +import { Liquid, TagToken, TopLevelToken, Template, Context, Emitter, Tag } from '..'; +export default class extends Tag { + block: string; + templates: Template[]; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; + private getBlockRender; +} diff --git a/node_modules/liquidjs/dist/tags/break.d.ts b/node_modules/liquidjs/dist/tags/break.d.ts new file mode 100644 index 0000000..e7e79e7 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/break.d.ts @@ -0,0 +1,4 @@ +import { Context, Emitter, Tag } from '..'; +export default class extends Tag { + render(ctx: Context, emitter: Emitter): void; +} diff --git a/node_modules/liquidjs/dist/tags/capture.d.ts b/node_modules/liquidjs/dist/tags/capture.d.ts new file mode 100644 index 0000000..db4add3 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/capture.d.ts @@ -0,0 +1,8 @@ +import { Liquid, Tag, Template, Context, TagToken, TopLevelToken } from '..'; +export default class extends Tag { + variable: string; + templates: Template[]; + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context): Generator; + private readVariableName; +} diff --git a/node_modules/liquidjs/dist/tags/case.d.ts b/node_modules/liquidjs/dist/tags/case.d.ts new file mode 100644 index 0000000..1945074 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/case.d.ts @@ -0,0 +1,11 @@ +import { ValueToken, Liquid, Value, Emitter, TagToken, TopLevelToken, Context, Template, Tag } from '..'; +export default class extends Tag { + value: Value; + branches: { + values: ValueToken[]; + templates: Template[]; + }[]; + elseTemplates: Template[]; + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/comment.d.ts b/node_modules/liquidjs/dist/tags/comment.d.ts new file mode 100644 index 0000000..2c0f4b9 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/comment.d.ts @@ -0,0 +1,5 @@ +import { Liquid, TopLevelToken, TagToken, Tag } from '..'; +export default class extends Tag { + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(): void; +} diff --git a/node_modules/liquidjs/dist/tags/continue.d.ts b/node_modules/liquidjs/dist/tags/continue.d.ts new file mode 100644 index 0000000..6c27306 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/continue.d.ts @@ -0,0 +1,4 @@ +import { Tag, Emitter, Context } from '..'; +export default class extends Tag { + render(ctx: Context, emitter: Emitter): void; +} diff --git a/node_modules/liquidjs/dist/tags/cycle.d.ts b/node_modules/liquidjs/dist/tags/cycle.d.ts new file mode 100644 index 0000000..7dd67a9 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/cycle.d.ts @@ -0,0 +1,7 @@ +import { TopLevelToken, Liquid, Emitter, TagToken, Context, Tag } from '..'; +export default class extends Tag { + private candidates; + private group?; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/decrement.d.ts b/node_modules/liquidjs/dist/tags/decrement.d.ts new file mode 100644 index 0000000..09fd3ea --- /dev/null +++ b/node_modules/liquidjs/dist/tags/decrement.d.ts @@ -0,0 +1,6 @@ +import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..'; +export default class extends Tag { + private variable; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(context: Context, emitter: Emitter): void; +} diff --git a/node_modules/liquidjs/dist/tags/echo.d.ts b/node_modules/liquidjs/dist/tags/echo.d.ts new file mode 100644 index 0000000..2818b1e --- /dev/null +++ b/node_modules/liquidjs/dist/tags/echo.d.ts @@ -0,0 +1,6 @@ +import { Liquid, TopLevelToken, Emitter, TagToken, Context, Tag } from '..'; +export default class extends Tag { + private value?; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/for.d.ts b/node_modules/liquidjs/dist/tags/for.d.ts new file mode 100644 index 0000000..3c2c362 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/for.d.ts @@ -0,0 +1,10 @@ +import { Hash, ValueToken, Liquid, Tag, Emitter, TagToken, TopLevelToken, Context, Template } from '..'; +export default class extends Tag { + variable: string; + collection: ValueToken; + hash: Hash; + templates: Template[]; + elseTemplates: Template[]; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/if.d.ts b/node_modules/liquidjs/dist/tags/if.d.ts new file mode 100644 index 0000000..61ff03d --- /dev/null +++ b/node_modules/liquidjs/dist/tags/if.d.ts @@ -0,0 +1,10 @@ +import { Liquid, Tag, Value, Emitter, TagToken, TopLevelToken, Context, Template } from '..'; +export default class extends Tag { + branches: { + value: Value; + templates: Template[]; + }[]; + elseTemplates: Template[]; + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/include.d.ts b/node_modules/liquidjs/dist/tags/include.d.ts new file mode 100644 index 0000000..49647e4 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/include.d.ts @@ -0,0 +1,7 @@ +import { TopLevelToken, Liquid, Tag, Emitter, TagToken, Context } from '..'; +export default class extends Tag { + private withVar?; + private hash; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/increment.d.ts b/node_modules/liquidjs/dist/tags/increment.d.ts new file mode 100644 index 0000000..09fd3ea --- /dev/null +++ b/node_modules/liquidjs/dist/tags/increment.d.ts @@ -0,0 +1,6 @@ +import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..'; +export default class extends Tag { + private variable; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(context: Context, emitter: Emitter): void; +} diff --git a/node_modules/liquidjs/dist/tags/index.d.ts b/node_modules/liquidjs/dist/tags/index.d.ts new file mode 100644 index 0000000..37852f9 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/index.d.ts @@ -0,0 +1,24 @@ +import AssignTag from './assign'; +import ForTag from './for'; +import CaptureTag from './capture'; +import CaseTag from './case'; +import CommentTag from './comment'; +import IncludeTag from './include'; +import RenderTag from './render'; +import DecrementTag from './decrement'; +import CycleTag from './cycle'; +import IfTag from './if'; +import IncrementTag from './increment'; +import LayoutTag from './layout'; +import BlockTag from './block'; +import RawTag from './raw'; +import TablerowTag from './tablerow'; +import UnlessTag from './unless'; +import BreakTag from './break'; +import ContinueTag from './continue'; +import EchoTag from './echo'; +import LiquidTag from './liquid'; +import InlineCommentTag from './inline-comment'; +import type { TagClass } from '../template/tag'; +export declare const tags: Record; +export { AssignTag, ForTag, CaptureTag, CaseTag, CommentTag, IncludeTag, RenderTag, DecrementTag, IncrementTag, CycleTag, IfTag, LayoutTag, BlockTag, RawTag, TablerowTag, UnlessTag, BreakTag, ContinueTag, EchoTag, LiquidTag, InlineCommentTag }; diff --git a/node_modules/liquidjs/dist/tags/inline-comment.d.ts b/node_modules/liquidjs/dist/tags/inline-comment.d.ts new file mode 100644 index 0000000..98282ab --- /dev/null +++ b/node_modules/liquidjs/dist/tags/inline-comment.d.ts @@ -0,0 +1,5 @@ +import { TagToken, Liquid, TopLevelToken, Tag } from '..'; +export default class extends Tag { + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(): void; +} diff --git a/node_modules/liquidjs/dist/tags/layout.d.ts b/node_modules/liquidjs/dist/tags/layout.d.ts new file mode 100644 index 0000000..e4ec9e9 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/layout.d.ts @@ -0,0 +1,9 @@ +import { Template, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context } from '..'; +import { ParsedFileName } from './render'; +export default class extends Tag { + args: Hash; + templates: Template[]; + file?: ParsedFileName; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/liquid.d.ts b/node_modules/liquidjs/dist/tags/liquid.d.ts new file mode 100644 index 0000000..a80d99a --- /dev/null +++ b/node_modules/liquidjs/dist/tags/liquid.d.ts @@ -0,0 +1,6 @@ +import { Template, Emitter, Liquid, TopLevelToken, TagToken, Context, Tag } from '..'; +export default class extends Tag { + templates: Template[]; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/raw.d.ts b/node_modules/liquidjs/dist/tags/raw.d.ts new file mode 100644 index 0000000..26e9e68 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/raw.d.ts @@ -0,0 +1,6 @@ +import { Liquid, TagToken, TopLevelToken, Tag } from '..'; +export default class extends Tag { + private tokens; + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(): string; +} diff --git a/node_modules/liquidjs/dist/tags/render.d.ts b/node_modules/liquidjs/dist/tags/render.d.ts new file mode 100644 index 0000000..29e7021 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/render.d.ts @@ -0,0 +1,17 @@ +import { TopLevelToken, Liquid, Token, Template, Tokenizer, Emitter, TagToken, Context, Tag } from '..'; +export type ParsedFileName = Template[] | Token | string | undefined; +export default class extends Tag { + private file; + private currentFile?; + private hash; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} +/** + * @return null for "none", + * @return Template[] for quoted with tags and/or filters + * @return Token for expression (not quoted) + * @throws TypeError if cannot read next token + */ +export declare function parseFilePath(tokenizer: Tokenizer, liquid: Liquid): ParsedFileName; +export declare function renderFilePath(file: ParsedFileName, ctx: Context, liquid: Liquid): IterableIterator; diff --git a/node_modules/liquidjs/dist/tags/tablerow.d.ts b/node_modules/liquidjs/dist/tags/tablerow.d.ts new file mode 100644 index 0000000..77c51bf --- /dev/null +++ b/node_modules/liquidjs/dist/tags/tablerow.d.ts @@ -0,0 +1,9 @@ +import { ValueToken, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context, Template } from '..'; +export default class extends Tag { + variable: string; + args: Hash; + templates: Template[]; + collection: ValueToken; + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/tags/unless.d.ts b/node_modules/liquidjs/dist/tags/unless.d.ts new file mode 100644 index 0000000..d2b5595 --- /dev/null +++ b/node_modules/liquidjs/dist/tags/unless.d.ts @@ -0,0 +1,11 @@ +import { Liquid, Tag, Value, TopLevelToken, Template, Emitter, Context, TagToken } from '..'; +export default class extends Tag { + branches: { + value: Value; + test: (val: any, ctx: Context) => boolean; + templates: Template[]; + }[]; + elseTemplates: Template[]; + constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + render(ctx: Context, emitter: Emitter): Generator; +} diff --git a/node_modules/liquidjs/dist/template/filter-impl-options.d.ts b/node_modules/liquidjs/dist/template/filter-impl-options.d.ts new file mode 100644 index 0000000..a7fffb3 --- /dev/null +++ b/node_modules/liquidjs/dist/template/filter-impl-options.d.ts @@ -0,0 +1,12 @@ +import type { Context } from '../context'; +import type { Liquid } from '../liquid'; +export interface FilterImpl { + context: Context; + liquid: Liquid; +} +export type FilterHandler = (this: FilterImpl, value: any, ...args: any[]) => any; +export interface FilterOptions { + handler: FilterHandler; + raw: boolean; +} +export type FilterImplOptions = FilterHandler | FilterOptions; diff --git a/node_modules/liquidjs/dist/template/filter.d.ts b/node_modules/liquidjs/dist/template/filter.d.ts new file mode 100644 index 0000000..8fb05b9 --- /dev/null +++ b/node_modules/liquidjs/dist/template/filter.d.ts @@ -0,0 +1,13 @@ +import { Context } from '../context'; +import { FilterImplOptions } from './filter-impl-options'; +import { FilterArg } from '../parser/filter-arg'; +import { Liquid } from '../liquid'; +export declare class Filter { + name: string; + args: FilterArg[]; + readonly raw: boolean; + private handler; + private liquid; + constructor(name: string, options: FilterImplOptions | undefined, args: FilterArg[], liquid: Liquid); + render(value: any, context: Context): IterableIterator; +} diff --git a/node_modules/liquidjs/dist/template/filter.spec.d.ts b/node_modules/liquidjs/dist/template/filter.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/template/filter.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/template/hash.d.ts b/node_modules/liquidjs/dist/template/hash.d.ts new file mode 100644 index 0000000..01c595f --- /dev/null +++ b/node_modules/liquidjs/dist/template/hash.d.ts @@ -0,0 +1,17 @@ +import { Context } from '../context/context'; +import { Token } from '../tokens/token'; +type HashValueTokens = Record; +/** + * Key-Value Pairs Representing Tag Arguments + * Example: + * For the markup `, foo:'bar', coo:2 reversed %}`, + * hash['foo'] === 'bar' + * hash['coo'] === 2 + * hash['reversed'] === undefined + */ +export declare class Hash { + hash: HashValueTokens; + constructor(markup: string, jekyllStyle?: boolean); + render(ctx: Context): Generator, unknown>; +} +export {}; diff --git a/node_modules/liquidjs/dist/template/hash.spec.d.ts b/node_modules/liquidjs/dist/template/hash.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/template/hash.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/template/html.d.ts b/node_modules/liquidjs/dist/template/html.d.ts new file mode 100644 index 0000000..8b8136d --- /dev/null +++ b/node_modules/liquidjs/dist/template/html.d.ts @@ -0,0 +1,9 @@ +import { TemplateImpl, Template } from '../template'; +import { HTMLToken } from '../tokens'; +import { Context } from '../context'; +import { Emitter } from '../emitters'; +export declare class HTML extends TemplateImpl implements Template { + private str; + constructor(token: HTMLToken); + render(ctx: Context, emitter: Emitter): IterableIterator; +} diff --git a/node_modules/liquidjs/dist/template/index.d.ts b/node_modules/liquidjs/dist/template/index.d.ts new file mode 100644 index 0000000..896e6af --- /dev/null +++ b/node_modules/liquidjs/dist/template/index.d.ts @@ -0,0 +1,10 @@ +export * from './template'; +export * from './template-impl'; +export * from './tag'; +export * from './tag-options-adapter'; +export * from './filter'; +export * from './filter-impl-options'; +export * from './hash'; +export * from './value'; +export * from './output'; +export * from './html'; diff --git a/node_modules/liquidjs/dist/template/output.d.ts b/node_modules/liquidjs/dist/template/output.d.ts new file mode 100644 index 0000000..9b62b67 --- /dev/null +++ b/node_modules/liquidjs/dist/template/output.d.ts @@ -0,0 +1,11 @@ +import { Value } from './value'; +import { Template, TemplateImpl } from '../template'; +import { Context } from '../context/context'; +import { Emitter } from '../emitters/emitter'; +import { OutputToken } from '../tokens/output-token'; +import { Liquid } from '../liquid'; +export declare class Output extends TemplateImpl implements Template { + value: Value; + constructor(token: OutputToken, liquid: Liquid); + render(ctx: Context, emitter: Emitter): IterableIterator; +} diff --git a/node_modules/liquidjs/dist/template/output.spec.d.ts b/node_modules/liquidjs/dist/template/output.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/template/output.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/template/tag-options-adapter.d.ts b/node_modules/liquidjs/dist/template/tag-options-adapter.d.ts new file mode 100644 index 0000000..e4f85e4 --- /dev/null +++ b/node_modules/liquidjs/dist/template/tag-options-adapter.d.ts @@ -0,0 +1,10 @@ +import { Tag, TagClass, TagRenderReturn } from './tag'; +import { TagToken, TopLevelToken } from '../tokens'; +import { Emitter } from '../emitters'; +import { Context } from '../context'; +export interface TagImplOptions { + [key: string]: any; + parse?: (this: Tag & TagImplOptions, token: TagToken, remainingTokens: TopLevelToken[]) => void; + render: (this: Tag & TagImplOptions, ctx: Context, emitter: Emitter, hash: Record) => TagRenderReturn; +} +export declare function createTagClass(options: TagImplOptions): TagClass; diff --git a/node_modules/liquidjs/dist/template/tag.d.ts b/node_modules/liquidjs/dist/template/tag.d.ts new file mode 100644 index 0000000..446b4a2 --- /dev/null +++ b/node_modules/liquidjs/dist/template/tag.d.ts @@ -0,0 +1,18 @@ +import { TemplateImpl } from './template-impl'; +import type { Emitter } from '../emitters/emitter'; +import type { Tokenizer } from '../parser'; +import type { Context } from '../context/context'; +import type { TopLevelToken, TagToken } from '../tokens'; +import type { Template } from './template'; +import type { Liquid } from '../liquid'; +export type TagRenderReturn = Generator | Promise | unknown; +export declare abstract class Tag extends TemplateImpl implements Template { + name: string; + liquid: Liquid; + protected tokenizer: Tokenizer; + constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid); + abstract render(ctx: Context, emitter: Emitter): TagRenderReturn; +} +export interface TagClass { + new (token: TagToken, tokens: TopLevelToken[], liquid: Liquid): Tag; +} diff --git a/node_modules/liquidjs/dist/template/template-impl.d.ts b/node_modules/liquidjs/dist/template/template-impl.d.ts new file mode 100644 index 0000000..99edd24 --- /dev/null +++ b/node_modules/liquidjs/dist/template/template-impl.d.ts @@ -0,0 +1,4 @@ +export declare abstract class TemplateImpl { + token: T; + constructor(token: T); +} diff --git a/node_modules/liquidjs/dist/template/template.d.ts b/node_modules/liquidjs/dist/template/template.d.ts new file mode 100644 index 0000000..ae07c66 --- /dev/null +++ b/node_modules/liquidjs/dist/template/template.d.ts @@ -0,0 +1,7 @@ +import { Context } from '../context/context'; +import { Token } from '../tokens/token'; +import { Emitter } from '../emitters/emitter'; +export interface Template { + token: Token; + render(ctx: Context, emitter: Emitter): any; +} diff --git a/node_modules/liquidjs/dist/template/value.d.ts b/node_modules/liquidjs/dist/template/value.d.ts new file mode 100644 index 0000000..05e2ff9 --- /dev/null +++ b/node_modules/liquidjs/dist/template/value.d.ts @@ -0,0 +1,15 @@ +import { Filter } from './filter'; +import { Expression } from '../render'; +import type { FilteredValueToken } from '../tokens'; +import type { Liquid } from '../liquid'; +import type { Context } from '../context'; +export declare class Value { + readonly filters: Filter[]; + readonly initial: Expression; + /** + * @param str the value to be valuated, eg.: "foobar" | truncate: 3 + */ + constructor(input: string | FilteredValueToken, liquid: Liquid); + value(ctx: Context, lenient?: boolean): Generator; + private getFilter; +} diff --git a/node_modules/liquidjs/dist/template/value.spec.d.ts b/node_modules/liquidjs/dist/template/value.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/template/value.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/tokens/delimited-token.d.ts b/node_modules/liquidjs/dist/tokens/delimited-token.d.ts new file mode 100644 index 0000000..523bda2 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/delimited-token.d.ts @@ -0,0 +1,9 @@ +import { Token } from './token'; +import { TokenKind } from '../parser'; +export declare abstract class DelimitedToken extends Token { + trimLeft: boolean; + trimRight: boolean; + contentRange: [number, number]; + constructor(kind: TokenKind, [contentBegin, contentEnd]: [number, number], input: string, begin: number, end: number, trimLeft: boolean, trimRight: boolean, file?: string); + get content(): string; +} diff --git a/node_modules/liquidjs/dist/tokens/filter-token.d.ts b/node_modules/liquidjs/dist/tokens/filter-token.d.ts new file mode 100644 index 0000000..f298cc1 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/filter-token.d.ts @@ -0,0 +1,7 @@ +import { Token } from './token'; +import { FilterArg } from '../parser/filter-arg'; +export declare class FilterToken extends Token { + name: string; + args: FilterArg[]; + constructor(name: string, args: FilterArg[], input: string, begin: number, end: number, file?: string); +} diff --git a/node_modules/liquidjs/dist/tokens/filtered-value-token.d.ts b/node_modules/liquidjs/dist/tokens/filtered-value-token.d.ts new file mode 100644 index 0000000..a535051 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/filtered-value-token.d.ts @@ -0,0 +1,17 @@ +import { Token } from './token'; +import { FilterToken } from './filter-token'; +import { Expression } from '../render'; +/** + * value expression with optional filters + * e.g. + * {% assign foo="bar" | append: "coo" %} + */ +export declare class FilteredValueToken extends Token { + initial: Expression; + filters: FilterToken[]; + input: string; + begin: number; + end: number; + file?: string | undefined; + constructor(initial: Expression, filters: FilterToken[], input: string, begin: number, end: number, file?: string | undefined); +} diff --git a/node_modules/liquidjs/dist/tokens/hash-token.d.ts b/node_modules/liquidjs/dist/tokens/hash-token.d.ts new file mode 100644 index 0000000..68d0511 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/hash-token.d.ts @@ -0,0 +1,12 @@ +import { Token } from './token'; +import { ValueToken } from './value-token'; +import { IdentifierToken } from './identifier-token'; +export declare class HashToken extends Token { + input: string; + begin: number; + end: number; + name: IdentifierToken; + value?: ValueToken | undefined; + file?: string | undefined; + constructor(input: string, begin: number, end: number, name: IdentifierToken, value?: ValueToken | undefined, file?: string | undefined); +} diff --git a/node_modules/liquidjs/dist/tokens/html-token.d.ts b/node_modules/liquidjs/dist/tokens/html-token.d.ts new file mode 100644 index 0000000..298a200 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/html-token.d.ts @@ -0,0 +1,11 @@ +import { Token } from './token'; +export declare class HTMLToken extends Token { + input: string; + begin: number; + end: number; + file?: string | undefined; + trimLeft: number; + trimRight: number; + constructor(input: string, begin: number, end: number, file?: string | undefined); + getContent(): string; +} diff --git a/node_modules/liquidjs/dist/tokens/identifier-token.d.ts b/node_modules/liquidjs/dist/tokens/identifier-token.d.ts new file mode 100644 index 0000000..1f62b92 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/identifier-token.d.ts @@ -0,0 +1,10 @@ +import { Token } from './token'; +export declare class IdentifierToken extends Token { + input: string; + begin: number; + end: number; + file?: string | undefined; + content: string; + constructor(input: string, begin: number, end: number, file?: string | undefined); + isNumber(allowSign?: boolean): boolean; +} diff --git a/node_modules/liquidjs/dist/tokens/index.d.ts b/node_modules/liquidjs/dist/tokens/index.d.ts new file mode 100644 index 0000000..f61c8c0 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/index.d.ts @@ -0,0 +1,18 @@ +export * from './top-level-token'; +export * from './tag-token'; +export * from './output-token'; +export * from './html-token'; +export * from './number-token'; +export * from './identifier-token'; +export * from './literal-token'; +export * from './operator-token'; +export * from './property-access-token'; +export * from './filter-token'; +export * from './hash-token'; +export * from './quoted-token'; +export * from './token'; +export * from './range-token'; +export * from './value-token'; +export * from './liquid-tag-token'; +export * from './delimited-token'; +export * from './filtered-value-token'; diff --git a/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts b/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts new file mode 100644 index 0000000..f8420df --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts @@ -0,0 +1,12 @@ +import { DelimitedToken } from './delimited-token'; +import { NormalizedFullOptions } from '../liquid-options'; +import { Tokenizer } from '../parser'; +/** + * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}` + */ +export declare class LiquidTagToken extends DelimitedToken { + name: string; + args: string; + tokenizer: Tokenizer; + constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string); +} diff --git a/node_modules/liquidjs/dist/tokens/literal-token.d.ts b/node_modules/liquidjs/dist/tokens/literal-token.d.ts new file mode 100644 index 0000000..739076c --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/literal-token.d.ts @@ -0,0 +1,11 @@ +import { Token } from './token'; +import { LiteralValue } from '../util'; +export declare class LiteralToken extends Token { + input: string; + begin: number; + end: number; + file?: string | undefined; + content: LiteralValue; + literal: string; + constructor(input: string, begin: number, end: number, file?: string | undefined); +} diff --git a/node_modules/liquidjs/dist/tokens/number-token.d.ts b/node_modules/liquidjs/dist/tokens/number-token.d.ts new file mode 100644 index 0000000..2faf6f1 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/number-token.d.ts @@ -0,0 +1,9 @@ +import { Token } from './token'; +export declare class NumberToken extends Token { + input: string; + begin: number; + end: number; + file?: string | undefined; + content: number; + constructor(input: string, begin: number, end: number, file?: string | undefined); +} diff --git a/node_modules/liquidjs/dist/tokens/operator-token.d.ts b/node_modules/liquidjs/dist/tokens/operator-token.d.ts new file mode 100644 index 0000000..dac5180 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/operator-token.d.ts @@ -0,0 +1,38 @@ +import { Token } from './token'; +export declare const enum OperatorType { + Binary = 0, + Unary = 1 +} +export declare const operatorPrecedences: { + '==': number; + '!=': number; + '>': number; + '<': number; + '>=': number; + '<=': number; + contains: number; + not: number; + and: number; + or: number; +}; +export declare const operatorTypes: { + '==': OperatorType; + '!=': OperatorType; + '>': OperatorType; + '<': OperatorType; + '>=': OperatorType; + '<=': OperatorType; + contains: OperatorType; + not: OperatorType; + and: OperatorType; + or: OperatorType; +}; +export declare class OperatorToken extends Token { + input: string; + begin: number; + end: number; + file?: string | undefined; + operator: string; + constructor(input: string, begin: number, end: number, file?: string | undefined); + getPrecedence(): any; +} diff --git a/node_modules/liquidjs/dist/tokens/output-token.d.ts b/node_modules/liquidjs/dist/tokens/output-token.d.ts new file mode 100644 index 0000000..33a7cb3 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/output-token.d.ts @@ -0,0 +1,5 @@ +import { DelimitedToken } from './delimited-token'; +import { NormalizedFullOptions } from '../liquid-options'; +export declare class OutputToken extends DelimitedToken { + constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string); +} diff --git a/node_modules/liquidjs/dist/tokens/property-access-token.d.ts b/node_modules/liquidjs/dist/tokens/property-access-token.d.ts new file mode 100644 index 0000000..1717801 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/property-access-token.d.ts @@ -0,0 +1,12 @@ +import { Token } from './token'; +import { LiteralToken } from './literal-token'; +import { ValueToken } from './value-token'; +import { IdentifierToken } from './identifier-token'; +import { NumberToken } from './number-token'; +import { RangeToken } from './range-token'; +import { QuotedToken } from './quoted-token'; +export declare class PropertyAccessToken extends Token { + variable: QuotedToken | RangeToken | LiteralToken | NumberToken | undefined; + props: (ValueToken | IdentifierToken)[]; + constructor(variable: QuotedToken | RangeToken | LiteralToken | NumberToken | undefined, props: (ValueToken | IdentifierToken)[], input: string, begin: number, end: number, file?: string); +} diff --git a/node_modules/liquidjs/dist/tokens/quoted-token.d.ts b/node_modules/liquidjs/dist/tokens/quoted-token.d.ts new file mode 100644 index 0000000..7de7f0b --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/quoted-token.d.ts @@ -0,0 +1,9 @@ +import { Token } from './token'; +export declare class QuotedToken extends Token { + input: string; + begin: number; + end: number; + file?: string | undefined; + readonly content: string; + constructor(input: string, begin: number, end: number, file?: string | undefined); +} diff --git a/node_modules/liquidjs/dist/tokens/range-token.d.ts b/node_modules/liquidjs/dist/tokens/range-token.d.ts new file mode 100644 index 0000000..d2a4c40 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/range-token.d.ts @@ -0,0 +1,11 @@ +import { Token } from './token'; +import { ValueToken } from './value-token'; +export declare class RangeToken extends Token { + input: string; + begin: number; + end: number; + lhs: ValueToken; + rhs: ValueToken; + file?: string | undefined; + constructor(input: string, begin: number, end: number, lhs: ValueToken, rhs: ValueToken, file?: string | undefined); +} diff --git a/node_modules/liquidjs/dist/tokens/tag-token.d.ts b/node_modules/liquidjs/dist/tokens/tag-token.d.ts new file mode 100644 index 0000000..7832ec4 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/tag-token.d.ts @@ -0,0 +1,9 @@ +import { DelimitedToken } from './delimited-token'; +import { Tokenizer } from '../parser'; +import type { NormalizedFullOptions } from '../liquid-options'; +export declare class TagToken extends DelimitedToken { + name: string; + tokenizer: Tokenizer; + constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string); + get args(): string; +} diff --git a/node_modules/liquidjs/dist/tokens/token.d.ts b/node_modules/liquidjs/dist/tokens/token.d.ts new file mode 100644 index 0000000..b45a0c0 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/token.d.ts @@ -0,0 +1,12 @@ +import { TokenKind } from '../parser'; +export declare abstract class Token { + kind: TokenKind; + input: string; + begin: number; + end: number; + file?: string | undefined; + constructor(kind: TokenKind, input: string, begin: number, end: number, file?: string | undefined); + getText(): string; + getPosition(): number[]; + size(): number; +} diff --git a/node_modules/liquidjs/dist/tokens/top-level-token.d.ts b/node_modules/liquidjs/dist/tokens/top-level-token.d.ts new file mode 100644 index 0000000..830d452 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/top-level-token.d.ts @@ -0,0 +1,4 @@ +import type { TagToken } from './tag-token'; +import type { HTMLToken } from './html-token'; +import type { OutputToken } from './output-token'; +export type TopLevelToken = TagToken | OutputToken | HTMLToken; diff --git a/node_modules/liquidjs/dist/tokens/value-token.d.ts b/node_modules/liquidjs/dist/tokens/value-token.d.ts new file mode 100644 index 0000000..017bfc6 --- /dev/null +++ b/node_modules/liquidjs/dist/tokens/value-token.d.ts @@ -0,0 +1,6 @@ +import { RangeToken } from './range-token'; +import { LiteralToken } from './literal-token'; +import { NumberToken } from './number-token'; +import { QuotedToken } from './quoted-token'; +import { PropertyAccessToken } from './property-access-token'; +export type ValueToken = RangeToken | LiteralToken | QuotedToken | PropertyAccessToken | NumberToken; diff --git a/node_modules/liquidjs/dist/util/assert.d.ts b/node_modules/liquidjs/dist/util/assert.d.ts new file mode 100644 index 0000000..72a2fca --- /dev/null +++ b/node_modules/liquidjs/dist/util/assert.d.ts @@ -0,0 +1 @@ +export declare function assert(predicate: T | null | undefined, message?: string | (() => string)): void; diff --git a/node_modules/liquidjs/dist/util/assert.spec.d.ts b/node_modules/liquidjs/dist/util/assert.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/util/assert.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/util/async.d.ts b/node_modules/liquidjs/dist/util/async.d.ts new file mode 100644 index 0000000..9d75958 --- /dev/null +++ b/node_modules/liquidjs/dist/util/async.d.ts @@ -0,0 +1,2 @@ +export declare function toPromise(val: Generator | Promise | T): Promise; +export declare function toValueSync(val: Generator | T): T; diff --git a/node_modules/liquidjs/dist/util/async.spec.d.ts b/node_modules/liquidjs/dist/util/async.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/util/async.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/util/character.d.ts b/node_modules/liquidjs/dist/util/character.d.ts new file mode 100644 index 0000000..e41d432 --- /dev/null +++ b/node_modules/liquidjs/dist/util/character.d.ts @@ -0,0 +1,10 @@ +export declare const TYPES: number[]; +export declare const WORD = 1; +export declare const OPERATOR = 2; +export declare const BLANK = 4; +export declare const QUOTE = 8; +export declare const INLINE_BLANK = 16; +export declare const NUMBER = 32; +export declare const SIGN = 64; +export declare const PUNCTUATION = 128; +export declare function isWord(char: string): boolean; diff --git a/node_modules/liquidjs/dist/util/error.d.ts b/node_modules/liquidjs/dist/util/error.d.ts new file mode 100644 index 0000000..ef6838e --- /dev/null +++ b/node_modules/liquidjs/dist/util/error.d.ts @@ -0,0 +1,35 @@ +import { Token } from '../tokens/token'; +import { Template } from '../template/template'; +export declare abstract class LiquidError extends Error { + token: Token; + context: string; + private originalError?; + constructor(err: Error | string, token: Token); + protected update(): void; + static is(obj: unknown): obj is LiquidError; +} +export declare class TokenizationError extends LiquidError { + constructor(message: string, token: Token); +} +export declare class ParseError extends LiquidError { + constructor(err: Error, token: Token); +} +export declare class RenderError extends LiquidError { + constructor(err: Error, tpl: Template); + static is(obj: any): obj is RenderError; +} +export declare class LiquidErrors extends LiquidError { + errors: RenderError[]; + constructor(errors: RenderError[]); + static is(obj: any): obj is LiquidErrors; +} +export declare class UndefinedVariableError extends LiquidError { + constructor(err: Error, token: Token); +} +export declare class InternalUndefinedVariableError extends Error { + variableName: string; + constructor(variableName: string); +} +export declare class AssertionError extends Error { + constructor(message: string); +} diff --git a/node_modules/liquidjs/dist/util/index.d.ts b/node_modules/liquidjs/dist/util/index.d.ts new file mode 100644 index 0000000..ad7dfc1 --- /dev/null +++ b/node_modules/liquidjs/dist/util/index.d.ts @@ -0,0 +1,11 @@ +export * from './error'; +export * from './character'; +export * from './assert'; +export * from './literal'; +export * from './underscore'; +export * from './operator-trie'; +export * from './type-guards'; +export * from './async'; +export * from './strftime'; +export * from './liquid-date'; +export * from './timezone-date'; diff --git a/node_modules/liquidjs/dist/util/liquid-date.d.ts b/node_modules/liquidjs/dist/util/liquid-date.d.ts new file mode 100644 index 0000000..faefa06 --- /dev/null +++ b/node_modules/liquidjs/dist/util/liquid-date.d.ts @@ -0,0 +1,20 @@ +/** + * The date interface LiquidJS uses. + * Basically a subset of JavaScript Date, + * it's defined abstractly here to allow different implementation + */ +export interface LiquidDate { + getTime(): number; + getMilliseconds(): number; + getSeconds(): number; + getMinutes(): number; + getHours(): number; + getDay(): number; + getDate(): number; + getMonth(): number; + getFullYear(): number; + getTimezoneOffset(): number; + getTimezoneName?(): string; + toLocaleTimeString(): string; + toLocaleDateString(): string; +} diff --git a/node_modules/liquidjs/dist/util/literal.d.ts b/node_modules/liquidjs/dist/util/literal.d.ts new file mode 100644 index 0000000..bc1b406 --- /dev/null +++ b/node_modules/liquidjs/dist/util/literal.d.ts @@ -0,0 +1,11 @@ +import { BlankDrop, EmptyDrop, NullDrop } from '../drop'; +export declare const literalValues: { + true: boolean; + false: boolean; + nil: NullDrop; + null: NullDrop; + empty: EmptyDrop; + blank: BlankDrop; +}; +export type LiteralKey = keyof typeof literalValues; +export type LiteralValue = typeof literalValues[LiteralKey]; diff --git a/node_modules/liquidjs/dist/util/operator-trie.d.ts b/node_modules/liquidjs/dist/util/operator-trie.d.ts new file mode 100644 index 0000000..b21050e --- /dev/null +++ b/node_modules/liquidjs/dist/util/operator-trie.d.ts @@ -0,0 +1,14 @@ +interface TrieInput { + [key: string]: T; +} +interface TrieLeafNode { + data: T; + end: true; + needBoundary?: true; +} +export interface Trie { + [key: string]: Trie | TrieLeafNode; +} +export type TrieNode = Trie | TrieLeafNode; +export declare function createTrie(input: TrieInput): Trie; +export {}; diff --git a/node_modules/liquidjs/dist/util/strftime.d.ts b/node_modules/liquidjs/dist/util/strftime.d.ts new file mode 100644 index 0000000..5e4aea5 --- /dev/null +++ b/node_modules/liquidjs/dist/util/strftime.d.ts @@ -0,0 +1,2 @@ +import { LiquidDate } from './liquid-date'; +export declare function strftime(d: LiquidDate, formatStr: string): string; diff --git a/node_modules/liquidjs/dist/util/strftime.spec.d.ts b/node_modules/liquidjs/dist/util/strftime.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/util/strftime.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/util/timezone-date.d.ts b/node_modules/liquidjs/dist/util/timezone-date.d.ts new file mode 100644 index 0000000..aaaad56 --- /dev/null +++ b/node_modules/liquidjs/dist/util/timezone-date.d.ts @@ -0,0 +1,44 @@ +import { LiquidDate } from './liquid-date'; +/** + * A date implementation with timezone info, just like Ruby date + * + * Implementation: + * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods + * - rewrite getTimezoneOffset() to trick strftime + */ +export declare class TimezoneDate implements LiquidDate { + private timezoneOffset; + private timezoneName; + private date; + private displayDate; + constructor(init: string | number | Date | TimezoneDate, timezone: number | string); + getTime(): number; + getMilliseconds(): number; + getSeconds(): number; + getMinutes(): number; + getHours(): number; + getDay(): number; + getDate(): number; + getMonth(): number; + getFullYear(): number; + toLocaleString(locale?: string, init?: any): string; + toLocaleTimeString(locale?: string): string; + toLocaleDateString(locale?: string): string; + getTimezoneOffset(): number; + getTimezoneName(): string; + /** + * Create a Date object fixed to it's declared Timezone. Both + * - 2021-08-06T02:29:00.000Z and + * - 2021-08-06T02:29:00.000+08:00 + * will always be displayed as + * - 2021-08-06 02:29:00 + * regardless timezoneOffset in JavaScript realm + * + * The implementation hack: + * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`, + * we create a different Date to trick strftime, it's both simpler and more performant. + * Given that a template is expected to be parsed fewer times than rendered. + */ + static createDateFixedToTimezone(dateString: string): LiquidDate; + private static getTimezoneOffset; +} diff --git a/node_modules/liquidjs/dist/util/timezone-date.spec.d.ts b/node_modules/liquidjs/dist/util/timezone-date.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/util/timezone-date.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/dist/util/type-guards.d.ts b/node_modules/liquidjs/dist/util/type-guards.d.ts new file mode 100644 index 0000000..1d63c32 --- /dev/null +++ b/node_modules/liquidjs/dist/util/type-guards.d.ts @@ -0,0 +1,12 @@ +import { RangeToken, NumberToken, QuotedToken, LiteralToken, PropertyAccessToken, OutputToken, HTMLToken, TagToken, IdentifierToken, DelimitedToken, OperatorToken } from '../tokens'; +export declare function isDelimitedToken(val: any): val is DelimitedToken; +export declare function isOperatorToken(val: any): val is OperatorToken; +export declare function isHTMLToken(val: any): val is HTMLToken; +export declare function isOutputToken(val: any): val is OutputToken; +export declare function isTagToken(val: any): val is TagToken; +export declare function isQuotedToken(val: any): val is QuotedToken; +export declare function isLiteralToken(val: any): val is LiteralToken; +export declare function isNumberToken(val: any): val is NumberToken; +export declare function isPropertyAccessToken(val: any): val is PropertyAccessToken; +export declare function isWordToken(val: any): val is IdentifierToken; +export declare function isRangeToken(val: any): val is RangeToken; diff --git a/node_modules/liquidjs/dist/util/underscore.d.ts b/node_modules/liquidjs/dist/util/underscore.d.ts new file mode 100644 index 0000000..df7254c --- /dev/null +++ b/node_modules/liquidjs/dist/util/underscore.d.ts @@ -0,0 +1,35 @@ +export declare const toString: () => string; +export declare const hasOwnProperty: (v: PropertyKey) => boolean; +export declare function isString(value: any): value is string; +export declare function isFunction(value: any): value is Function; +export declare function isPromise(val: any): val is Promise; +export declare function isIterator(val: any): val is IterableIterator; +export declare function escapeRegex(str: string): string; +export declare function promisify(fn: (arg1: T1, cb: (err: Error | null, result: T2) => void) => void): (arg1: T1) => Promise; +export declare function promisify(fn: (arg1: T1, arg2: T2, cb: (err: Error | null, result: T3) => void) => void): (arg1: T1, arg2: T2) => Promise; +export declare function stringify(value: any): string; +export declare function toEnumerable(val: any): T[]; +export declare function toArray(val: any): any[]; +export declare function toValue(value: any): any; +export declare function isNumber(value: any): value is number; +export declare function toLiquid(value: any): any; +export declare function isNil(value: any): boolean; +export declare function isUndefined(value: any): boolean; +export declare function isArray(value: any): value is any[]; +export declare function isIterable(value: any): value is Iterable; +export declare function forOwn(obj: Record | undefined, iteratee: ((val: T, key: string, obj: { + [key: string]: T; +}) => boolean | void)): Record; +export declare function last(arr: T[]): T; +export declare function last(arr: string): string; +export declare function isObject(value: any): value is object; +export declare function range(start: number, stop: number, step?: number): number[]; +export declare function padStart(str: any, length: number, ch?: string): any; +export declare function padEnd(str: any, length: number, ch?: string): any; +export declare function pad(str: any, length: number, ch: string, add: (str: string, ch: string) => string): any; +export declare function identify(val: T): T; +export declare function changeCase(str: string): string; +export declare function ellipsis(str: string, N: number): string; +export declare function caseInsensitiveCompare(a: any, b: any): 0 | 1 | -1; +export declare function argumentsToValue any>(fn: F): (...args: Parameters) => any; +export declare function escapeRegExp(text: string): string; diff --git a/node_modules/liquidjs/dist/util/underscore.spec.d.ts b/node_modules/liquidjs/dist/util/underscore.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/node_modules/liquidjs/dist/util/underscore.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/liquidjs/package.json b/node_modules/liquidjs/package.json new file mode 100644 index 0000000..500d292 --- /dev/null +++ b/node_modules/liquidjs/package.json @@ -0,0 +1,161 @@ +{ + "name": "liquidjs", + "version": "10.14.0", + "description": "A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.", + "main": "dist/liquid.node.cjs.js", + "module": "dist/liquid.node.esm.js", + "es2015": "dist/liquid.browser.esm.js", + "browser": { + "./dist/liquid.node.cjs.js": "./dist/liquid.browser.umd.js", + "./dist/liquid.node.esm.js": "./dist/liquid.browser.esm.js" + }, + "types": "dist/index.d.ts", + "engines": { + "node": ">=14" + }, + "scripts": { + "lint": "eslint \"**/*.mjs\" \"**/*.ts\" .", + "check": "npm run build && npm run build:docs && npm test && npm run lint && npm run perf:diff", + "test": "jest", + "test:coverage": "jest --coverage src test/integration", + "test:e2e": "jest test/e2e", + "perf:diff": "bin/perf-diff.sh", + "perf:engines": "cd benchmark && npm run engines", + "version": "npm run build && npm test", + "build": "rollup -c rollup.config.mjs", + "build:cjs": "BUNDLES=cjs rollup -c rollup.config.mjs", + "build:min": "BUNDLES=min rollup -c rollup.config.mjs", + "build:umd": "BUNDLES=umd rollup -c rollup.config.mjs", + "build:charmap": "./bin/character-gen.js > src/util/character.ts", + "build:docs": "bin/build-docs.sh" + }, + "bin": { + "liquidjs": "./bin/liquid.js", + "liquid": "./bin/liquid.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/harttle/liquidjs.git" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/liquidjs" + }, + "files": [ + "bin/liquid.js", + "dist", + "LICENSE", + "README.md" + ], + "keywords": [ + "liquid", + "template engine", + "express", + "jinja", + "shopify" + ], + "author": "Harttle", + "license": "MIT", + "bugs": { + "url": "https://github.com/harttle/liquidjs/issues" + }, + "homepage": "https://github.com/harttle/liquidjs#readme", + "devDependencies": { + "@commitlint/cli": "^12.1.4", + "@commitlint/config-conventional": "^8.2.0", + "@semantic-release/changelog": "^6.0.2", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/npm": "^9.0.2", + "@semantic-release/release-notes-generator": "^10.0.3", + "@types/benchmark": "^1.0.31", + "@types/express": "^4.17.2", + "@types/jest": "^29.4.0", + "@types/jsdom": "^12.2.2", + "@types/sinon": "^10.0.13", + "@types/supertest": "^2.0.7", + "@typescript-eslint/eslint-plugin": "^5.6.0", + "@typescript-eslint/parser": "^5.6.0", + "all-contributors-cli": "^6.24.0", + "benchmark": "^2.1.4", + "coveralls": "^3.0.2", + "cross-env": "^5.2.0", + "eslint": "^7.32.0", + "eslint-config-standard": "^12.0.0", + "eslint-plugin-deprecation": "^1.3.2", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-mocha": "^5.3.0", + "eslint-plugin-node": "^8.0.1", + "eslint-plugin-promise": "^4.0.1", + "eslint-plugin-standard": "^4.0.0", + "express": "^4.16.4", + "husky": "^4.2.5", + "jest": "^29.5.0", + "jsdom": "^16.5.0", + "rollup": "^1.26.3", + "rollup-plugin-replace": "^2.1.0", + "rollup-plugin-typescript2": "^0.31.1", + "rollup-plugin-uglify": "^6.0.4", + "rollup-plugin-version-injector": "^1.3.3", + "semantic-release": "^19.0.3", + "sinon": "^15.0.2", + "supertest": "^3.4.2", + "ts-jest": "^29.0.5", + "tslib": "^2.3.1", + "typedoc": "^0.23.26", + "typescript": "^4.5.3" + }, + "dependencies": { + "commander": "^10.0.0" + }, + "release": { + "branch": "master", + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/npm", + [ + "@semantic-release/git", + { + "assets": [ + "package.json", + "package-lock.json", + "CHANGELOG.md" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + [ + "@semantic-release/github", + { + "assets": [ + { + "path": "dist/*.umd.js", + "label": "liquid.js" + }, + { + "path": "dist/*.min.js", + "label": "liquid.min.js" + }, + { + "path": "dist/*.min.js.map", + "label": "liquid.min.js.map" + } + ] + } + ] + ] + }, + "nyc": { + "extension": [ + ".ts" + ] + }, + "husky": { + "hooks": { + "pre-commit": "npm run check", + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } + } +} diff --git a/node_modules/list-to-array/.npmignore b/node_modules/list-to-array/.npmignore new file mode 100644 index 0000000..123ae94 --- /dev/null +++ b/node_modules/list-to-array/.npmignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +node_modules diff --git a/node_modules/list-to-array/LICENSE b/node_modules/list-to-array/LICENSE new file mode 100644 index 0000000..b9d8498 --- /dev/null +++ b/node_modules/list-to-array/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jed Watson + +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. + diff --git a/node_modules/list-to-array/README.md b/node_modules/list-to-array/README.md new file mode 100644 index 0000000..2fec249 --- /dev/null +++ b/node_modules/list-to-array/README.md @@ -0,0 +1,52 @@ +# list-to-array + +Simple javascript lib for converting a [comma || space] delimited string to an array. + +Trims values so you can use human-friendly lists like `'one, two, three' => ['one','two','three']` + +If in array is provided, it is simply returned. If a falsy or non-string value is provided, an empty array is returned. + +Won't work with values that contain spaces. + +## Installation + +``` +npm install list-to-array +``` + +Works in node.js, iojs or bundle for the browser with browserify or webpack. + +## Usage + +``` +var listToArray = require('list-to-array'); + +console.log(listToArray('one, two, three')); + +// logs ['one','two','three'] +``` + +## License + +(The MIT License) + +Copyright (c) 2015 Jed Watson + +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. diff --git a/node_modules/list-to-array/index.js b/node_modules/list-to-array/index.js new file mode 100644 index 0000000..78efcf9 --- /dev/null +++ b/node_modules/list-to-array/index.js @@ -0,0 +1,18 @@ +function truthy(val) { return val; } +function trim(str) { return str.trim(); } + +function listToArray (str, delimiter) { + if (Array.isArray(str)) { + return str; + } + if (!str || typeof str !== 'string') { + return []; + } + if (!delimiter) { + delimiter = ' '; + str = str.replace(/\,/g, ' '); + } + return str.split(delimiter).map(trim).filter(truthy); +} + +module.exports = listToArray; diff --git a/node_modules/list-to-array/package.json b/node_modules/list-to-array/package.json new file mode 100644 index 0000000..a6b8ed0 --- /dev/null +++ b/node_modules/list-to-array/package.json @@ -0,0 +1,32 @@ +{ + "name": "list-to-array", + "version": "1.1.0", + "description": "Simple javascript lib for converting a [comma || space] delimited string to an array", + "main": "index.js", + "author": "Jed Watson", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/JedWatson/list-to-array.git" + }, + "bugs": { + "url": "https://github.com/JedWatson/list-to-array/issues" + }, + "homepage": "https://github.com/JedWatson/list-to-array", + "scripts": { + "test": "mocha tests.js" + }, + "keywords": [ + "array", + "list", + "string", + "manipulation", + "conversion", + "function", + "library" + ], + "devDependencies": { + "mocha": "^2.2.5", + "must": "^0.12.0" + } +} diff --git a/node_modules/list-to-array/tests.js b/node_modules/list-to-array/tests.js new file mode 100644 index 0000000..456d275 --- /dev/null +++ b/node_modules/list-to-array/tests.js @@ -0,0 +1,29 @@ +var demand = require('must'); +var listToArray = require('./index'); + +describe('listToArray', function() { + it('splits a comma-delimited list into an array', function() { + listToArray('one,two,three').must.eql(['one', 'two', 'three']); + }); + it('splits a space-delimited list into an array', function() { + listToArray('one two three').must.eql(['one', 'two', 'three']); + }); + it('trims whitespace from values', function() { + listToArray('one, two, three').must.eql(['one', 'two', 'three']); + }); + it('splits a list into an array', function() { + listToArray('one,two,three').must.eql(['one', 'two', 'three']); + }); + it('returns a empty array w/ no arguments', function() { + listToArray().must.eql([]); + }); + it('returns a empty array for a blank string', function() { + listToArray('').must.eql([]); + }); + it('returns a empty array when only given whitespace', function() { + listToArray(' ').must.eql([]); + }); + it('returns a empty array when only given whitespace and commas', function() { + listToArray(' , ').must.eql([]); + }); +}); diff --git a/node_modules/lodash.deburr/LICENSE b/node_modules/lodash.deburr/LICENSE new file mode 100644 index 0000000..e0c69d5 --- /dev/null +++ b/node_modules/lodash.deburr/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.deburr/README.md b/node_modules/lodash.deburr/README.md new file mode 100644 index 0000000..616694f --- /dev/null +++ b/node_modules/lodash.deburr/README.md @@ -0,0 +1,18 @@ +# lodash.deburr v4.1.0 + +The [lodash](https://lodash.com/) method `_.deburr` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.deburr +``` + +In Node.js: +```js +var deburr = require('lodash.deburr'); +``` + +See the [documentation](https://lodash.com/docs#deburr) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.deburr) for more details. diff --git a/node_modules/lodash.deburr/index.js b/node_modules/lodash.deburr/index.js new file mode 100644 index 0000000..4f35de6 --- /dev/null +++ b/node_modules/lodash.deburr/index.js @@ -0,0 +1,257 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match Latin Unicode letters (excluding mathematical operators). */ +var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + +/** Used to compose unicode character classes. */ +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0'; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** Used to map Latin Unicode letters to basic Latin letters. */ +var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 'ss' +}; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ +var deburrLetter = basePropertyOf(deburredLetters); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; diff --git a/node_modules/lodash.deburr/package.json b/node_modules/lodash.deburr/package.json new file mode 100644 index 0000000..fabb6bb --- /dev/null +++ b/node_modules/lodash.deburr/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.deburr", + "version": "4.1.0", + "description": "The lodash method `_.deburr` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, deburr", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lru-cache/LICENSE b/node_modules/lru-cache/LICENSE new file mode 100644 index 0000000..f785757 --- /dev/null +++ b/node_modules/lru-cache/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/lru-cache/README.md b/node_modules/lru-cache/README.md new file mode 100644 index 0000000..931822f --- /dev/null +++ b/node_modules/lru-cache/README.md @@ -0,0 +1,331 @@ +# lru-cache + +A cache object that deletes the least-recently-used items. + +Specify a max number of the most recently used items that you +want to keep, and this cache will keep that many of the most +recently accessed items. + +This is not primarily a TTL cache, and does not make strong TTL +guarantees. There is no preemptive pruning of expired items by +default, but you _may_ set a TTL on the cache or on a single +`set`. If you do so, it will treat expired items as missing, and +delete them when fetched. If you are more interested in TTL +caching than LRU caching, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +As of version 7, this is one of the most performant LRU +implementations available in JavaScript, and supports a wide +diversity of use cases. However, note that using some of the +features will necessarily impact performance, by causing the +cache to have to do more work. See the "Performance" section +below. + +## Installation + +```bash +npm install lru-cache --save +``` + +## Usage + +```js +// hybrid module, either works +import { LRUCache } from 'lru-cache' +// or: +const { LRUCache } = require('lru-cache') +// or in minified form for web browsers: +import { LRUCache } from 'http://unpkg.com/lru-cache@9/dist/mjs/index.min.mjs' + +// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent +// unsafe unbounded storage. +// +// In most cases, it's best to specify a max for performance, so all +// the required memory allocation is done up-front. +// +// All the other options are optional, see the sections below for +// documentation on what each one does. Most of them can be +// overridden for specific items in get()/set() +const options = { + max: 500, + + // for use with tracking overall storage size + maxSize: 5000, + sizeCalculation: (value, key) => { + return 1 + }, + + // for use when you need to clean up something when objects + // are evicted from the cache + dispose: (value, key) => { + freeFromMemoryOrWhatever(value) + }, + + // how long to live in ms + ttl: 1000 * 60 * 5, + + // return stale items before removing from cache? + allowStale: false, + + updateAgeOnGet: false, + updateAgeOnHas: false, + + // async method to use for cache.fetch(), for + // stale-while-revalidate type of behavior + fetchMethod: async ( + key, + staleValue, + { options, signal, context } + ) => {}, +} + +const cache = new LRUCache(options) + +cache.set('key', 'value') +cache.get('key') // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.clear() // empty the cache +``` + +If you put more stuff in the cache, then less recently used items +will fall out. That's what an LRU cache is. + +For full description of the API and all options, please see [the +LRUCache typedocs](https://isaacs.github.io/node-lru-cache/) + +## Storage Bounds Safety + +This implementation aims to be as flexible as possible, within +the limits of safe memory consumption and optimal performance. + +At initial object creation, storage is allocated for `max` items. +If `max` is set to zero, then some performance is lost, and item +count is unbounded. Either `maxSize` or `ttl` _must_ be set if +`max` is not specified. + +If `maxSize` is set, then this creates a safe limit on the +maximum storage consumed, but without the performance benefits of +pre-allocation. When `maxSize` is set, every item _must_ provide +a size, either via the `sizeCalculation` method provided to the +constructor, or via a `size` or `sizeCalculation` option provided +to `cache.set()`. The size of every item _must_ be a positive +integer. + +If neither `max` nor `maxSize` are set, then `ttl` tracking must +be enabled. Note that, even when tracking item `ttl`, items are +_not_ preemptively deleted when they become stale, unless +`ttlAutopurge` is enabled. Instead, they are only purged the +next time the key is requested. Thus, if `ttlAutopurge`, `max`, +and `maxSize` are all not set, then the cache will potentially +grow unbounded. + +In this case, a warning is printed to standard error. Future +versions may require the use of `ttlAutopurge` if `max` and +`maxSize` are not specified. + +If you truly wish to use a cache that is bound _only_ by TTL +expiration, consider using a `Map` object, and calling +`setTimeout` to delete entries when they expire. It will perform +much better than an LRU cache. + +Here is an implementation you may use, under the same +[license](./LICENSE) as this package: + +```js +// a storage-unbounded ttl cache that is not an lru-cache +const cache = { + data: new Map(), + timers: new Map(), + set: (k, v, ttl) => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.set( + k, + setTimeout(() => cache.delete(k), ttl) + ) + cache.data.set(k, v) + }, + get: k => cache.data.get(k), + has: k => cache.data.has(k), + delete: k => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.delete(k) + return cache.data.delete(k) + }, + clear: () => { + cache.data.clear() + for (const v of cache.timers.values()) { + clearTimeout(v) + } + cache.timers.clear() + }, +} +``` + +If that isn't to your liking, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +## Storing Undefined Values + +This cache never stores undefined values, as `undefined` is used +internally in a few places to indicate that a key is not in the +cache. + +You may call `cache.set(key, undefined)`, but this is just +an alias for `cache.delete(key)`. Note that this has the effect +that `cache.has(key)` will return _false_ after setting it to +undefined. + +```js +cache.set(myKey, undefined) +cache.has(myKey) // false! +``` + +If you need to track `undefined` values, and still note that the +key is in the cache, an easy workaround is to use a sigil object +of your own. + +```js +import { LRUCache } from 'lru-cache' +const undefinedValue = Symbol('undefined') +const cache = new LRUCache(...) +const mySet = (key, value) => + cache.set(key, value === undefined ? undefinedValue : value) +const myGet = (key, value) => { + const v = cache.get(key) + return v === undefinedValue ? undefined : v +} +``` + +## Performance + +As of January 2022, version 7 of this library is one of the most +performant LRU cache implementations in JavaScript. + +Benchmarks can be extremely difficult to get right. In +particular, the performance of set/get/delete operations on +objects will vary _wildly_ depending on the type of key used. V8 +is highly optimized for objects with keys that are short strings, +especially integer numeric strings. Thus any benchmark which +tests _solely_ using numbers as keys will tend to find that an +object-based approach performs the best. + +Note that coercing _anything_ to strings to use as object keys is +unsafe, unless you can be 100% certain that no other type of +value will be used. For example: + +```js +const myCache = {} +const set = (k, v) => (myCache[k] = v) +const get = k => myCache[k] + +set({}, 'please hang onto this for me') +set('[object Object]', 'oopsie') +``` + +Also beware of "Just So" stories regarding performance. Garbage +collection of large (especially: deep) object graphs can be +incredibly costly, with several "tipping points" where it +increases exponentially. As a result, putting that off until +later can make it much worse, and less predictable. If a library +performs well, but only in a scenario where the object graph is +kept shallow, then that won't help you if you are using large +objects as keys. + +In general, when attempting to use a library to improve +performance (such as a cache like this one), it's best to choose +an option that will perform well in the sorts of scenarios where +you'll actually use it. + +This library is optimized for repeated gets and minimizing +eviction time, since that is the expected need of a LRU. Set +operations are somewhat slower on average than a few other +options, in part because of that optimization. It is assumed +that you'll be caching some costly operation, ideally as rarely +as possible, so optimizing set over get would be unwise. + +If performance matters to you: + +1. If it's at all possible to use small integer values as keys, + and you can guarantee that no other types of values will be + used as keys, then do that, and use a cache such as + [lru-fast](https://npmjs.com/package/lru-fast), or + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) + which uses an Object as its data store. + +2. Failing that, if at all possible, use short non-numeric + strings (ie, less than 256 characters) as your keys, and use + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). + +3. If the types of your keys will be anything else, especially + long strings, strings that look like floats, objects, or some + mix of types, or if you aren't sure, then this library will + work well for you. + + If you do not need the features that this library provides + (like asynchronous fetching, a variety of TTL staleness + options, and so on), then [mnemonist's + LRUMap](https://yomguithereal.github.io/mnemonist/lru-map) is + a very good option, and just slightly faster than this module + (since it does considerably less). + +4. Do not use a `dispose` function, size tracking, or especially + ttl behavior, unless absolutely needed. These features are + convenient, and necessary in some use cases, and every attempt + has been made to make the performance impact minimal, but it + isn't nothing. + +## Breaking Changes in Version 7 + +This library changed to a different algorithm and internal data +structure in version 7, yielding significantly better +performance, albeit with some subtle changes as a result. + +If you were relying on the internals of LRUCache in version 6 or +before, it probably will not work in version 7 and above. + +## Breaking Changes in Version 8 + +- The `fetchContext` option was renamed to `context`, and may no + longer be set on the cache instance itself. +- Rewritten in TypeScript, so pretty much all the types moved + around a lot. +- The AbortController/AbortSignal polyfill was removed. For this + reason, **Node version 16.14.0 or higher is now required**. +- Internal properties were moved to actual private class + properties. +- Keys and values must not be `null` or `undefined`. +- Minified export available at `'lru-cache/min'`, for both CJS + and MJS builds. + +## Breaking Changes in Version 9 + +- Named export only, no default export. +- AbortController polyfill returned, albeit with a warning when + used. + +## Breaking Changes in Version 10 + +- `cache.fetch()` return type is now `Promise` + instead of `Promise`. This is an irrelevant change + practically speaking, but can require changes for TypeScript + users. + +For more info, see the [change log](CHANGELOG.md). diff --git a/node_modules/lru-cache/dist/commonjs/index.d.ts b/node_modules/lru-cache/dist/commonjs/index.d.ts new file mode 100644 index 0000000..f59de76 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.d.ts @@ -0,0 +1,1277 @@ +/** + * @module LRUCache + */ +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + */ + interface Status { + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss'; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The old value, specified in the case of `set:'update'` or + * `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: undefined; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: undefined; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoerOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * 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. + */ +export declare class LRUCache implements Map { + #private; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** + * 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: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: any) => boolean; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: any) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | 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: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * 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(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * 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(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * 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(): Generator | undefined, void, unknown>; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * 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]: string; + /** + * 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: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * 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: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * 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: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * 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: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRLUCache#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(): [K, LRUCache.Entry][]; + /** + * 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: [K, LRUCache.Entry][]): void; + /** + * 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: K, v: V | BackgroundFetch | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * 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: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * 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: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * 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: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.d.ts.map b/node_modules/lru-cache/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..34d60c5 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0FH,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAyB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AACvC,cAAM,KAAK;;IACT,IAAI,EAA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IAiBb;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,CAAC,EAAE,CAAC,EACJ,WAAW,EAAE,OAAO,SAAS,EAAE,GAC3B,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9B,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GACnC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC5C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GACjB,CAAC,GACD,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,CAAC,GACD,KAAK,EACT,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAC5B,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9B,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GACnC,KAAK,GACR,CAAC;IAiBJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IAgFxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAqDX;;OAEG;IACH,KAAK;CA0CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.js b/node_modules/lru-cache/dist/commonjs/index.js new file mode 100644 index 0000000..0589231 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.js @@ -0,0 +1,1546 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const perf = 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; + #disposeAfter; + #fetchMethod; + #memoMethod; + /** + * {@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; + /** + * 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.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; + 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 disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + 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 = 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 ? 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 = 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]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + return undefined; + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (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 LRLUCache#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 = 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 = 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; + } + 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 (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) { + 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); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.js.map b/node_modules/lru-cache/dist/commonjs/index.js.map new file mode 100644 index 0000000..557c616 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,MAAM,IAAI,GACR,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU;IACnC,CAAC,CAAC,WAAW;IACb,CAAC,CAAC,IAAI,CAAA;AAEV,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAKhC,qBAAqB;AACrB,MA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AAI,CAAC,CAAC,CAAC,CAAA;SACpB;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE;YAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC3B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;aAC9B;SACF;IACH,CAAC;CACF;AAxwDD,4BAwwDC","sourcesContent":["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.min.js b/node_modules/lru-cache/dist/commonjs/index.min.js new file mode 100644 index 0000000..ad643b0 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.min.js @@ -0,0 +1,2 @@ +"use strict";var G=(l,t,e)=>{if(!t.has(l))throw TypeError("Cannot "+e)};var j=(l,t,e)=>(G(l,t,"read from private field"),e?e.call(l):t.get(l)),I=(l,t,e)=>{if(t.has(l))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(l):t.set(l,e)},x=(l,t,e,i)=>(G(l,t,"write to private field"),i?i.call(l,e):t.set(l,e),e);Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var T=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,P=new Set,U=typeof process=="object"&&process?process:{},H=(l,t,e,i)=>{typeof U.emitWarning=="function"?U.emitWarning(l,t,e,i):console.error(`[${e}] ${t}: ${l}`)},D=globalThis.AbortController,N=globalThis.AbortSignal;if(typeof D>"u"){N=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},D=class{constructor(){t()}signal=new N;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let l=U.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=!1,H("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",t))}}var V=l=>!P.has(l),Y=Symbol("type"),A=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),k=l=>A(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?E:null:null,E=class extends Array{constructor(t){super(t),this.fill(0)}},v,O=class{heap;length;static create(t){let e=k(t);if(!e)return[];x(O,v,!0);let i=new O(t,e);return x(O,v,!1),i}constructor(t,e){if(!j(O,v))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},W=O;v=new WeakMap,I(W,v,!1);var C=class{#g;#f;#p;#w;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#c;#o;#h;#_;#r;#b;#m;#u;#y;#E;#a;static unsafeExposeInternals(t){return{starts:t.#m,ttls:t.#u,sizes:t.#b,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#x(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#F(e),isStale:e=>t.#d(e)}}get max(){return this.#g}get maxSize(){return this.#f}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get disposeAfter(){return this.#w}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:o,allowStale:r,dispose:g,disposeAfter:b,noDisposeOnSet:f,noUpdateTTL:u,maxSize:c=0,maxEntrySize:F=0,sizeCalculation:d,fetchMethod:S,memoMethod:a,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:z}=t;if(e!==0&&!A(e))throw new TypeError("max option must be a nonnegative integer");let y=e?k(e):Array;if(!y)throw new Error("invalid max value: "+e);if(this.#g=e,this.#f=c,this.maxEntrySize=F||this.#f,this.sizeCalculation=d,this.sizeCalculation){if(!this.#f&&!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(a!==void 0&&typeof a!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=a,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=S,this.#E=!!S,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new y(e),this.#c=new y(e),this.#o=0,this.#h=0,this.#_=W.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof b=="function"?(this.#w=b,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#y=!!this.#p,this.#a=!!this.#w,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#f!==0&&!A(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!A(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!o,this.ttlResolution=A(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!A(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#U()}if(this.#g===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#g&&!this.#f){let R="LRU_CACHE_UNBOUNDED";V(R)&&(P.add(R),H("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,C))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#U(){let t=new E(this.#g),e=new E(this.#g);this.#u=t,this.#m=e,this.#M=(n,h,o=T.now())=>{if(e[n]=h!==0?o:0,t[n]=h,h!==0&&this.ttlAutopurge){let r=setTimeout(()=>{this.#d(n)&&this.#T(this.#i[n],"expire")},h+1);r.unref&&r.unref()}},this.#v=n=>{e[n]=t[n]!==0?T.now():0},this.#O=(n,h)=>{if(t[h]){let o=t[h],r=e[h];if(!o||!r)return;n.ttl=o,n.start=r,n.now=i||s();let g=n.now-r;n.remainingTTL=o-g}};let i=0,s=()=>{let n=T.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#s.get(n);if(h===void 0)return 0;let o=t[h],r=e[h];if(!o||!r)return 1/0;let g=(i||s())-r;return o-g},this.#d=n=>{let h=e[n],o=t[n];return!!o&&!!h&&(i||s())-h>o}}#v=()=>{};#O=()=>{};#M=()=>{};#d=()=>!1;#P(){let t=new E(this.#g);this.#S=0,this.#b=t,this.#z=e=>{this.#S-=t[e],t[e]=0},this.#G=(e,i,s,n)=>{if(this.#e(i))return 0;if(!A(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!A(s))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 s},this.#D=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#S>n;)this.#L(!0)}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S)}}#z=t=>{};#D=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;!(!this.#j(e)||((t||!this.#d(e))&&(yield e),e===this.#o));)e=this.#c[e]}*#F({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#j(e)||((t||!this.#d(e))&&(yield e),e===this.#h));)e=this.#l[e]}#j(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#F())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#F()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#F())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#F()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#F({allowStale:!0}))this.#d(e)&&(this.#T(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#u&&this.#m){let h=this.#u[e],o=this.#m[e];if(h&&o){let r=h-(T.now()-o);n.ttl=r,n.start=Date.now()}}return this.#b&&(n.size=this.#b[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#u&&this.#m){h.ttl=this.#u[e];let o=T.now()-this.#m[e];h.start=Math.floor(Date.now()-o)}this.#b&&(h.size=this.#b[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=T.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:r}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,b=this.#G(t,e,i.size||0,o);if(this.maxEntrySize&&b>this.maxEntrySize)return r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this.#T(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#g?this.#L(!1):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#h]=f,this.#c[f]=this.#h,this.#h=f,this.#n++,this.#D(f,b,r),r&&(r.set="add"),g=!1;else{this.#C(f);let u=this.#t[f];if(e!==u){if(this.#E&&this.#e(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:c}=u;c!==void 0&&!h&&(this.#y&&this.#p?.(c,t,"set"),this.#a&&this.#r?.push([c,t,"set"]))}else h||(this.#y&&this.#p?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"]));if(this.#z(f),this.#D(f,b,r),this.#t[f]=e,r){r.set="replace";let c=u&&this.#e(u)?u.__staleWhileFetching:u;c!==void 0&&(r.oldValue=c)}}else r&&(r.set="update")}if(s!==0&&!this.#u&&this.#U(),this.#u&&(g||this.#M(f,s,n),r&&this.#O(r,f)),!h&&this.#a&&this.#r){let u=this.#r,c;for(;c=u?.shift();)this.#w?.(...c)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#L(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#w?.(...e)}}}#L(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#E&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#z(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#o=this.#h=0,this.#_.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#d(n))s&&(s.has="stale",this.#O(s,n));else return i&&this.#v(n),s&&(s.has="hit",this.#O(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#d(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#x(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new D,{signal:o}=i;o?.addEventListener("abort",()=>h.abort(o.reason),{signal:h.signal});let r={signal:h.signal,options:i,context:s},g=(d,S=!1)=>{let{aborted:a}=h.signal,w=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(a&&!S?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!w&&!S)return f(h.signal.reason);let m=c;return this.#t[e]===c&&(d===void 0?m.__staleWhileFetching?this.#t[e]=m.__staleWhileFetching:this.#T(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,d,r.options))),d},b=d=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=d),f(d)),f=d=>{let{aborted:S}=h.signal,a=S&&i.allowStaleOnFetchAbort,w=a||i.allowStaleOnFetchRejection,m=w||i.noDeleteOnFetchRejection,p=c;if(this.#t[e]===c&&(!m||p.__staleWhileFetching===void 0?this.#T(t,"fetch"):a||(this.#t[e]=p.__staleWhileFetching)),w)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw d},u=(d,S)=>{let a=this.#R?.(t,n,r);a&&a instanceof Promise&&a.then(w=>d(w===void 0?void 0:w),S),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=w=>g(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(u).then(g,b),F=Object.assign(c,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,F,{...r.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=F,F}#e(t){if(!this.#E)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof D}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:r=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:b=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:d,forceRefresh:S=!1,status:a,signal:w}=e;if(!this.#E)return a&&(a.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let m={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:o,size:r,sizeCalculation:g,noUpdateTTL:b,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:F,ignoreFetchAbort:c,status:a,signal:w},p=this.#s.get(t);if(p===void 0){a&&(a.fetch="miss");let _=this.#x(t,p,m,d);return _.__returned=_}else{let _=this.#t[p];if(this.#e(_)){let M=i&&_.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",M&&(a.returnedStale=!0)),M?_.__staleWhileFetching:_.__returned=_}let z=this.#d(p);if(!S&&!z)return a&&(a.fetch="hit"),this.#C(p),s&&this.#v(p),a&&this.#O(a,p),_;let y=this.#x(t,p,m,d),L=y.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=z?"stale":"refresh",L&&z&&(a.returnedStale=!0)),L?y.__staleWhileFetching:y.__returned=y}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...h}=e,o=this.get(t,h);if(!n&&o!==void 0)return o;let r=i(t,o,{options:h,context:s});return this.set(t,r,h),r}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,o=this.#s.get(t);if(o!==void 0){let r=this.#t[o],g=this.#e(r);return h&&this.#O(h,o),this.#d(o)?(h&&(h.get="stale"),g?(h&&i&&r.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?r.__staleWhileFetching:void 0):(n||this.#T(t,"expire"),h&&i&&(h.returnedStale=!0),i?r:void 0)):(h&&(h.get="hit"),g?r.__staleWhileFetching:(this.#C(o),s&&this.#v(o),r))}else h&&(h.get="miss")}#I(t,e){this.#c[e]=t,this.#l[t]=e}#C(t){t!==this.#h&&(t===this.#o?this.#o=this.#l[t]:this.#I(this.#c[t],this.#l[t]),this.#I(this.#h,t),this.#h=t)}delete(t){return this.#T(t,"delete")}#T(t,e){let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=!0,this.#n===1)this.#N(e);else{this.#z(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(n,t,e),this.#a&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#c[s];else if(s===this.#o)this.#o=this.#l[s];else{let h=this.#c[s];this.#l[h]=this.#l[s];let o=this.#l[s];this.#c[o]=this.#c[s]}this.#n--,this.#_.push(s)}}if(this.#a&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#N("delete")}#N(t){for(let e of this.#F({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#y&&this.#p?.(i,s,t),this.#a&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#u&&this.#m&&(this.#u.fill(0),this.#m.fill(0)),this.#b&&this.#b.fill(0),this.#o=0,this.#h=0,this.#_.length=0,this.#S=0,this.#n=0,this.#a&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#w?.(...i)}}};exports.LRUCache=C; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/commonjs/index.min.js.map b/node_modules/lru-cache/dist/commonjs/index.min.js.map new file mode 100644 index 0000000..11b43a0 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/index.ts"], + "sourcesContent": ["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "+aAMA,IAAMA,EACJ,OAAO,aAAgB,UACvB,aACA,O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ACZ+E,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAK3F,KAAgB,GAAG4F,CAAI,EAGhC,OAAOR,CACT,CAKA,OAAK,CACH,OAAO,KAAKyC,GAAO,QAAQ,CAC7B,CACAA,GAAOnJ,EAA8B,CACnC,QAAW8C,KAAS,KAAKM,GAAU,CAAE,WAAY,EAAI,CAAE,EAAG,CACxD,IAAMyC,EAAI,KAAKhE,GAASiB,CAAK,EAC7B,GAAI,KAAKF,GAAmBiD,CAAC,EAC3BA,EAAE,kBAAkB,MAAM,IAAI,MAAM,SAAS,CAAC,MACzC,CACL,IAAMhD,EAAI,KAAKjB,GAASkB,CAAK,EACzB,KAAKP,IACP,KAAKlB,KAAWwE,EAAQhD,EAAQ7C,CAAM,EAEpC,KAAKyC,IACP,KAAKN,IAAW,KAAK,CAAC0D,EAAQhD,EAAQ7C,CAAM,CAAC,GAoBnD,GAfA,KAAK2B,GAAQ,MAAK,EAClB,KAAKE,GAAS,KAAK,MAAS,EAC5B,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,KACrB,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,GAEjB,KAAKD,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKgB,IAAoB,KAAKN,GAAW,CAC3C,IAAM8E,EAAK,KAAK9E,GACZ+E,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAK3F,KAAgB,GAAG4F,CAAI,EAGlC,GAvwDF,QAAA,SAAAhG", + "names": ["perf", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "AC", "AS", "_", "warnACPolyfill", "reason", "printACPolyfillWarning", "shouldWarn", "TYPE", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "_Stack", "HeapCls", "__privateSet", "_constructing", "s", "__privateGet", "Stack", "__privateAdd", "LRUCache", "#max", "#maxSize", "#dispose", "#disposeAfter", "#fetchMethod", "#memoMethod", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "key", "ttls", "starts", "#setItemTTL", "start", "t", "#delete", "#updateItemAge", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "getOptions", "value", "thisp", "deleted", "entry", "remain", "arr", "setOptions", "oldVal", "oldValue", "dt", "task", "val", "free", "head", "hasOptions", "peekOptions", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "fetchFail", "bf", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "forceRefresh", "stale", "isStale", "staleVal", "memoOptions", "vv", "fetching", "#connect", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/commonjs/package.json b/node_modules/lru-cache/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/lru-cache/dist/esm/index.d.ts b/node_modules/lru-cache/dist/esm/index.d.ts new file mode 100644 index 0000000..f59de76 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.d.ts @@ -0,0 +1,1277 @@ +/** + * @module LRUCache + */ +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + */ + interface Status { + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss'; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The old value, specified in the case of `set:'update'` or + * `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: undefined; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: undefined; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoerOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * 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. + */ +export declare class LRUCache implements Map { + #private; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** + * 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: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: any) => boolean; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: any) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | 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: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * 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(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * 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(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * 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(): Generator | undefined, void, unknown>; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * 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]: string; + /** + * 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: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * 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: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * 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: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * 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: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRLUCache#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(): [K, LRUCache.Entry][]; + /** + * 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: [K, LRUCache.Entry][]): void; + /** + * 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: K, v: V | BackgroundFetch | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * 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: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * 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: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * 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: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.d.ts.map b/node_modules/lru-cache/dist/esm/index.d.ts.map new file mode 100644 index 0000000..34d60c5 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0FH,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAyB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AACvC,cAAM,KAAK;;IACT,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IAGd,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;gBASnC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE;IAU3C,IAAI,CAAC,CAAC,EAAE,KAAK;IAGb,GAAG,IAAI,KAAK;CAGb;AAED;;GAEG;AACH,MAAM,MAAM,eAA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,EAAE,CAAC,EAAE,EAAE,CAAC,GAC5C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GACjB,CAAC,GACD,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,CAAC,GACD,KAAK,EACT,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAC5B,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9B,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GACnC,KAAK,GACR,CAAC;IAiBJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IAgFxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAqDX;;OAEG;IACH,KAAK;CA0CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.js b/node_modules/lru-cache/dist/esm/index.js new file mode 100644 index 0000000..555654a --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.js @@ -0,0 +1,1542 @@ +/** + * @module LRUCache + */ +const perf = 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. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #disposeAfter; + #fetchMethod; + #memoMethod; + /** + * {@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; + /** + * 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.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; + 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 disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + 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 = 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 ? 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 = 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]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + return undefined; + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (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 LRLUCache#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 = 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 = 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; + } + 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 (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) { + 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 \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.js.map b/node_modules/lru-cache/dist/esm/index.js.map new file mode 100644 index 0000000..8f7ac53 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,IAAI,GACR,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU;IACnC,CAAC,CAAC,WAAW;IACb,CAAC,CAAC,IAAI,CAAA;AAEV,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAKhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAChC,CAAA;AACzB,qBAAqB;AAErB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;QACvC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC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mC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC3B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;aAC9B;SACF;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.min.js b/node_modules/lru-cache/dist/esm/index.min.js new file mode 100644 index 0000000..4571d02 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.min.js @@ -0,0 +1,2 @@ +var G=(l,t,e)=>{if(!t.has(l))throw TypeError("Cannot "+e)};var I=(l,t,e)=>(G(l,t,"read from private field"),e?e.call(l):t.get(l)),j=(l,t,e)=>{if(t.has(l))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(l):t.set(l,e)},x=(l,t,e,i)=>(G(l,t,"write to private field"),i?i.call(l,e):t.set(l,e),e);var T=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,P=new Set,M=typeof process=="object"&&process?process:{},H=(l,t,e,i)=>{typeof M.emitWarning=="function"?M.emitWarning(l,t,e,i):console.error(`[${e}] ${t}: ${l}`)},W=globalThis.AbortController,N=globalThis.AbortSignal;if(typeof W>"u"){N=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},W=class{constructor(){t()}signal=new N;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let l=M.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=!1,H("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",t))}}var V=l=>!P.has(l),Y=Symbol("type"),A=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),k=l=>A(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0)}},z,E=class{heap;length;static create(t){let e=k(t);if(!e)return[];x(E,z,!0);let i=new E(t,e);return x(E,z,!1),i}constructor(t,e){if(!I(E,z))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},R=E;z=new WeakMap,j(R,z,!1);var D=class{#g;#f;#p;#w;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#c;#o;#h;#_;#r;#m;#b;#u;#y;#O;#a;static unsafeExposeInternals(t){return{starts:t.#b,ttls:t.#u,sizes:t.#m,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#x(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#F(e),isStale:e=>t.#d(e)}}get max(){return this.#g}get maxSize(){return this.#f}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get disposeAfter(){return this.#w}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:o,allowStale:r,dispose:g,disposeAfter:m,noDisposeOnSet:f,noUpdateTTL:u,maxSize:c=0,maxEntrySize:F=0,sizeCalculation:d,fetchMethod:S,memoMethod:a,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:v}=t;if(e!==0&&!A(e))throw new TypeError("max option must be a nonnegative integer");let y=e?k(e):Array;if(!y)throw new Error("invalid max value: "+e);if(this.#g=e,this.#f=c,this.maxEntrySize=F||this.#f,this.sizeCalculation=d,this.sizeCalculation){if(!this.#f&&!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(a!==void 0&&typeof a!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=a,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=S,this.#O=!!S,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new y(e),this.#c=new y(e),this.#o=0,this.#h=0,this.#_=R.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof m=="function"?(this.#w=m,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#y=!!this.#p,this.#a=!!this.#w,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#f!==0&&!A(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!A(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!o,this.ttlResolution=A(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!A(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#g===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#g&&!this.#f){let C="LRU_CACHE_UNBOUNDED";V(C)&&(P.add(C),H("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,D))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#M(){let t=new O(this.#g),e=new O(this.#g);this.#u=t,this.#b=e,this.#U=(n,h,o=T.now())=>{if(e[n]=h!==0?o:0,t[n]=h,h!==0&&this.ttlAutopurge){let r=setTimeout(()=>{this.#d(n)&&this.#T(this.#i[n],"expire")},h+1);r.unref&&r.unref()}},this.#z=n=>{e[n]=t[n]!==0?T.now():0},this.#E=(n,h)=>{if(t[h]){let o=t[h],r=e[h];if(!o||!r)return;n.ttl=o,n.start=r,n.now=i||s();let g=n.now-r;n.remainingTTL=o-g}};let i=0,s=()=>{let n=T.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#s.get(n);if(h===void 0)return 0;let o=t[h],r=e[h];if(!o||!r)return 1/0;let g=(i||s())-r;return o-g},this.#d=n=>{let h=e[n],o=t[n];return!!o&&!!h&&(i||s())-h>o}}#z=()=>{};#E=()=>{};#U=()=>{};#d=()=>!1;#P(){let t=new O(this.#g);this.#S=0,this.#m=t,this.#v=e=>{this.#S-=t[e],t[e]=0},this.#G=(e,i,s,n)=>{if(this.#e(i))return 0;if(!A(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!A(s))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 s},this.#D=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#S>n;)this.#L(!0)}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S)}}#v=t=>{};#D=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;!(!this.#I(e)||((t||!this.#d(e))&&(yield e),e===this.#o));)e=this.#c[e]}*#F({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#I(e)||((t||!this.#d(e))&&(yield e),e===this.#h));)e=this.#l[e]}#I(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#F())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#F()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#F())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#F()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#F({allowStale:!0}))this.#d(e)&&(this.#T(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#u&&this.#b){let h=this.#u[e],o=this.#b[e];if(h&&o){let r=h-(T.now()-o);n.ttl=r,n.start=Date.now()}}return this.#m&&(n.size=this.#m[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#u&&this.#b){h.ttl=this.#u[e];let o=T.now()-this.#b[e];h.start=Math.floor(Date.now()-o)}this.#m&&(h.size=this.#m[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=T.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:r}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,m=this.#G(t,e,i.size||0,o);if(this.maxEntrySize&&m>this.maxEntrySize)return r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this.#T(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#g?this.#L(!1):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#h]=f,this.#c[f]=this.#h,this.#h=f,this.#n++,this.#D(f,m,r),r&&(r.set="add"),g=!1;else{this.#C(f);let u=this.#t[f];if(e!==u){if(this.#O&&this.#e(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:c}=u;c!==void 0&&!h&&(this.#y&&this.#p?.(c,t,"set"),this.#a&&this.#r?.push([c,t,"set"]))}else h||(this.#y&&this.#p?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"]));if(this.#v(f),this.#D(f,m,r),this.#t[f]=e,r){r.set="replace";let c=u&&this.#e(u)?u.__staleWhileFetching:u;c!==void 0&&(r.oldValue=c)}}else r&&(r.set="update")}if(s!==0&&!this.#u&&this.#M(),this.#u&&(g||this.#U(f,s,n),r&&this.#E(r,f)),!h&&this.#a&&this.#r){let u=this.#r,c;for(;c=u?.shift();)this.#w?.(...c)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#L(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#w?.(...e)}}}#L(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#O&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#v(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#o=this.#h=0,this.#_.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#d(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#z(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#d(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#x(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new W,{signal:o}=i;o?.addEventListener("abort",()=>h.abort(o.reason),{signal:h.signal});let r={signal:h.signal,options:i,context:s},g=(d,S=!1)=>{let{aborted:a}=h.signal,w=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(a&&!S?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!w&&!S)return f(h.signal.reason);let b=c;return this.#t[e]===c&&(d===void 0?b.__staleWhileFetching?this.#t[e]=b.__staleWhileFetching:this.#T(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,d,r.options))),d},m=d=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=d),f(d)),f=d=>{let{aborted:S}=h.signal,a=S&&i.allowStaleOnFetchAbort,w=a||i.allowStaleOnFetchRejection,b=w||i.noDeleteOnFetchRejection,p=c;if(this.#t[e]===c&&(!b||p.__staleWhileFetching===void 0?this.#T(t,"fetch"):a||(this.#t[e]=p.__staleWhileFetching)),w)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw d},u=(d,S)=>{let a=this.#R?.(t,n,r);a&&a instanceof Promise&&a.then(w=>d(w===void 0?void 0:w),S),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=w=>g(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(u).then(g,m),F=Object.assign(c,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,F,{...r.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=F,F}#e(t){if(!this.#O)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof W}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:r=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:d,forceRefresh:S=!1,status:a,signal:w}=e;if(!this.#O)return a&&(a.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let b={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:o,size:r,sizeCalculation:g,noUpdateTTL:m,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:F,ignoreFetchAbort:c,status:a,signal:w},p=this.#s.get(t);if(p===void 0){a&&(a.fetch="miss");let _=this.#x(t,p,b,d);return _.__returned=_}else{let _=this.#t[p];if(this.#e(_)){let U=i&&_.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",U&&(a.returnedStale=!0)),U?_.__staleWhileFetching:_.__returned=_}let v=this.#d(p);if(!S&&!v)return a&&(a.fetch="hit"),this.#C(p),s&&this.#z(p),a&&this.#E(a,p),_;let y=this.#x(t,p,b,d),L=y.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=v?"stale":"refresh",L&&v&&(a.returnedStale=!0)),L?y.__staleWhileFetching:y.__returned=y}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...h}=e,o=this.get(t,h);if(!n&&o!==void 0)return o;let r=i(t,o,{options:h,context:s});return this.set(t,r,h),r}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,o=this.#s.get(t);if(o!==void 0){let r=this.#t[o],g=this.#e(r);return h&&this.#E(h,o),this.#d(o)?(h&&(h.get="stale"),g?(h&&i&&r.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?r.__staleWhileFetching:void 0):(n||this.#T(t,"expire"),h&&i&&(h.returnedStale=!0),i?r:void 0)):(h&&(h.get="hit"),g?r.__staleWhileFetching:(this.#C(o),s&&this.#z(o),r))}else h&&(h.get="miss")}#j(t,e){this.#c[e]=t,this.#l[t]=e}#C(t){t!==this.#h&&(t===this.#o?this.#o=this.#l[t]:this.#j(this.#c[t],this.#l[t]),this.#j(this.#h,t),this.#h=t)}delete(t){return this.#T(t,"delete")}#T(t,e){let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=!0,this.#n===1)this.#N(e);else{this.#v(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(n,t,e),this.#a&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#c[s];else if(s===this.#o)this.#o=this.#l[s];else{let h=this.#c[s];this.#l[h]=this.#l[s];let o=this.#l[s];this.#c[o]=this.#c[s]}this.#n--,this.#_.push(s)}}if(this.#a&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#N("delete")}#N(t){for(let e of this.#F({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#y&&this.#p?.(i,s,t),this.#a&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#u&&this.#b&&(this.#u.fill(0),this.#b.fill(0)),this.#m&&this.#m.fill(0),this.#o=0,this.#h=0,this.#_.length=0,this.#S=0,this.#n=0,this.#a&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#w?.(...i)}}};export{D as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/esm/index.min.js.map b/node_modules/lru-cache/dist/esm/index.min.js.map new file mode 100644 index 0000000..117a9de --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/index.ts"], + "sourcesContent": ["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "mVAMA,IAAMA,EACJ,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WACvB,YACA,KAEAC,EAAS,IAAI,IAMbC,EACJ,OAAO,SAAY,UAAc,QAAU,QAAU,CAAA,EAIjDC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACF,OAAOL,EAAQ,aAAgB,WAC3BA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EACvC,QAAQ,MAAM,IAAID,MAASD,MAASD,GAAK,CAC/C,EAEII,EAAK,WAAW,gBAChBC,EAAK,WAAW,YAGpB,GAAI,OAAOD,EAAO,IAAa,CAE7BC,EAAK,KAAiB,CACpB,QACA,SAAqC,CAAA,EACrC,OACA,QAAmB,GACnB,iBAAiBC,EAAWH,EAAwB,CAClD,KAAK,SAAS,KAAKA,CAAE,CACvB,GAGFC,EAAK,KAAqB,CACxB,aAAA,CACEG,EAAc,CAChB,CACA,OAAS,IAAIF,EACb,MAAMG,EAAW,CACf,GAAI,MAAK,OAAO,QAEhB,MAAK,OAAO,OAASA,EAErB,KAAK,OAAO,QAAU,GAEtB,QAAWL,KAAM,KAAK,OAAO,SAC3BA,EAAGK,CAAM,EAEX,KAAK,OAAO,UAAUA,CAAM,EAC9B,GAEF,IAAIC,EACFX,EAAQ,KAAK,8BAAgC,IACzCS,EAAiB,IAAK,CACrBE,IACLA,EAAyB,GACzBV,EACE,maAOA,sBACA,UACAQ,CAAc,EAElB,EAIF,IAAMG,EAAcR,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAE/CS,EAAO,O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AoB,KAAKN,GAAW,CAC3C,IAAM8E,EAAK,KAAK9E,GACZ+E,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAK3F,KAAgB,GAAG4F,CAAI,EAGlC", + "names": ["perf", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "AC", "AS", "_", "warnACPolyfill", "reason", "printACPolyfillWarning", "shouldWarn", "TYPE", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "_constructing", "_Stack", "HeapCls", "__privateSet", "s", "__privateGet", "Stack", "__privateAdd", "LRUCache", "#max", "#maxSize", "#dispose", "#disposeAfter", "#fetchMethod", "#memoMethod", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "key", "ttls", "starts", "#setItemTTL", "start", "t", "#delete", "#updateItemAge", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "getOptions", "value", "thisp", "deleted", "entry", "remain", "arr", "setOptions", "oldVal", "oldValue", "dt", "task", "val", "free", "head", "hasOptions", "peekOptions", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "fetchFail", "bf", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "forceRefresh", "stale", "isStale", "staleVal", "memoOptions", "vv", "fetching", "#connect", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/esm/package.json b/node_modules/lru-cache/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/lru-cache/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json new file mode 100644 index 0000000..e19abec --- /dev/null +++ b/node_modules/lru-cache/package.json @@ -0,0 +1,118 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "10.3.1", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "sideEffects": false, + "scripts": { + "build": "npm run prepare", + "prepare": "tshy && bash fixup.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write .", + "typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts", + "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", + "prebenchmark": "npm run prepare", + "benchmark": "make -C benchmark", + "preprofile": "npm run prepare", + "profile": "make -C benchmark profile" + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "tshy": { + "exports": { + ".": "./src/index.ts", + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + } + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "@types/node": "^20.2.5", + "@types/tap": "^15.0.6", + "benchmark": "^2.1.4", + "esbuild": "^0.17.11", + "eslint-config-prettier": "^8.5.0", + "marked": "^4.2.12", + "mkdirp": "^2.1.5", + "prettier": "^2.6.2", + "tap": "^20.0.3", + "tshy": "^1.17.0", + "tslib": "^2.4.0", + "typedoc": "^0.25.3", + "typescript": "^5.2.2" + }, + "license": "ISC", + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "prettier": { + "semi": false, + "printWidth": 70, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "node-arg": [ + "--expose-gc" + ], + "plugin": [ + "@tapjs/clock" + ] + }, + "exports": { + ".": { + "import": { + "source": "./src/index.ts", + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "source": "./src/index.ts", + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "type": "module", + "module": "./dist/esm/index.js" +} diff --git a/node_modules/luxon/LICENSE.md b/node_modules/luxon/LICENSE.md new file mode 100644 index 0000000..2d560a6 --- /dev/null +++ b/node_modules/luxon/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2019 JS Foundation and other 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. diff --git a/node_modules/luxon/README.md b/node_modules/luxon/README.md new file mode 100644 index 0000000..3fcacd7 --- /dev/null +++ b/node_modules/luxon/README.md @@ -0,0 +1,55 @@ +# Luxon + +[![MIT License][license-image]][license] [![Build Status][github-action-image]][github-action-url] [![NPM version][npm-version-image]][npm-url] [![Coverage Status][test-coverage-image]][test-coverage-url] [![PRs welcome][contributing-image]][contributing-url] + +Luxon is a library for working with dates and times in JavaScript. + +```js +DateTime.now().setZone("America/New_York").minus({ weeks: 1 }).endOf("day").toISO(); +``` + +## Upgrading to 3.0 + +[Guide](https://moment.github.io/luxon/#upgrading) + +## Features + * DateTime, Duration, and Interval types. + * Immutable, chainable, unambiguous API. + * Parsing and formatting for common and custom formats. + * Native time zone and Intl support (no locale or tz files). + +## Download/install + +[Download/install instructions](https://moment.github.io/luxon/#/install) + +## Documentation + +* [General documentation](https://moment.github.io/luxon/#/?id=luxon) +* [API docs](https://moment.github.io/luxon/api-docs/index.html) +* [Quick tour](https://moment.github.io/luxon/#/tour) +* [For Moment users](https://moment.github.io/luxon/#/moment) +* [Why does Luxon exist?](https://moment.github.io/luxon/#/why) +* [A quick demo](https://moment.github.io/luxon/demo/global.html) + +## Development + +See [contributing](CONTRIBUTING.md). + +![Phasers to stun][phasers-image] + +[license-image]: https://img.shields.io/badge/license-MIT-blue.svg +[license]: LICENSE.md + +[github-action-image]: https://github.com/moment/luxon/actions/workflows/test.yml/badge.svg +[github-action-url]: https://github.com/moment/luxon/actions/workflows/test.yml + +[npm-url]: https://npmjs.org/package/luxon +[npm-version-image]: https://badge.fury.io/js/luxon.svg + +[test-coverage-url]: https://codecov.io/gh/moment/luxon +[test-coverage-image]: https://codecov.io/gh/moment/luxon/branch/master/graph/badge.svg + +[contributing-url]: https://github.com/moment/luxon/blob/master/CONTRIBUTING.md +[contributing-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg + +[phasers-image]: https://img.shields.io/badge/phasers-stun-brightgreen.svg diff --git a/node_modules/luxon/build/amd/luxon.js b/node_modules/luxon/build/amd/luxon.js new file mode 100644 index 0000000..1c3b9d1 --- /dev/null +++ b/node_modules/luxon/build/amd/luxon.js @@ -0,0 +1,8311 @@ +define(['exports'], (function (exports) { 'use strict'; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } + function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + + // these aren't really private, but nor are they really useful to document + /** + * @private + */ + var LuxonError = /*#__PURE__*/function (_Error) { + _inheritsLoose(LuxonError, _Error); + function LuxonError() { + return _Error.apply(this, arguments) || this; + } + return LuxonError; + }( /*#__PURE__*/_wrapNativeSuper(Error)); + /** + * @private + */ + var InvalidDateTimeError = /*#__PURE__*/function (_LuxonError) { + _inheritsLoose(InvalidDateTimeError, _LuxonError); + function InvalidDateTimeError(reason) { + return _LuxonError.call(this, "Invalid DateTime: " + reason.toMessage()) || this; + } + return InvalidDateTimeError; + }(LuxonError); + + /** + * @private + */ + var InvalidIntervalError = /*#__PURE__*/function (_LuxonError2) { + _inheritsLoose(InvalidIntervalError, _LuxonError2); + function InvalidIntervalError(reason) { + return _LuxonError2.call(this, "Invalid Interval: " + reason.toMessage()) || this; + } + return InvalidIntervalError; + }(LuxonError); + + /** + * @private + */ + var InvalidDurationError = /*#__PURE__*/function (_LuxonError3) { + _inheritsLoose(InvalidDurationError, _LuxonError3); + function InvalidDurationError(reason) { + return _LuxonError3.call(this, "Invalid Duration: " + reason.toMessage()) || this; + } + return InvalidDurationError; + }(LuxonError); + + /** + * @private + */ + var ConflictingSpecificationError = /*#__PURE__*/function (_LuxonError4) { + _inheritsLoose(ConflictingSpecificationError, _LuxonError4); + function ConflictingSpecificationError() { + return _LuxonError4.apply(this, arguments) || this; + } + return ConflictingSpecificationError; + }(LuxonError); + + /** + * @private + */ + var InvalidUnitError = /*#__PURE__*/function (_LuxonError5) { + _inheritsLoose(InvalidUnitError, _LuxonError5); + function InvalidUnitError(unit) { + return _LuxonError5.call(this, "Invalid unit " + unit) || this; + } + return InvalidUnitError; + }(LuxonError); + + /** + * @private + */ + var InvalidArgumentError = /*#__PURE__*/function (_LuxonError6) { + _inheritsLoose(InvalidArgumentError, _LuxonError6); + function InvalidArgumentError() { + return _LuxonError6.apply(this, arguments) || this; + } + return InvalidArgumentError; + }(LuxonError); + + /** + * @private + */ + var ZoneIsAbstractError = /*#__PURE__*/function (_LuxonError7) { + _inheritsLoose(ZoneIsAbstractError, _LuxonError7); + function ZoneIsAbstractError() { + return _LuxonError7.call(this, "Zone is an abstract class") || this; + } + return ZoneIsAbstractError; + }(LuxonError); + + /** + * @private + */ + + var n = "numeric", + s = "short", + l = "long"; + var DATE_SHORT = { + year: n, + month: n, + day: n + }; + var DATE_MED = { + year: n, + month: s, + day: n + }; + var DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s + }; + var DATE_FULL = { + year: n, + month: l, + day: n + }; + var DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l + }; + var TIME_SIMPLE = { + hour: n, + minute: n + }; + var TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n + }; + var TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + var TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s + }; + var TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l + }; + var DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n + }; + var DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n + }; + var DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n + }; + var DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s + }; + var DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l + }; + var DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + + /** + * @interface + */ + var Zone = /*#__PURE__*/function () { + function Zone() {} + var _proto = Zone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */; + _createClass(Zone, [{ + key: "type", + get: + /** + * The type of zone + * @abstract + * @type {string} + */ + function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + }, { + key: "name", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "ianaName", + get: function get() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "isValid", + get: function get() { + throw new ZoneIsAbstractError(); + } + }]); + return Zone; + }(); + + var singleton$1 = null; + + /** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ + var SystemZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(SystemZone, _Zone); + function SystemZone() { + return _Zone.apply(this, arguments) || this; + } + var _proto = SystemZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/; + _createClass(SystemZone, [{ + key: "type", + get: /** @override **/ + function get() { + return "system"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "instance", + get: + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + function get() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + }]); + return SystemZone; + }(Zone); + + var dtfCache = {}; + function makeDTF(zone) { + if (!dtfCache[zone]) { + dtfCache[zone] = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zone, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + } + return dtfCache[zone]; + } + var typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 + }; + function hackyOffset(dtf, date) { + var formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + fMonth = parsed[1], + fDay = parsed[2], + fYear = parsed[3], + fadOrBc = parsed[4], + fHour = parsed[5], + fMinute = parsed[6], + fSecond = parsed[7]; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; + } + function partsOffset(dtf, date) { + var formatted = dtf.formatToParts(date); + var filled = []; + for (var i = 0; i < formatted.length; i++) { + var _formatted$i = formatted[i], + type = _formatted$i.type, + value = _formatted$i.value; + var pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; + } + var ianaZoneCache = {}; + /** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ + var IANAZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(IANAZone, _Zone); + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + IANAZone.create = function create(name) { + if (!ianaZoneCache[name]) { + ianaZoneCache[name] = new IANAZone(name); + } + return ianaZoneCache[name]; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */; + IANAZone.resetCache = function resetCache() { + ianaZoneCache = {}; + dtfCache = {}; + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated This method returns false for some valid IANA names. Use isValidZone instead. + * @return {boolean} + */; + IANAZone.isValidSpecifier = function isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */; + IANAZone.isValidZone = function isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + }; + function IANAZone(name) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.zoneName = name; + /** @private **/ + _this.valid = IANAZone.isValidZone(name); + return _this; + } + + /** @override **/ + var _proto = IANAZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale, this.name); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + var date = new Date(ts); + if (isNaN(date)) return NaN; + var dtf = makeDTF(this.name); + var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date), + year = _ref2[0], + month = _ref2[1], + day = _ref2[2], + adOrBc = _ref2[3], + hour = _ref2[4], + minute = _ref2[5], + second = _ref2[6]; + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + var adjustedHour = hour === 24 ? 0 : hour; + var asUTC = objToLocalTS({ + year: year, + month: month, + day: day, + hour: adjustedHour, + minute: minute, + second: second, + millisecond: 0 + }); + var asTS = +date; + var over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** @override **/; + _createClass(IANAZone, [{ + key: "type", + get: function get() { + return "iana"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return this.valid; + } + }]); + return IANAZone; + }(Zone); + + var _excluded = ["base"], + _excluded2 = ["padTo", "floor"]; + + // todo - remap caching + + var intlLFCache = {}; + function getCachedLF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; + } + var intlDTCache = {}; + function getCachedDTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlDTCache[key]; + if (!dtf) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache[key] = dtf; + } + return dtf; + } + var intlNumCache = {}; + function getCachedINF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var inf = intlNumCache[key]; + if (!inf) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache[key] = inf; + } + return inf; + } + var intlRelCache = {}; + function getCachedRTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var _opts = opts; + _opts.base; + var cacheKeyOpts = _objectWithoutPropertiesLoose(_opts, _excluded); // exclude `base` from the options + var key = JSON.stringify([locString, cacheKeyOpts]); + var inf = intlRelCache[key]; + if (!inf) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache[key] = inf; + } + return inf; + } + var sysLocaleCache = null; + function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } + } + var weekInfoCache = {}; + function getCachedWeekInfo(locString) { + var data = weekInfoCache[locString]; + if (!data) { + var locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + weekInfoCache[locString] = data; + } + return data; + } + function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + var xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + var uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + var options; + var selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + var smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + var _options = options, + numberingSystem = _options.numberingSystem, + calendar = _options.calendar; + return [selectedStr, numberingSystem, calendar]; + } + } + function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += "-ca-" + outputCalendar; + } + if (numberingSystem) { + localeStr += "-nu-" + numberingSystem; + } + return localeStr; + } else { + return localeStr; + } + } + function mapMonths(f) { + var ms = []; + for (var i = 1; i <= 12; i++) { + var dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; + } + function mapWeekdays(f) { + var ms = []; + for (var i = 1; i <= 7; i++) { + var dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; + } + function listStuff(loc, length, englishFn, intlFn) { + var mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } + } + function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn"; + } + } + + /** + * @private + */ + var PolyNumberFormatter = /*#__PURE__*/function () { + function PolyNumberFormatter(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + opts.padTo; + opts.floor; + var otherOpts = _objectWithoutPropertiesLoose(opts, _excluded2); + if (!forceSimple || Object.keys(otherOpts).length > 0) { + var intlOpts = _extends({ + useGrouping: false + }, opts); + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + var _proto = PolyNumberFormatter.prototype; + _proto.format = function format(i) { + if (this.inf) { + var fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + var _fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(_fixed, this.padTo); + } + }; + return PolyNumberFormatter; + }(); + /** + * @private + */ + var PolyDateFormatter = /*#__PURE__*/function () { + function PolyDateFormatter(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + var z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + var gmtOffset = -1 * (dt.offset / 60); + var offsetZ = gmtOffset >= 0 ? "Etc/GMT+" + gmtOffset : "Etc/GMT" + gmtOffset; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + var intlOpts = _extends({}, this.opts); + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + var _proto2 = PolyDateFormatter.prototype; + _proto2.format = function format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(function (_ref) { + var value = _ref.value; + return value; + }).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + }; + _proto2.formatToParts = function formatToParts() { + var _this = this; + var parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(function (part) { + if (part.type === "timeZoneName") { + var offsetName = _this.originalZone.offsetName(_this.dt.ts, { + locale: _this.dt.locale, + format: _this.opts.timeZoneName + }); + return _extends({}, part, { + value: offsetName + }); + } else { + return part; + } + }); + } + return parts; + }; + _proto2.resolvedOptions = function resolvedOptions() { + return this.dtf.resolvedOptions(); + }; + return PolyDateFormatter; + }(); + /** + * @private + */ + var PolyRelFormatter = /*#__PURE__*/function () { + function PolyRelFormatter(intl, isEnglish, opts) { + this.opts = _extends({ + style: "long" + }, opts); + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + var _proto3 = PolyRelFormatter.prototype; + _proto3.format = function format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + }; + _proto3.formatToParts = function formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + }; + return PolyRelFormatter; + }(); + var fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] + }; + + /** + * @private + */ + var Locale = /*#__PURE__*/function () { + Locale.fromOpts = function fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + }; + Locale.create = function create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN) { + if (defaultToEN === void 0) { + defaultToEN = false; + } + var specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human readable strings but annoying for parsing/formatting known formats + var localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + var numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + var outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + var weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + }; + Locale.resetCache = function resetCache() { + sysLocaleCache = null; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; + }; + Locale.fromObject = function fromObject(_temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + locale = _ref2.locale, + numberingSystem = _ref2.numberingSystem, + outputCalendar = _ref2.outputCalendar, + weekSettings = _ref2.weekSettings; + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + }; + function Locale(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + var _parseLocaleString = parseLocaleString(locale), + parsedLocale = _parseLocaleString[0], + parsedNumberingSystem = _parseLocaleString[1], + parsedOutputCalendar = _parseLocaleString[2]; + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + var _proto4 = Locale.prototype; + _proto4.listingMode = function listingMode() { + var isActuallyEn = this.isEnglish(); + var hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + }; + _proto4.clone = function clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + }; + _proto4.redefaultToEN = function redefaultToEN(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: true + })); + }; + _proto4.redefaultToSystem = function redefaultToSystem(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: false + })); + }; + _proto4.months = function months$1(length, format) { + var _this2 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, months, function () { + var intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this2.monthsCache[formatStr][length]) { + _this2.monthsCache[formatStr][length] = mapMonths(function (dt) { + return _this2.extract(dt, intl, "month"); + }); + } + return _this2.monthsCache[formatStr][length]; + }); + }; + _proto4.weekdays = function weekdays$1(length, format) { + var _this3 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, weekdays, function () { + var intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this3.weekdaysCache[formatStr][length]) { + _this3.weekdaysCache[formatStr][length] = mapWeekdays(function (dt) { + return _this3.extract(dt, intl, "weekday"); + }); + } + return _this3.weekdaysCache[formatStr][length]; + }); + }; + _proto4.meridiems = function meridiems$1() { + var _this4 = this; + return listStuff(this, undefined, function () { + return meridiems; + }, function () { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!_this4.meridiemCache) { + var intl = { + hour: "numeric", + hourCycle: "h12" + }; + _this4.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(function (dt) { + return _this4.extract(dt, intl, "dayperiod"); + }); + } + return _this4.meridiemCache; + }); + }; + _proto4.eras = function eras$1(length) { + var _this5 = this; + return listStuff(this, length, eras, function () { + var intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!_this5.eraCache[length]) { + _this5.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(function (dt) { + return _this5.extract(dt, intl, "era"); + }); + } + return _this5.eraCache[length]; + }); + }; + _proto4.extract = function extract(dt, intlOpts, field) { + var df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(function (m) { + return m.type.toLowerCase() === field; + }); + return matching ? matching.value : null; + }; + _proto4.numberFormatter = function numberFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + }; + _proto4.dtFormatter = function dtFormatter(dt, intlOpts) { + if (intlOpts === void 0) { + intlOpts = {}; + } + return new PolyDateFormatter(dt, this.intl, intlOpts); + }; + _proto4.relFormatter = function relFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + }; + _proto4.listFormatter = function listFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return getCachedLF(this.intl, opts); + }; + _proto4.isEnglish = function isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us"); + }; + _proto4.getWeekSettings = function getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + }; + _proto4.getStartOfWeek = function getStartOfWeek() { + return this.getWeekSettings().firstDay; + }; + _proto4.getMinDaysInFirstWeek = function getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + }; + _proto4.getWeekendDays = function getWeekendDays() { + return this.getWeekSettings().weekend; + }; + _proto4.equals = function equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + }; + _createClass(Locale, [{ + key: "fastNumbers", + get: function get() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + }]); + return Locale; + }(); + + var singleton = null; + + /** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ + var FixedOffsetZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(FixedOffsetZone, _Zone); + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + FixedOffsetZone.instance = function instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */; + FixedOffsetZone.parseSpecifier = function parseSpecifier(s) { + if (s) { + var r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + }; + function FixedOffsetZone(offset) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.fixed = offset; + return _this; + } + + /** @override **/ + var _proto = FixedOffsetZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return this.name; + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.fixed, format); + } + + /** @override **/; + /** @override **/ + _proto.offset = function offset() { + return this.fixed; + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** @override **/; + _createClass(FixedOffsetZone, [{ + key: "type", + get: function get() { + return "fixed"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.fixed === 0 ? "UTC" : "UTC" + formatOffset(this.fixed, "narrow"); + } + }, { + key: "ianaName", + get: function get() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return "Etc/GMT" + formatOffset(-this.fixed, "narrow"); + } + } + }, { + key: "isUniversal", + get: function get() { + return true; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "utcInstance", + get: + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + function get() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + }]); + return FixedOffsetZone; + }(Zone); + + /** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ + var InvalidZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(InvalidZone, _Zone); + function InvalidZone(zoneName) { + var _this; + _this = _Zone.call(this) || this; + /** @private */ + _this.zoneName = zoneName; + return _this; + } + + /** @override **/ + var _proto = InvalidZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return null; + } + + /** @override **/; + _proto.formatOffset = function formatOffset() { + return ""; + } + + /** @override **/; + _proto.offset = function offset() { + return NaN; + } + + /** @override **/; + _proto.equals = function equals() { + return false; + } + + /** @override **/; + _createClass(InvalidZone, [{ + key: "type", + get: function get() { + return "invalid"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return false; + } + }]); + return InvalidZone; + }(Zone); + + /** + * @private + */ + function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + var lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } + } + + var now = function now() { + return Date.now(); + }, + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + + /** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ + var Settings = /*#__PURE__*/function () { + function Settings() {} + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + Settings.resetCaches = function resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + }; + _createClass(Settings, null, [{ + key: "now", + get: + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + function get() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */, + set: function set(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + }, { + key: "defaultZone", + get: + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + function get() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(zone) { + defaultZone = zone; + } + }, { + key: "defaultLocale", + get: function get() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultNumberingSystem", + get: function get() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultOutputCalendar", + get: function get() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + }, { + key: "defaultWeekSettings", + get: function get() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */, + set: function set(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + */ + }, { + key: "twoDigitCutoffYear", + get: function get() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */, + set: function set(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + }, { + key: "throwOnInvalid", + get: function get() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */, + set: function set(t) { + throwOnInvalid = t; + } + }]); + return Settings; + }(); + + var Invalid = /*#__PURE__*/function () { + function Invalid(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + var _proto = Invalid.prototype; + _proto.toMessage = function toMessage() { + if (this.explanation) { + return this.reason + ": " + this.explanation; + } else { + return this.reason; + } + }; + return Invalid; + }(); + + var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; + function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", "you specified " + value + " (of type " + typeof value + ") as a " + unit + ", which is invalid"); + } + function dayOfWeek(year, month, day) { + var d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + var js = d.getUTCDay(); + return js === 0 ? 7 : js; + } + function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; + } + function uncomputeOrdinal(year, ordinal) { + var table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(function (i) { + return i < ordinal; + }), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day: day + }; + } + function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; + } + + /** + * @private + */ + + function gregorianToWeek(gregObj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var year = gregObj.year, + month = gregObj.month, + day = gregObj.day, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + var weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return _extends({ + weekYear: weekYear, + weekNumber: weekNumber, + weekday: weekday + }, timeObject(gregObj)); + } + function weekToGregorian(weekData, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekYear = weekData.weekYear, + weekNumber = weekData.weekNumber, + weekday = weekData.weekday, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + var ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal.month, + day = _uncomputeOrdinal.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(weekData)); + } + function gregorianToOrdinal(gregData) { + var year = gregData.year, + month = gregData.month, + day = gregData.day; + var ordinal = computeOrdinal(year, month, day); + return _extends({ + year: year, + ordinal: ordinal + }, timeObject(gregData)); + } + function ordinalToGregorian(ordinalData) { + var year = ordinalData.year, + ordinal = ordinalData.ordinal; + var _uncomputeOrdinal2 = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal2.month, + day = _uncomputeOrdinal2.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(ordinalData)); + } + + /** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ + function usesLocalWeekValues(obj, loc) { + var hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + var hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } + } + function hasInvalidWeekData(obj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; + } + function hasInvalidOrdinalData(obj) { + var validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; + } + function hasInvalidGregorianData(obj) { + var validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; + } + function hasInvalidTimeData(obj) { + var hour = obj.hour, + minute = obj.minute, + second = obj.second, + millisecond = obj.millisecond; + var validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; + } + + /** + * @private + */ + + // TYPES + + function isUndefined(o) { + return typeof o === "undefined"; + } + function isNumber(o) { + return typeof o === "number"; + } + function isInteger(o) { + return typeof o === "number" && o % 1 === 0; + } + function isString(o) { + return typeof o === "string"; + } + function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; + } + + // CAPABILITIES + + function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } + } + function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } + } + + // OBJECTS AND ARRAYS + + function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; + } + function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce(function (best, next) { + var pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; + } + function pick(obj, keys) { + return keys.reduce(function (a, k) { + a[k] = obj[k]; + return a; + }, {}); + } + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function (v) { + return !integerBetween(v, 1, 7); + })) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } + } + + // NUMBERS AND STRINGS + + function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; + } + + // x % n but takes the sign of n instead of x + function floorMod(x, n) { + return x - n * Math.floor(x / n); + } + function padStart(input, n) { + if (n === void 0) { + n = 2; + } + var isNeg = input < 0; + var padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; + } + function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } + } + function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } + } + function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + var f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } + } + function roundTo(number, digits, towardZero) { + if (towardZero === void 0) { + towardZero = false; + } + var factor = Math.pow(10, digits), + rounder = towardZero ? Math.trunc : Math.round; + return rounder(number * factor) / factor; + } + + // DATE BASICS + + function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + } + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + function daysInMonth(year, month) { + var modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } + } + + // convert a calendar object to a local timestamp (epoch, but with the offset baked in) + function objToLocalTS(obj) { + var d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; + } + + // adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js + function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + var fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; + } + function weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + var weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; + } + function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; + } + + // PARSING + + function parseZoneInfo(ts, offsetFormat, locale, timeZone) { + if (timeZone === void 0) { + timeZone = null; + } + var date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + var modified = _extends({ + timeZoneName: offsetFormat + }, intlOpts); + var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function (m) { + return m.type.toLowerCase() === "timezonename"; + }); + return parsed ? parsed.value : null; + } + + // signedOffset('-5', '30') -> -330 + function signedOffset(offHourStr, offMinuteStr) { + var offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + var offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; + } + + // COERCION + + function asNumber(value) { + var numericValue = Number(value); + if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue)) throw new InvalidArgumentError("Invalid unit value " + value); + return numericValue; + } + function normalizeObject(obj, normalizer) { + var normalized = {}; + for (var u in obj) { + if (hasOwnProperty(obj, u)) { + var v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; + } + function formatOffset(offset, format) { + var hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2); + case "narrow": + return "" + sign + hours + (minutes > 0 ? ":" + minutes : ""); + case "techie": + return "" + sign + padStart(hours, 2) + padStart(minutes, 2); + default: + throw new RangeError("Value format " + format + " is out of range for property format"); + } + } + function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); + } + + /** + * @private + */ + + var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + function months(length) { + switch (length) { + case "narrow": + return [].concat(monthsNarrow); + case "short": + return [].concat(monthsShort); + case "long": + return [].concat(monthsLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } + } + var weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; + var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; + var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; + function weekdays(length) { + switch (length) { + case "narrow": + return [].concat(weekdaysNarrow); + case "short": + return [].concat(weekdaysShort); + case "long": + return [].concat(weekdaysLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } + } + var meridiems = ["AM", "PM"]; + var erasLong = ["Before Christ", "Anno Domini"]; + var erasShort = ["BC", "AD"]; + var erasNarrow = ["B", "A"]; + function eras(length) { + switch (length) { + case "narrow": + return [].concat(erasNarrow); + case "short": + return [].concat(erasShort); + case "long": + return [].concat(erasLong); + default: + return null; + } + } + function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; + } + function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; + } + function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; + } + function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; + } + function formatRelativeTime(unit, count, numeric, narrow) { + if (numeric === void 0) { + numeric = "always"; + } + if (narrow === void 0) { + narrow = false; + } + var units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + var lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + var isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : "next " + units[unit][0]; + case -1: + return isDay ? "yesterday" : "last " + units[unit][0]; + case 0: + return isDay ? "today" : "this " + units[unit][0]; + } + } + + var isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? fmtValue + " " + fmtUnit + " ago" : "in " + fmtValue + " " + fmtUnit; + } + + function stringifyTokens(splits, tokenToString) { + var s = ""; + for (var _iterator = _createForOfIteratorHelperLoose(splits), _step; !(_step = _iterator()).done;) { + var token = _step.value; + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; + } + var _macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS + }; + + /** + * @private + */ + var Formatter = /*#__PURE__*/function () { + Formatter.create = function create(locale, opts) { + if (opts === void 0) { + opts = {}; + } + return new Formatter(locale, opts); + }; + Formatter.parseFormat = function parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + var current = null, + currentFull = "", + bracketed = false; + var splits = []; + for (var i = 0; i < fmt.length; i++) { + var c = fmt.charAt(i); + if (c === "'") { + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + }; + Formatter.macroTokenToFormatOpts = function macroTokenToFormatOpts(token) { + return _macroTokenToFormatOpts[token]; + }; + function Formatter(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + var _proto = Formatter.prototype; + _proto.formatWithSystemDefault = function formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + var df = this.systemLoc.dtFormatter(dt, _extends({}, this.opts, opts)); + return df.format(); + }; + _proto.dtFormatter = function dtFormatter(dt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.loc.dtFormatter(dt, _extends({}, this.opts, opts)); + }; + _proto.formatDateTime = function formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + }; + _proto.formatDateTimeParts = function formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + }; + _proto.formatInterval = function formatInterval(interval, opts) { + var df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + }; + _proto.resolvedOptions = function resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + }; + _proto.num = function num(n, p) { + if (p === void 0) { + p = 0; + } + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + var opts = _extends({}, this.opts); + if (p > 0) { + opts.padTo = p; + } + return this.loc.numberFormatter(opts).format(n); + }; + _proto.formatDateTimeFromString = function formatDateTimeFromString(dt, fmt) { + var _this = this; + var knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = function string(opts, extract) { + return _this.loc.extract(dt, opts, extract); + }, + formatOffset = function formatOffset(opts) { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = function meridiem() { + return knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"); + }, + month = function month(length, standalone) { + return knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"); + }, + weekday = function weekday(length, standalone) { + return knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"); + }, + maybeMacro = function maybeMacro(token) { + var formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return _this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = function era(length) { + return knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"); + }, + tokenToString = function tokenToString(token) { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return _this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return _this.num(dt.millisecond, 3); + // seconds + case "s": + return _this.num(dt.second); + case "ss": + return _this.num(dt.second, 2); + // fractional seconds + case "uu": + return _this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return _this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return _this.num(dt.minute); + case "mm": + return _this.num(dt.minute, 2); + // hours + case "h": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return _this.num(dt.hour); + case "HH": + return _this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: _this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: _this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: _this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: _this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: _this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : _this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : _this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return _this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return _this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : _this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : _this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : _this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : _this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : _this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return _this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return _this.num(dt.weekYear, 4); + case "W": + return _this.num(dt.weekNumber); + case "WW": + return _this.num(dt.weekNumber, 2); + case "n": + return _this.num(dt.localWeekNumber); + case "nn": + return _this.num(dt.localWeekNumber, 2); + case "ii": + return _this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return _this.num(dt.localWeekYear, 4); + case "o": + return _this.num(dt.ordinal); + case "ooo": + return _this.num(dt.ordinal, 3); + case "q": + // like 1 + return _this.num(dt.quarter); + case "qq": + // like 01 + return _this.num(dt.quarter, 2); + case "X": + return _this.num(Math.floor(dt.ts / 1000)); + case "x": + return _this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + }; + _proto.formatDurationFromString = function formatDurationFromString(dur, fmt) { + var _this2 = this; + var tokenToField = function tokenToField(token) { + switch (token[0]) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + return "hour"; + case "d": + return "day"; + case "w": + return "week"; + case "M": + return "month"; + case "y": + return "year"; + default: + return null; + } + }, + tokenToString = function tokenToString(lildur) { + return function (token) { + var mapped = tokenToField(token); + if (mapped) { + return _this2.num(lildur.get(mapped), token.length); + } else { + return token; + } + }; + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce(function (found, _ref) { + var literal = _ref.literal, + val = _ref.val; + return literal ? found : found.concat(val); + }, []), + collapsed = dur.shiftTo.apply(dur, realTokens.map(tokenToField).filter(function (t) { + return t; + })); + return stringifyTokens(tokens, tokenToString(collapsed)); + }; + return Formatter; + }(); + + /* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + + var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; + function combineRegexes() { + for (var _len = arguments.length, regexes = new Array(_len), _key = 0; _key < _len; _key++) { + regexes[_key] = arguments[_key]; + } + var full = regexes.reduce(function (f, r) { + return f + r.source; + }, ""); + return RegExp("^" + full + "$"); + } + function combineExtractors() { + for (var _len2 = arguments.length, extractors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + extractors[_key2] = arguments[_key2]; + } + return function (m) { + return extractors.reduce(function (_ref, ex) { + var mergedVals = _ref[0], + mergedZone = _ref[1], + cursor = _ref[2]; + var _ex = ex(m, cursor), + val = _ex[0], + zone = _ex[1], + next = _ex[2]; + return [_extends({}, mergedVals, val), zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); + }; + } + function parse(s) { + if (s == null) { + return [null, null]; + } + for (var _len3 = arguments.length, patterns = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + patterns[_key3 - 1] = arguments[_key3]; + } + for (var _i = 0, _patterns = patterns; _i < _patterns.length; _i++) { + var _patterns$_i = _patterns[_i], + regex = _patterns$_i[0], + extractor = _patterns$_i[1]; + var m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; + } + function simpleParse() { + for (var _len4 = arguments.length, keys = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + keys[_key4] = arguments[_key4]; + } + return function (match, cursor) { + var ret = {}; + var i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; + } + + // ISO and SQL parsing + var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/; + var isoExtendedZone = "(?:" + offsetRegex.source + "?(?:\\[(" + ianaRegex.source + ")\\])?)?"; + var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; + var isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + isoExtendedZone); + var isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?"); + var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; + var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; + var isoOrdinalRegex = /(\d{4})-?(\d{3})/; + var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); + var extractISOOrdinalData = simpleParse("year", "ordinal"); + var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one + var sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?"); + var sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?"); + function int(match, pos, fallback) { + var m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); + } + function extractISOYmd(match, cursor) { + var item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; + } + function extractISOTime(match, cursor) { + var item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; + } + function extractISOOffset(match, cursor) { + var local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; + } + function extractIANAZone(match, cursor) { + var zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; + } + + // ISO time parsing + + var isoTimeOnly = RegExp("^T?" + isoTimeBaseRegex.source + "$"); + + // ISO duration parsing + + var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; + function extractISODuration(match) { + var s = match[0], + yearStr = match[1], + monthStr = match[2], + weekStr = match[3], + dayStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + millisecondsStr = match[8]; + var hasNegativePrefix = s[0] === "-"; + var negativeSeconds = secondStr && secondStr[0] === "-"; + var maybeNegate = function maybeNegate(num, force) { + if (force === void 0) { + force = false; + } + return num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + }; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; + } + + // These are a little braindead. EDT *should* tell us that we're in, say, America/New_York + // and not just that we're in -240 *right now*. But since I don't think these are used that often + // I'm just going to ignore that + var obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; + } + + // RFC 2822/5322 + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; + function extractRFC2822(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + obsOffset = match[8], + milOffset = match[9], + offHourStr = match[10], + offMinuteStr = match[11], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + var offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; + } + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); + } + + // http date + + var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; + function extractRFC1123Or850(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + function extractASCII(match) { + var weekdayStr = match[1], + monthStr = match[2], + dayStr = match[3], + hourStr = match[4], + minuteStr = match[5], + secondStr = match[6], + yearStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); + var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); + var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); + var isoTimeCombinedRegex = combineRegexes(isoTimeRegex); + var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + + /* + * @private + */ + + function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); + } + function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); + } + function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); + } + function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); + } + var extractISOTimeOnly = combineExtractors(extractISOTime); + function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); + } + var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); + var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); + var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); + } + + var INVALID$2 = "Invalid Duration"; + + // unit conversion constants + var lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix), + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix); + + // units ordered by size + var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; + var reverseUnits = orderedUnits$1.slice(0).reverse(); + + // clone really means "create another instance just like this one, but with these changes" + function clone$1(dur, alts, clear) { + if (clear === void 0) { + clear = false; + } + // deep merge for vals + var conf = { + values: clear ? alts.values : _extends({}, dur.values, alts.values || {}), + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); + } + function durationToMillis(matrix, vals) { + var _vals$milliseconds; + var sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (var _iterator = _createForOfIteratorHelperLoose(reverseUnits.slice(1)), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; + } + + // NB: mutates parameters + function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + var factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var previousVal = vals[previous] * factor; + var conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + var rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); + } + + // Remove all properties with a value of 0 from an object + function removeZeroes(vals) { + var newVals = {}; + for (var _i = 0, _Object$entries = Object.entries(vals); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _Object$entries[_i], + key = _Object$entries$_i[0], + value = _Object$entries$_i[1]; + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; + } + + /** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ + var Duration = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Duration(config) { + var accurate = config.conversionAccuracy === "longterm" || false; + var matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + Duration.fromMillis = function fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */; + Duration.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got " + (obj === null ? "null" : typeof obj)); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */; + Duration.fromDurationLike = function fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError("Unknown duration argument " + durationLike + " of type " + typeof durationLike); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */; + Duration.fromISO = function fromISO(text, opts) { + var _parseISODuration = parseISODuration(text), + parsed = _parseISODuration[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */; + Duration.fromISOTime = function fromISOTime(text, opts) { + var _parseISOTimeOnly = parseISOTimeOnly(text), + parsed = _parseISOTimeOnly[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */; + Duration.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid: invalid + }); + } + } + + /** + * @private + */; + Duration.normalizeUnit = function normalizeUnit(unit) { + var normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Duration.isDuration = function isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */; + var _proto = Duration.prototype; + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @return {string} + */ + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + var fmtOpts = _extends({}, opts, { + floor: opts.round !== false && opts.floor !== false + }); + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @example + * ```js + * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' + * ``` + */; + _proto.toHuman = function toHuman(opts) { + var _this = this; + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return INVALID$2; + var l = orderedUnits$1.map(function (unit) { + var val = _this.values[unit]; + if (isUndefined(val)) { + return null; + } + return _this.loc.numberFormatter(_extends({ + style: "unit", + unitDisplay: "long" + }, opts, { + unit: unit.slice(0, -1) + })).format(val); + }).filter(function (n) { + return n; + }); + return this.loc.listFormatter(_extends({ + type: "conjunction", + style: opts.listStyle || "narrow" + }, opts)).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */; + _proto.toObject = function toObject() { + if (!this.isValid) return {}; + return _extends({}, this.values); + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */; + _proto.toISO = function toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + var s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return null; + var millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = _extends({ + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended" + }, opts, { + includeOffset: false + }); + var dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */; + _proto.toString = function toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Duration { values: " + JSON.stringify(this.values) + " }"; + } else { + return "Duration { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */; + _proto.toMillis = function toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration), + result = {}; + for (var _i2 = 0, _orderedUnits = orderedUnits$1; _i2 < _orderedUnits.length; _i2++) { + var k = _orderedUnits[_i2]; + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */; + _proto.mapUnits = function mapUnits(fn) { + if (!this.isValid) return this; + var result = {}; + for (var _i3 = 0, _Object$keys = Object.keys(this.values); _i3 < _Object$keys.length; _i3++) { + var k = _Object$keys[_i3]; + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */; + _proto.get = function get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var mixed = _extends({}, this.values, normalizeObject(values, Duration.normalizeUnit)); + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */; + _proto.reconfigure = function reconfigure(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + locale = _ref.locale, + numberingSystem = _ref.numberingSystem, + conversionAccuracy = _ref.conversionAccuracy, + matrix = _ref.matrix; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem + }); + var opts = { + loc: loc, + matrix: matrix, + conversionAccuracy: conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */; + _proto.as = function as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */; + _proto.normalize = function normalize() { + if (!this.isValid) return this; + var vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */; + _proto.rescale = function rescale() { + if (!this.isValid) return this; + var vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */; + _proto.shiftTo = function shiftTo() { + for (var _len = arguments.length, units = new Array(_len), _key = 0; _key < _len; _key++) { + units[_key] = arguments[_key]; + } + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(function (u) { + return Duration.normalizeUnit(u); + }); + var built = {}, + accumulated = {}, + vals = this.toObject(); + var lastUnit; + for (var _i4 = 0, _orderedUnits2 = orderedUnits$1; _i4 < _orderedUnits2.length; _i4++) { + var k = _orderedUnits2[_i4]; + if (units.indexOf(k) >= 0) { + lastUnit = k; + var own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (var ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + var i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (var key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */; + _proto.shiftToAll = function shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */; + _proto.negate = function negate() { + if (!this.isValid) return this; + var negated = {}; + for (var _i5 = 0, _Object$keys2 = Object.keys(this.values); _i5 < _Object$keys2.length; _i5++) { + var k = _Object$keys2[_i5]; + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Get the years. + * @type {number} + */; + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (var _i6 = 0, _orderedUnits3 = orderedUnits$1; _i6 < _orderedUnits3.length; _i6++) { + var u = _orderedUnits3[_i6]; + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + }; + _createClass(Duration, [{ + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + }, { + key: "years", + get: function get() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + }, { + key: "quarters", + get: function get() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + }, { + key: "months", + get: function get() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + }, { + key: "weeks", + get: function get() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + }, { + key: "days", + get: function get() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + }, { + key: "hours", + get: function get() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + }, { + key: "minutes", + get: function get() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + }, { + key: "seconds", + get: function get() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + }, { + key: "milliseconds", + get: function get() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Duration; + }(Symbol.for("nodejs.util.inspect.custom")); + + var INVALID$1 = "Invalid Interval"; + + // checks if the start is equal to or before the end + function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", "The end of an interval must be after its start, but you had start=" + start.toISO() + " and end=" + end.toISO()); + } else { + return null; + } + } + + /** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ + var Interval = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Interval(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + Interval.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid: invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */; + Interval.fromDateTimes = function fromDateTimes(start, end) { + var builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + var validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.after = function after(start, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.before = function before(end, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */; + Interval.fromISO = function fromISO(text, opts) { + var _split = (text || "").split("/", 2), + s = _split[0], + e = _split[1]; + if (s && e) { + var start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + var end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + var dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + var _dur = Duration.fromISO(s, opts); + if (_dur.isValid) { + return Interval.before(end, _dur); + } + } + } + return Interval.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Interval.isInterval = function isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */; + var _proto = Interval.prototype; + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + _proto.length = function length(unit) { + if (unit === void 0) { + unit = "milliseconds"; + } + return this.isValid ? this.toDuration.apply(this, [unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */; + _proto.count = function count(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (!this.isValid) return NaN; + var start = this.start.startOf(unit, opts); + var end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */; + _proto.hasSame = function hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */; + _proto.isEmpty = function isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isAfter = function isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isBefore = function isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.contains = function contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */; + _proto.set = function set(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + start = _ref.start, + end = _ref.end; + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */; + _proto.splitAt = function splitAt() { + var _this = this; + if (!this.isValid) return []; + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + var sorted = dateTimes.map(friendlyDateTime).filter(function (d) { + return _this.contains(d); + }).sort(function (a, b) { + return a.toMillis() - b.toMillis(); + }), + results = []; + var s = this.s, + i = 0; + while (s < this.e) { + var added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */; + _proto.splitBy = function splitBy(duration) { + var dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + var s = this.s, + idx = 1, + next; + var results = []; + while (s < this.e) { + var added = this.start.plus(dur.mapUnits(function (x) { + return x * idx; + })); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */; + _proto.divideEqually = function divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */; + _proto.overlaps = function overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsStart = function abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsEnd = function abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Return whether this Interval engulfs the start and end of the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.engulfs = function engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */; + _proto.intersection = function intersection(other) { + if (!this.isValid) return this; + var s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */; + _proto.union = function union(other) { + if (!this.isValid) return this; + var s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into a equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.merge = function merge(intervals) { + var _intervals$sort$reduc = intervals.sort(function (a, b) { + return a.s - b.s; + }).reduce(function (_ref2, item) { + var sofar = _ref2[0], + current = _ref2[1]; + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]), + found = _intervals$sort$reduc[0], + final = _intervals$sort$reduc[1]; + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.xor = function xor(intervals) { + var _Array$prototype; + var start = null, + currentCount = 0; + var results = [], + ends = intervals.map(function (i) { + return [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]; + }), + flattened = (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, ends), + arr = flattened.sort(function (a, b) { + return a.time - b.time; + }); + for (var _iterator = _createForOfIteratorHelperLoose(arr), _step; !(_step = _iterator()).done;) { + var i = _step.value; + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */; + _proto.difference = function difference() { + var _this2 = this; + for (var _len2 = arguments.length, intervals = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + intervals[_key2] = arguments[_key2]; + } + return Interval.xor([this].concat(intervals)).map(function (i) { + return _this2.intersection(i); + }).filter(function (i) { + return i && !i.isEmpty(); + }); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */; + _proto.toString = function toString() { + if (!this.isValid) return INVALID$1; + return "[" + this.s.toISO() + " \u2013 " + this.e.toISO() + ")"; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Interval { start: " + this.s.toISO() + ", end: " + this.e.toISO() + " }"; + } else { + return "Interval { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISO = function toISO(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISO(opts) + "/" + this.e.toISO(opts); + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */; + _proto.toISODate = function toISODate() { + if (!this.isValid) return INVALID$1; + return this.s.toISODate() + "/" + this.e.toISODate(); + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISOTime(opts) + "/" + this.e.toISOTime(opts); + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */; + _proto.toFormat = function toFormat(dateFormat, _temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + _ref3$separator = _ref3.separator, + separator = _ref3$separator === void 0 ? " – " : _ref3$separator; + if (!this.isValid) return INVALID$1; + return "" + this.s.toFormat(dateFormat) + separator + this.e.toFormat(dateFormat); + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */; + _proto.toDuration = function toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */; + _proto.mapEndpoints = function mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + }; + _createClass(Interval, [{ + key: "start", + get: function get() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval + * @type {DateTime} + */ + }, { + key: "end", + get: function get() { + return this.isValid ? this.e : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Interval; + }(Symbol.for("nodejs.util.inspect.custom")); + + /** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ + var Info = /*#__PURE__*/function () { + function Info() {} + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + Info.hasDST = function hasDST(zone) { + if (zone === void 0) { + zone = Settings.defaultZone; + } + var proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */; + Info.isValidIANAZone = function isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */; + Info.normalizeZone = function normalizeZone$1(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */; + Info.getStartOfWeek = function getStartOfWeek(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$locale = _ref.locale, + locale = _ref$locale === void 0 ? null : _ref$locale, + _ref$locObj = _ref.locObj, + locObj = _ref$locObj === void 0 ? null : _ref$locObj; + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */; + Info.getMinimumDaysInFirstWeek = function getMinimumDaysInFirstWeek(_temp2) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$locale = _ref2.locale, + locale = _ref2$locale === void 0 ? null : _ref2$locale, + _ref2$locObj = _ref2.locObj, + locObj = _ref2$locObj === void 0 ? null : _ref2$locObj; + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */; + Info.getWeekendWeekdays = function getWeekendWeekdays(_temp3) { + var _ref3 = _temp3 === void 0 ? {} : _temp3, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? null : _ref3$locale, + _ref3$locObj = _ref3.locObj, + locObj = _ref3$locObj === void 0 ? null : _ref3$locObj; + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */; + Info.months = function months(length, _temp4) { + if (length === void 0) { + length = "long"; + } + var _ref4 = _temp4 === void 0 ? {} : _temp4, + _ref4$locale = _ref4.locale, + locale = _ref4$locale === void 0 ? null : _ref4$locale, + _ref4$numberingSystem = _ref4.numberingSystem, + numberingSystem = _ref4$numberingSystem === void 0 ? null : _ref4$numberingSystem, + _ref4$locObj = _ref4.locObj, + locObj = _ref4$locObj === void 0 ? null : _ref4$locObj, + _ref4$outputCalendar = _ref4.outputCalendar, + outputCalendar = _ref4$outputCalendar === void 0 ? "gregory" : _ref4$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */; + Info.monthsFormat = function monthsFormat(length, _temp5) { + if (length === void 0) { + length = "long"; + } + var _ref5 = _temp5 === void 0 ? {} : _temp5, + _ref5$locale = _ref5.locale, + locale = _ref5$locale === void 0 ? null : _ref5$locale, + _ref5$numberingSystem = _ref5.numberingSystem, + numberingSystem = _ref5$numberingSystem === void 0 ? null : _ref5$numberingSystem, + _ref5$locObj = _ref5.locObj, + locObj = _ref5$locObj === void 0 ? null : _ref5$locObj, + _ref5$outputCalendar = _ref5.outputCalendar, + outputCalendar = _ref5$outputCalendar === void 0 ? "gregory" : _ref5$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */; + Info.weekdays = function weekdays(length, _temp6) { + if (length === void 0) { + length = "long"; + } + var _ref6 = _temp6 === void 0 ? {} : _temp6, + _ref6$locale = _ref6.locale, + locale = _ref6$locale === void 0 ? null : _ref6$locale, + _ref6$numberingSystem = _ref6.numberingSystem, + numberingSystem = _ref6$numberingSystem === void 0 ? null : _ref6$numberingSystem, + _ref6$locObj = _ref6.locObj, + locObj = _ref6$locObj === void 0 ? null : _ref6$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */; + Info.weekdaysFormat = function weekdaysFormat(length, _temp7) { + if (length === void 0) { + length = "long"; + } + var _ref7 = _temp7 === void 0 ? {} : _temp7, + _ref7$locale = _ref7.locale, + locale = _ref7$locale === void 0 ? null : _ref7$locale, + _ref7$numberingSystem = _ref7.numberingSystem, + numberingSystem = _ref7$numberingSystem === void 0 ? null : _ref7$numberingSystem, + _ref7$locObj = _ref7.locObj, + locObj = _ref7$locObj === void 0 ? null : _ref7$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */; + Info.meridiems = function meridiems(_temp8) { + var _ref8 = _temp8 === void 0 ? {} : _temp8, + _ref8$locale = _ref8.locale, + locale = _ref8$locale === void 0 ? null : _ref8$locale; + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */; + Info.eras = function eras(length, _temp9) { + if (length === void 0) { + length = "short"; + } + var _ref9 = _temp9 === void 0 ? {} : _temp9, + _ref9$locale = _ref9.locale, + locale = _ref9$locale === void 0 ? null : _ref9$locale; + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */; + Info.features = function features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + }; + return Info; + }(); + + function dayDiff(earlier, later) { + var utcDayStart = function utcDayStart(dt) { + return dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(); + }, + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); + } + function highOrderDiffs(cursor, later, units) { + var differs = [["years", function (a, b) { + return b.year - a.year; + }], ["quarters", function (a, b) { + return b.quarter - a.quarter + (b.year - a.year) * 4; + }], ["months", function (a, b) { + return b.month - a.month + (b.year - a.year) * 12; + }], ["weeks", function (a, b) { + var days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + var results = {}; + var earlier = cursor; + var lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (var _i = 0, _differs = differs; _i < _differs.length; _i++) { + var _differs$_i = _differs[_i], + unit = _differs$_i[0], + differ = _differs$_i[1]; + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; + } + function _diff (earlier, later, units, opts) { + var _highOrderDiffs = highOrderDiffs(earlier, later, units), + cursor = _highOrderDiffs[0], + results = _highOrderDiffs[1], + highWater = _highOrderDiffs[2], + lowestOrder = _highOrderDiffs[3]; + var remainingMillis = later - cursor; + var lowerOrderUnits = units.filter(function (u) { + return ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0; + }); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + var _cursor$plus; + highWater = cursor.plus((_cursor$plus = {}, _cursor$plus[lowestOrder] = 1, _cursor$plus)); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + var duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + var _Duration$fromMillis; + return (_Duration$fromMillis = Duration.fromMillis(remainingMillis, opts)).shiftTo.apply(_Duration$fromMillis, lowerOrderUnits).plus(duration); + } else { + return duration; + } + } + + var numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" + }; + var numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] + }; + var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); + function parseDigits(str) { + var value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (var i = 0; i < str.length; i++) { + var code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (var key in numberingSystemsUTF16) { + var _numberingSystemsUTF = numberingSystemsUTF16[key], + min = _numberingSystemsUTF[0], + max = _numberingSystemsUTF[1]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } + } + function digitRegex(_ref, append) { + var numberingSystem = _ref.numberingSystem; + if (append === void 0) { + append = ""; + } + return new RegExp("" + numberingSystems[numberingSystem || "latn"] + append); + } + + var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; + function intUnit(regex, post) { + if (post === void 0) { + post = function post(i) { + return i; + }; + } + return { + regex: regex, + deser: function deser(_ref) { + var s = _ref[0]; + return post(parseDigits(s)); + } + }; + } + var NBSP = String.fromCharCode(160); + var spaceOrNBSP = "[ " + NBSP + "]"; + var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); + function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); + } + function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); + } + function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: function deser(_ref2) { + var s = _ref2[0]; + return strings.findIndex(function (i) { + return stripInsensitivities(s) === stripInsensitivities(i); + }) + startIndex; + } + }; + } + } + function offset(regex, groups) { + return { + regex: regex, + deser: function deser(_ref3) { + var h = _ref3[1], + m = _ref3[2]; + return signedOffset(h, m); + }, + groups: groups + }; + } + function simple(regex) { + return { + regex: regex, + deser: function deser(_ref4) { + var s = _ref4[0]; + return s; + } + }; + } + function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + } + + /** + * @param token + * @param {Locale} loc + */ + function unitForToken(token, loc) { + var one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = function literal(t) { + return { + regex: RegExp(escapeToken(t.val)), + deser: function deser(_ref5) { + var s = _ref5[0]; + return s; + }, + literal: true + }; + }, + unitate = function unitate(t) { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(?::(" + two.source + "))?"), 2); + case "ZZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(" + two.source + ")?"), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + var unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; + } + var partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } + }; + function tokenForPart(part, formatOpts, resolvedOpts) { + var type = part.type, + value = part.value; + if (type === "literal") { + var isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + var style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + var actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + var val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val: val + }; + } + return undefined; + } + function buildRegex(units) { + var re = units.map(function (u) { + return u.regex; + }).reduce(function (f, r) { + return f + "(" + r.source + ")"; + }, ""); + return ["^" + re + "$", units]; + } + function match(input, regex, handlers) { + var matches = input.match(regex); + if (matches) { + var all = {}; + var matchIndex = 1; + for (var i in handlers) { + if (hasOwnProperty(handlers, i)) { + var h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } + } + function dateTimeFromMatches(matches) { + var toField = function toField(token) { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + var zone = null; + var specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + var vals = Object.keys(matches).reduce(function (r, k) { + var f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; + } + var dummyDateTimeCache = null; + function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; + } + function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + var formatOpts = Formatter.macroTokenToFormatOpts(token.val); + var tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; + } + function expandMacroTokens(tokens, locale) { + var _Array$prototype; + return (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, tokens.map(function (t) { + return maybeExpandMacroToken(t, locale); + })); + } + + /** + * @private + */ + + function explainFromTokens(locale, input, format) { + var tokens = expandMacroTokens(Formatter.parseFormat(format), locale), + units = tokens.map(function (t) { + return unitForToken(t, locale); + }), + disqualifyingUnit = units.find(function (t) { + return t.invalidReason; + }); + if (disqualifyingUnit) { + return { + input: input, + tokens: tokens, + invalidReason: disqualifyingUnit.invalidReason + }; + } else { + var _buildRegex = buildRegex(units), + regexString = _buildRegex[0], + handlers = _buildRegex[1], + regex = RegExp(regexString, "i"), + _match = match(input, regex, handlers), + rawMatches = _match[0], + matches = _match[1], + _ref6 = matches ? dateTimeFromMatches(matches) : [null, null, undefined], + result = _ref6[0], + zone = _ref6[1], + specificOffset = _ref6[2]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input: input, + tokens: tokens, + regex: regex, + rawMatches: rawMatches, + matches: matches, + result: result, + zone: zone, + specificOffset: specificOffset + }; + } + } + function parseFromTokens(locale, input, format) { + var _explainFromTokens = explainFromTokens(locale, input, format), + result = _explainFromTokens.result, + zone = _explainFromTokens.zone, + specificOffset = _explainFromTokens.specificOffset, + invalidReason = _explainFromTokens.invalidReason; + return [result, zone, specificOffset, invalidReason]; + } + function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + var formatter = Formatter.create(locale, formatOpts); + var df = formatter.dtFormatter(getDummyDateTime()); + var parts = df.formatToParts(); + var resolvedOpts = df.resolvedOptions(); + return parts.map(function (p) { + return tokenForPart(p, formatOpts, resolvedOpts); + }); + } + + var INVALID = "Invalid DateTime"; + var MAX_DATE = 8.64e15; + function unsupportedZone(zone) { + return new Invalid("unsupported zone", "the zone \"" + zone.name + "\" is not supported"); + } + + // we cache week data on the DT object and this intermediates the cache + /** + * @param {DateTime} dt + */ + function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; + } + + /** + * @param {DateTime} dt + */ + function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; + } + + // clone really means, "make a new object with these modifications". all "setters" really use this + // to create a new object while only changing some of the properties + function clone(inst, alts) { + var current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime(_extends({}, current, alts, { + old: current + })); + } + + // find the right offset a given local time. The o input is our guess, which determines which + // offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) + function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + var utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + var o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + var o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; + } + + // convert an epoch timestamp into a calendar object with the given offset + function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + var d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; + } + + // convert a calendar object to a epoch timestamp + function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); + } + + // create a new DT instance by adding a duration, adjusting for DSTs + function adjustTime(inst, dur) { + var oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = _extends({}, inst.c, { + year: year, + month: month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }), + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + var _fixOffset = fixOffset(localTS, oPre, inst.zone), + ts = _fixOffset[0], + o = _fixOffset[1]; + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts: ts, + o: o + }; + } + + // helper useful in turning the results of parsing into real dates + // by handling the zone options + function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + var setZone = opts.setZone, + zone = opts.zone; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + var interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, _extends({}, opts, { + zone: interpretationZone, + specificOffset: specificOffset + })); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", "the input \"" + text + "\" can't be parsed as " + format)); + } + } + + // if you want to output a technical format (e.g. RFC 2822), this helper + // helps handle the details + function toTechFormat(dt, format, allowZ) { + if (allowZ === void 0) { + allowZ = true; + } + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ: allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; + } + function _toISODate(o, extended) { + var longFormat = o.c.year > 9999 || o.c.year < 0; + var c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (extended) { + c += "-"; + c += padStart(o.c.month); + c += "-"; + c += padStart(o.c.day); + } else { + c += padStart(o.c.month); + c += padStart(o.c.day); + } + return c; + } + function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) { + var c = padStart(o.c.hour); + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += ":"; + } + } else { + c += padStart(o.c.minute); + } + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += padStart(o.c.second); + if (o.c.millisecond !== 0 || !suppressMilliseconds) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; + } + + // defaults for unspecified units in the supported calendars + var defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + + // Units in the supported calendars, sorted by bigness + var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + + // standardize case and plurality in units + function normalizeUnit(unit) { + var normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } + } + + // this is a dumbed down version of fromObject() that runs about 60% faster + // but doesn't do any validation, makes a bunch of assumptions about what units + // are present, and so on. + function quickDT(obj, opts) { + var zone = normalizeZone(opts.zone, Settings.defaultZone), + loc = Locale.fromObject(opts), + tsNow = Settings.now(); + var ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (var _i = 0, _orderedUnits = orderedUnits; _i < _orderedUnits.length; _i++) { + var u = _orderedUnits[_i]; + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + var invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + var offsetProvis = zone.offset(tsNow); + var _objToTS = objToTS(obj, offsetProvis, zone); + ts = _objToTS[0]; + o = _objToTS[1]; + } else { + ts = tsNow; + } + return new DateTime({ + ts: ts, + zone: zone, + loc: loc, + o: o + }); + } + function diffRelative(start, end, opts) { + var round = isUndefined(opts.round) ? true : opts.round, + format = function format(c, unit) { + c = roundTo(c, round || opts.calendary ? 0 : 2, true); + var formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = function differ(unit) { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (var _iterator = _createForOfIteratorHelperLoose(opts.units), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + var count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); + } + function lastOpts(argList) { + var opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; + } + + /** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ + var DateTime = /*#__PURE__*/function (_Symbol$for) { + /** + * @access private + */ + function DateTime(config) { + var zone = config.zone || Settings.defaultZone; + var invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + var c = null, + o = null; + if (!invalid) { + var unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + var _ref = [config.old.c, config.old.o]; + c = _ref[0]; + o = _ref[1]; + } else { + var ot = zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + DateTime.now = function now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */; + DateTime.local = function local() { + var _lastOpts = lastOpts(arguments), + opts = _lastOpts[0], + args = _lastOpts[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */; + DateTime.utc = function utc() { + var _lastOpts2 = lastOpts(arguments), + opts = _lastOpts2[0], + args = _lastOpts2[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */; + DateTime.fromJSDate = function fromJSDate(date, options) { + if (options === void 0) { + options = {}; + } + var ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + var zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromMillis = function fromMillis(milliseconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError("fromMillis requires a numerical input, but received a " + typeof milliseconds + " with value " + milliseconds); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromSeconds = function fromSeconds(seconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */; + DateTime.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + obj = obj || {}; + var zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + var loc = Locale.fromObject(opts); + var normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues = usesLocalWeekValues(normalized, loc), + minDaysInFirstWeek = _usesLocalWeekValues.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues.startOfWeek; + var tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + var units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + var foundFirst = false; + for (var _iterator2 = _createForOfIteratorHelperLoose(units), _step2; !(_step2 = _iterator2()).done;) { + var u = _step2.value; + var v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + var higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + var gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + _objToTS2 = objToTS(gregorian, offsetProvis, zoneToUse), + tsFinal = _objToTS2[0], + offsetFinal = _objToTS2[1], + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc: loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", "you can't specify both a weekday of " + normalized.weekday + " and a date of " + inst.toISO()); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */; + DateTime.fromISO = function fromISO(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseISODate = parseISODate(text), + vals = _parseISODate[0], + parsedZone = _parseISODate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */; + DateTime.fromRFC2822 = function fromRFC2822(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseRFC2822Date = parseRFC2822Date(text), + vals = _parseRFC2822Date[0], + parsedZone = _parseRFC2822Date[1]; + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */; + DateTime.fromHTTP = function fromHTTP(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseHTTPDate = parseHTTPDate(text), + vals = _parseHTTPDate[0], + parsedZone = _parseHTTPDate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromFormat = function fromFormat(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + var _opts = opts, + _opts$locale = _opts.locale, + locale = _opts$locale === void 0 ? null : _opts$locale, + _opts$numberingSystem = _opts.numberingSystem, + numberingSystem = _opts$numberingSystem === void 0 ? null : _opts$numberingSystem, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }), + _parseFromTokens = parseFromTokens(localeToUse, text, fmt), + vals = _parseFromTokens[0], + parsedZone = _parseFromTokens[1], + specificOffset = _parseFromTokens[2], + invalid = _parseFromTokens[3]; + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */; + DateTime.fromString = function fromString(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */; + DateTime.fromSQL = function fromSQL(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseSQL = parseSQL(text), + vals = _parseSQL[0], + parsedZone = _parseSQL[1]; + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */; + DateTime.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid: invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + DateTime.isDateTime = function isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */; + DateTime.parseFormatForOpts = function parseFormatForOpts(formatOpts, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(function (t) { + return t ? t.val : null; + }).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */; + DateTime.expandFormat = function expandFormat(fmt, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(function (t) { + return t.val; + }).join(""); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */; + var _proto = DateTime.prototype; + _proto.get = function get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */; + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + _proto.getPossibleOffsets = function getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + var dayMs = 86400000; + var minuteMs = 60000; + var localTS = objToLocalTS(this.c); + var oEarlier = this.zone.offset(localTS - dayMs); + var oLater = this.zone.offset(localTS + dayMs); + var o1 = this.zone.offset(localTS - oEarlier * minuteMs); + var o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + var ts1 = localTS - o1 * minuteMs; + var ts2 = localTS - o2 * minuteMs; + var c1 = tsToObj(ts1, o1); + var c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */; + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + _proto.resolvedLocaleOptions = function resolvedLocaleOptions(opts) { + if (opts === void 0) { + opts = {}; + } + var _Formatter$create$res = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this), + locale = _Formatter$create$res.locale, + numberingSystem = _Formatter$create$res.numberingSystem, + calendar = _Formatter$create$res.calendar; + return { + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */; + _proto.toUTC = function toUTC(offset, opts) { + if (offset === void 0) { + offset = 0; + } + if (opts === void 0) { + opts = {}; + } + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */; + _proto.toLocal = function toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */; + _proto.setZone = function setZone(zone, _temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + _ref2$keepLocalTime = _ref2.keepLocalTime, + keepLocalTime = _ref2$keepLocalTime === void 0 ? false : _ref2$keepLocalTime, + _ref2$keepCalendarTim = _ref2.keepCalendarTime, + keepCalendarTime = _ref2$keepCalendarTim === void 0 ? false : _ref2$keepCalendarTim; + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + var newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + var offsetGuess = zone.offset(this.ts); + var asObj = this.toObject(); + var _objToTS3 = objToTS(asObj, offsetGuess, zone); + newTS = _objToTS3[0]; + } + return clone(this, { + ts: newTS, + zone: zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */; + _proto.reconfigure = function reconfigure(_temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + locale = _ref3.locale, + numberingSystem = _ref3.numberingSystem, + outputCalendar = _ref3.outputCalendar; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: outputCalendar + }); + return clone(this, { + loc: loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */; + _proto.setLocale = function setLocale(locale) { + return this.reconfigure({ + locale: locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues2 = usesLocalWeekValues(normalized, this.loc), + minDaysInFirstWeek = _usesLocalWeekValues2.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues2.startOfWeek; + var settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var mixed; + if (settingWeekStuff) { + mixed = weekToGregorian(_extends({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian(_extends({}, gregorianToOrdinal(this.c), normalized)); + } else { + mixed = _extends({}, this.toObject(), normalized); + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + var _objToTS4 = objToTS(mixed, this.o, this.zone), + ts = _objToTS4[0], + o = _objToTS4[1]; + return clone(this, { + ts: ts, + o: o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */; + _proto.startOf = function startOf(unit, _temp3) { + var _ref4 = _temp3 === void 0 ? {} : _temp3, + _ref4$useLocaleWeeks = _ref4.useLocaleWeeks, + useLocaleWeeks = _ref4$useLocaleWeeks === void 0 ? false : _ref4$useLocaleWeeks; + if (!this.isValid) return this; + var o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + var startOfWeek = this.loc.getStartOfWeek(); + var weekday = this.weekday; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + var q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */; + _proto.endOf = function endOf(unit, opts) { + var _this$plus; + return this.isValid ? this.plus((_this$plus = {}, _this$plus[unit] = 1, _this$plus)).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */; + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */; + _proto.toLocaleParts = function toLocaleParts(opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @return {string} + */; + _proto.toISO = function toISO(_temp4) { + var _ref5 = _temp4 === void 0 ? {} : _temp4, + _ref5$format = _ref5.format, + format = _ref5$format === void 0 ? "extended" : _ref5$format, + _ref5$suppressSeconds = _ref5.suppressSeconds, + suppressSeconds = _ref5$suppressSeconds === void 0 ? false : _ref5$suppressSeconds, + _ref5$suppressMillise = _ref5.suppressMilliseconds, + suppressMilliseconds = _ref5$suppressMillise === void 0 ? false : _ref5$suppressMillise, + _ref5$includeOffset = _ref5.includeOffset, + includeOffset = _ref5$includeOffset === void 0 ? true : _ref5$includeOffset, + _ref5$extendedZone = _ref5.extendedZone, + extendedZone = _ref5$extendedZone === void 0 ? false : _ref5$extendedZone; + if (!this.isValid) { + return null; + } + var ext = format === "extended"; + var c = _toISODate(this, ext); + c += "T"; + c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @return {string} + */; + _proto.toISODate = function toISODate(_temp5) { + var _ref6 = _temp5 === void 0 ? {} : _temp5, + _ref6$format = _ref6.format, + format = _ref6$format === void 0 ? "extended" : _ref6$format; + if (!this.isValid) { + return null; + } + return _toISODate(this, format === "extended"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */; + _proto.toISOWeekDate = function toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @return {string} + */; + _proto.toISOTime = function toISOTime(_temp6) { + var _ref7 = _temp6 === void 0 ? {} : _temp6, + _ref7$suppressMillise = _ref7.suppressMilliseconds, + suppressMilliseconds = _ref7$suppressMillise === void 0 ? false : _ref7$suppressMillise, + _ref7$suppressSeconds = _ref7.suppressSeconds, + suppressSeconds = _ref7$suppressSeconds === void 0 ? false : _ref7$suppressSeconds, + _ref7$includeOffset = _ref7.includeOffset, + includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset, + _ref7$includePrefix = _ref7.includePrefix, + includePrefix = _ref7$includePrefix === void 0 ? false : _ref7$includePrefix, + _ref7$extendedZone = _ref7.extendedZone, + extendedZone = _ref7$extendedZone === void 0 ? false : _ref7$extendedZone, + _ref7$format = _ref7.format, + format = _ref7$format === void 0 ? "extended" : _ref7$format; + if (!this.isValid) { + return null; + } + var c = includePrefix ? "T" : ""; + return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */; + _proto.toRFC2822 = function toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */; + _proto.toHTTP = function toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string} + */; + _proto.toSQLDate = function toSQLDate() { + if (!this.isValid) { + return null; + } + return _toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */; + _proto.toSQLTime = function toSQLTime(_temp7) { + var _ref8 = _temp7 === void 0 ? {} : _temp7, + _ref8$includeOffset = _ref8.includeOffset, + includeOffset = _ref8$includeOffset === void 0 ? true : _ref8$includeOffset, + _ref8$includeZone = _ref8.includeZone, + includeZone = _ref8$includeZone === void 0 ? false : _ref8$includeZone, + _ref8$includeOffsetSp = _ref8.includeOffsetSpace, + includeOffsetSpace = _ref8$includeOffsetSp === void 0 ? true : _ref8$includeOffsetSp; + var fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */; + _proto.toSQL = function toSQL(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) { + return null; + } + return this.toSQLDate() + " " + this.toSQLTime(opts); + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */; + _proto.toString = function toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "DateTime { ts: " + this.toISO() + ", zone: " + this.zone.name + ", locale: " + this.locale + " }"; + } else { + return "DateTime { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */; + _proto.toMillis = function toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds of this DateTime. + * @return {number} + */; + _proto.toSeconds = function toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */; + _proto.toUnixInteger = function toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */; + _proto.toBSON = function toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */; + _proto.toObject = function toObject(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return {}; + var base = _extends({}, this.c); + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */; + _proto.toJSDate = function toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */; + _proto.diff = function diff(otherDateTime, unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + var durOpts = _extends({ + locale: this.locale, + numberingSystem: this.numberingSystem + }, opts); + var units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = _diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */; + _proto.diffNow = function diffNow(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval} + */; + _proto.until = function until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */; + _proto.hasSame = function hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + var inputMs = otherDateTime.valueOf(); + var adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */; + _proto.equals = function equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds down by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */; + _proto.toRelative = function toRelative(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + var base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + var units = ["years", "months", "days", "hours", "minutes", "seconds"]; + var unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), _extends({}, options, { + numeric: "always", + units: units, + unit: unit + })); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */; + _proto.toRelativeCalendar = function toRelativeCalendar(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, _extends({}, options, { + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + })); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */; + DateTime.min = function min() { + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */; + DateTime.max = function max() { + for (var _len2 = arguments.length, dateTimes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + dateTimes[_key2] = arguments[_key2]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */; + DateTime.fromFormatExplain = function fromFormatExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + var _options = options, + _options$locale = _options.locale, + locale = _options$locale === void 0 ? null : _options$locale, + _options$numberingSys = _options.numberingSystem, + numberingSystem = _options$numberingSys === void 0 ? null : _options$numberingSys, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */; + DateTime.fromStringExplain = function fromStringExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + return DateTime.fromFormatExplain(text, fmt, options); + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */; + _createClass(DateTime, [{ + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "outputCalendar", + get: function get() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + }, { + key: "zone", + get: function get() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + }, { + key: "zoneName", + get: function get() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + }, { + key: "year", + get: function get() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + }, { + key: "quarter", + get: function get() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + }, { + key: "month", + get: function get() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + }, { + key: "day", + get: function get() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + }, { + key: "hour", + get: function get() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + }, { + key: "minute", + get: function get() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + }, { + key: "second", + get: function get() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + }, { + key: "millisecond", + get: function get() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + }, { + key: "weekYear", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + }, { + key: "weekNumber", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + }, { + key: "weekday", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + }, { + key: "isWeekend", + get: function get() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + }, { + key: "localWeekday", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + }, { + key: "localWeekNumber", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + }, { + key: "localWeekYear", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + }, { + key: "ordinal", + get: function get() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + }, { + key: "monthShort", + get: function get() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + }, { + key: "monthLong", + get: function get() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + }, { + key: "weekdayShort", + get: function get() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + }, { + key: "weekdayLong", + get: function get() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + }, { + key: "offset", + get: function get() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameShort", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameLong", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + }, { + key: "isOffsetFixed", + get: function get() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + }, { + key: "isInDST", + get: function get() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + }, { + key: "isInLeapYear", + get: function get() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + }, { + key: "daysInMonth", + get: function get() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + }, { + key: "daysInYear", + get: function get() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + }, { + key: "weeksInWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + }, { + key: "weeksInLocalWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + }], [{ + key: "DATE_SHORT", + get: function get() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED", + get: function get() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED_WITH_WEEKDAY", + get: function get() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_FULL", + get: function get() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_HUGE", + get: function get() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_SIMPLE", + get: function get() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SECONDS", + get: function get() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SHORT_OFFSET", + get: function get() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_LONG_OFFSET", + get: function get() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_SIMPLE", + get: function get() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SECONDS", + get: function get() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SHORT_OFFSET", + get: function get() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_LONG_OFFSET", + get: function get() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT", + get: function get() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT_WITH_SECONDS", + get: function get() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED", + get: function get() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_SECONDS", + get: function get() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_WEEKDAY", + get: function get() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL", + get: function get() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL_WITH_SECONDS", + get: function get() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE", + get: function get() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE_WITH_SECONDS", + get: function get() { + return DATETIME_HUGE_WITH_SECONDS; + } + }]); + return DateTime; + }(Symbol.for("nodejs.util.inspect.custom")); + function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError("Unknown datetime argument: " + dateTimeish + ", of type " + typeof dateTimeish); + } + } + + var VERSION = "3.4.4"; + + exports.DateTime = DateTime; + exports.Duration = Duration; + exports.FixedOffsetZone = FixedOffsetZone; + exports.IANAZone = IANAZone; + exports.Info = Info; + exports.Interval = Interval; + exports.InvalidZone = InvalidZone; + exports.Settings = Settings; + exports.SystemZone = SystemZone; + exports.VERSION = VERSION; + exports.Zone = Zone; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/amd/luxon.js.map b/node_modules/luxon/build/amd/luxon.js.map new file mode 100644 index 0000000..f6abaa1 --- /dev/null +++ b/node_modules/luxon/build/amd/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/digits.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.4.4\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","_Error","_inheritsLoose","apply","arguments","_wrapNativeSuper","Error","InvalidDateTimeError","_LuxonError","reason","call","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","prototype","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","_createClass","key","get","name","singleton","SystemZone","_Zone","_ref","locale","parseZoneInfo","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","makeDTF","zone","hour12","era","typeToPos","hackyOffset","dtf","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","_formatted$i","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","resetCache","isValidSpecifier","isValidZone","e","_this","zoneName","valid","isNaN","NaN","_ref2","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","_opts","base","cacheKeyOpts","_objectWithoutPropertiesLoose","_excluded","RelativeTimeFormat","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","_options","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","intl","PolyNumberFormatter","forceSimple","padTo","floor","otherOpts","_excluded2","Object","keys","intlOpts","_extends","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","undefined","z","gmtOffset","offsetZ","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_proto3","count","English","numeric","fallbackWeekSettings","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","_temp","numbering","_parseLocaleString","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","_this2","formatStr","extract","weekdays","_this3","meridiems","_this4","eras","_this5","field","df","dtFormatter","results","matching","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","FixedOffsetZone","instance","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","now","twoDigitCutoffYear","throwOnInvalid","resetCaches","set","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","toString","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","towardZero","factor","pow","rounder","trunc","round","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","normalizeObject","normalizer","normalized","u","hours","sign","RangeError","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","_iterator","_createForOfIteratorHelperLoose","_step","done","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","tokenToField","lildur","mapped","tokens","realTokens","found","collapsed","shiftTo","filter","ianaRegex","combineRegexes","_len","regexes","_key","full","source","RegExp","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","regex","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","clear","conf","values","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","_Object$entries","entries","_Object$entries$_i","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","_parseISODuration","fromISOTime","_parseISOTimeOnly","week","toFormat","fmtOpts","toHuman","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","invalidReason","valueOf","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","_i4","_orderedUnits2","own","ak","negated","_i5","_Object$keys2","eq","v1","v2","_i6","_orderedUnits3","Symbol","for","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","_split","split","startIsValid","endIsValid","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","sofar","final","xor","_Array$prototype","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8","_ref8$locale","_temp9","_ref9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","_differs","_differs$_i","differ","_highOrderDiffs","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","parseDigits","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","digitRegex","append","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","explainFromTokens","disqualifyingUnit","_buildRegex","regexString","_match","rawMatches","parseFromTokens","_explainFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","longFormat","extendedZone","ianaName","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","quickDT","tsNow","offsetProvis","_objToTS","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","_iterator2","_step2","higherOrderInvalid","gregorian","_objToTS2","tsFinal","offsetFinal","_parseISODate","fromRFC2822","_parseRFC2822Date","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","resolvedLocaleOptions","_Formatter$create$res","toLocal","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","newTS","offsetGuess","asObj","_objToTS3","setLocale","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","ceil","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","ext","_ref6$format","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","dateTimeish","VERSION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EAEA;EACA;EACA;EAFA,IAGMA,UAAU,0BAAAC,MAAA,EAAA;IAAAC,cAAA,CAAAF,UAAA,EAAAC,MAAA,CAAA,CAAA;EAAA,EAAA,SAAAD,UAAA,GAAA;EAAA,IAAA,OAAAC,MAAA,CAAAE,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,IAAA,IAAA,CAAA;EAAA,GAAA;EAAA,EAAA,OAAAJ,UAAA,CAAA;EAAA,CAAAK,eAAAA,gBAAA,CAASC,KAAK,CAAA,CAAA,CAAA;EAE9B;EACA;EACA;EACaC,IAAAA,oBAAoB,0BAAAC,WAAA,EAAA;IAAAN,cAAA,CAAAK,oBAAA,EAAAC,WAAA,CAAA,CAAA;IAC/B,SAAAD,oBAAAA,CAAYE,MAAM,EAAE;MAAA,OAClBD,WAAA,CAAAE,IAAA,CAAA,IAAA,EAAA,oBAAA,GAA2BD,MAAM,CAACE,SAAS,EAAI,CAAC,IAAA,IAAA,CAAA;EAClD,GAAA;EAAC,EAAA,OAAAJ,oBAAA,CAAA;EAAA,CAAA,CAHuCP,UAAU,CAAA,CAAA;;EAMpD;EACA;EACA;EACaY,IAAAA,oBAAoB,0BAAAC,YAAA,EAAA;IAAAX,cAAA,CAAAU,oBAA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W,CAACpb,OAAO,EAAE,CAAC,EAAE;EAChF,IAAA,OAAOniB,QAAQ,CAACs2B,UAAU,CAACiH,WAAW,CAAC,CAAA;KACxC,MAAM,IAAIA,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;EACzD,IAAA,OAAOv9B,QAAQ,CAACsE,UAAU,CAACi5B,WAAW,CAAC,CAAA;EACzC,GAAC,MAAM;EACL,IAAA,MAAM,IAAI5nC,oBAAoB,CAAA,6BAAA,GACE4nC,WAAW,GAAa,YAAA,GAAA,OAAOA,WAC/D,CAAC,CAAA;EACH,GAAA;EACF;;AC12EMC,MAAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/build/cjs-browser/luxon.js b/node_modules/luxon/build/cjs-browser/luxon.js new file mode 100644 index 0000000..bc5798a --- /dev/null +++ b/node_modules/luxon/build/cjs-browser/luxon.js @@ -0,0 +1,8309 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } +} +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} +function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); +} +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); +} +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); +} +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } +} +function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); +} +function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} +function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); +} +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; +} +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); +} +function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); +} + +// these aren't really private, but nor are they really useful to document +/** + * @private + */ +var LuxonError = /*#__PURE__*/function (_Error) { + _inheritsLoose(LuxonError, _Error); + function LuxonError() { + return _Error.apply(this, arguments) || this; + } + return LuxonError; +}( /*#__PURE__*/_wrapNativeSuper(Error)); +/** + * @private + */ +var InvalidDateTimeError = /*#__PURE__*/function (_LuxonError) { + _inheritsLoose(InvalidDateTimeError, _LuxonError); + function InvalidDateTimeError(reason) { + return _LuxonError.call(this, "Invalid DateTime: " + reason.toMessage()) || this; + } + return InvalidDateTimeError; +}(LuxonError); + +/** + * @private + */ +var InvalidIntervalError = /*#__PURE__*/function (_LuxonError2) { + _inheritsLoose(InvalidIntervalError, _LuxonError2); + function InvalidIntervalError(reason) { + return _LuxonError2.call(this, "Invalid Interval: " + reason.toMessage()) || this; + } + return InvalidIntervalError; +}(LuxonError); + +/** + * @private + */ +var InvalidDurationError = /*#__PURE__*/function (_LuxonError3) { + _inheritsLoose(InvalidDurationError, _LuxonError3); + function InvalidDurationError(reason) { + return _LuxonError3.call(this, "Invalid Duration: " + reason.toMessage()) || this; + } + return InvalidDurationError; +}(LuxonError); + +/** + * @private + */ +var ConflictingSpecificationError = /*#__PURE__*/function (_LuxonError4) { + _inheritsLoose(ConflictingSpecificationError, _LuxonError4); + function ConflictingSpecificationError() { + return _LuxonError4.apply(this, arguments) || this; + } + return ConflictingSpecificationError; +}(LuxonError); + +/** + * @private + */ +var InvalidUnitError = /*#__PURE__*/function (_LuxonError5) { + _inheritsLoose(InvalidUnitError, _LuxonError5); + function InvalidUnitError(unit) { + return _LuxonError5.call(this, "Invalid unit " + unit) || this; + } + return InvalidUnitError; +}(LuxonError); + +/** + * @private + */ +var InvalidArgumentError = /*#__PURE__*/function (_LuxonError6) { + _inheritsLoose(InvalidArgumentError, _LuxonError6); + function InvalidArgumentError() { + return _LuxonError6.apply(this, arguments) || this; + } + return InvalidArgumentError; +}(LuxonError); + +/** + * @private + */ +var ZoneIsAbstractError = /*#__PURE__*/function (_LuxonError7) { + _inheritsLoose(ZoneIsAbstractError, _LuxonError7); + function ZoneIsAbstractError() { + return _LuxonError7.call(this, "Zone is an abstract class") || this; + } + return ZoneIsAbstractError; +}(LuxonError); + +/** + * @private + */ + +var n = "numeric", + s = "short", + l = "long"; +var DATE_SHORT = { + year: n, + month: n, + day: n +}; +var DATE_MED = { + year: n, + month: s, + day: n +}; +var DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s +}; +var DATE_FULL = { + year: n, + month: l, + day: n +}; +var DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l +}; +var TIME_SIMPLE = { + hour: n, + minute: n +}; +var TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n +}; +var TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +var TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l +}; +var TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" +}; +var TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" +}; +var TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s +}; +var TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l +}; +var DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n +}; +var DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n +}; +var DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n +}; +var DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n +}; +var DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n +}; +var DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s +}; +var DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +var DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l +}; +var DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l +}; + +/** + * @interface + */ +var Zone = /*#__PURE__*/function () { + function Zone() {} + var _proto = Zone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */; + _createClass(Zone, [{ + key: "type", + get: + /** + * The type of zone + * @abstract + * @type {string} + */ + function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + }, { + key: "name", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "ianaName", + get: function get() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "isValid", + get: function get() { + throw new ZoneIsAbstractError(); + } + }]); + return Zone; +}(); + +var singleton$1 = null; + +/** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ +var SystemZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(SystemZone, _Zone); + function SystemZone() { + return _Zone.apply(this, arguments) || this; + } + var _proto = SystemZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/; + _createClass(SystemZone, [{ + key: "type", + get: /** @override **/ + function get() { + return "system"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "instance", + get: + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + function get() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + }]); + return SystemZone; +}(Zone); + +var dtfCache = {}; +function makeDTF(zone) { + if (!dtfCache[zone]) { + dtfCache[zone] = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zone, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + } + return dtfCache[zone]; +} +var typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 +}; +function hackyOffset(dtf, date) { + var formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + fMonth = parsed[1], + fDay = parsed[2], + fYear = parsed[3], + fadOrBc = parsed[4], + fHour = parsed[5], + fMinute = parsed[6], + fSecond = parsed[7]; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; +} +function partsOffset(dtf, date) { + var formatted = dtf.formatToParts(date); + var filled = []; + for (var i = 0; i < formatted.length; i++) { + var _formatted$i = formatted[i], + type = _formatted$i.type, + value = _formatted$i.value; + var pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; +} +var ianaZoneCache = {}; +/** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ +var IANAZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(IANAZone, _Zone); + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + IANAZone.create = function create(name) { + if (!ianaZoneCache[name]) { + ianaZoneCache[name] = new IANAZone(name); + } + return ianaZoneCache[name]; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */; + IANAZone.resetCache = function resetCache() { + ianaZoneCache = {}; + dtfCache = {}; + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated This method returns false for some valid IANA names. Use isValidZone instead. + * @return {boolean} + */; + IANAZone.isValidSpecifier = function isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */; + IANAZone.isValidZone = function isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + }; + function IANAZone(name) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.zoneName = name; + /** @private **/ + _this.valid = IANAZone.isValidZone(name); + return _this; + } + + /** @override **/ + var _proto = IANAZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale, this.name); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + var date = new Date(ts); + if (isNaN(date)) return NaN; + var dtf = makeDTF(this.name); + var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date), + year = _ref2[0], + month = _ref2[1], + day = _ref2[2], + adOrBc = _ref2[3], + hour = _ref2[4], + minute = _ref2[5], + second = _ref2[6]; + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + var adjustedHour = hour === 24 ? 0 : hour; + var asUTC = objToLocalTS({ + year: year, + month: month, + day: day, + hour: adjustedHour, + minute: minute, + second: second, + millisecond: 0 + }); + var asTS = +date; + var over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** @override **/; + _createClass(IANAZone, [{ + key: "type", + get: function get() { + return "iana"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return this.valid; + } + }]); + return IANAZone; +}(Zone); + +var _excluded = ["base"], + _excluded2 = ["padTo", "floor"]; + +// todo - remap caching + +var intlLFCache = {}; +function getCachedLF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; +} +var intlDTCache = {}; +function getCachedDTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlDTCache[key]; + if (!dtf) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache[key] = dtf; + } + return dtf; +} +var intlNumCache = {}; +function getCachedINF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var inf = intlNumCache[key]; + if (!inf) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache[key] = inf; + } + return inf; +} +var intlRelCache = {}; +function getCachedRTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var _opts = opts; + _opts.base; + var cacheKeyOpts = _objectWithoutPropertiesLoose(_opts, _excluded); // exclude `base` from the options + var key = JSON.stringify([locString, cacheKeyOpts]); + var inf = intlRelCache[key]; + if (!inf) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache[key] = inf; + } + return inf; +} +var sysLocaleCache = null; +function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } +} +var weekInfoCache = {}; +function getCachedWeekInfo(locString) { + var data = weekInfoCache[locString]; + if (!data) { + var locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + weekInfoCache[locString] = data; + } + return data; +} +function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + var xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + var uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + var options; + var selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + var smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + var _options = options, + numberingSystem = _options.numberingSystem, + calendar = _options.calendar; + return [selectedStr, numberingSystem, calendar]; + } +} +function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += "-ca-" + outputCalendar; + } + if (numberingSystem) { + localeStr += "-nu-" + numberingSystem; + } + return localeStr; + } else { + return localeStr; + } +} +function mapMonths(f) { + var ms = []; + for (var i = 1; i <= 12; i++) { + var dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; +} +function mapWeekdays(f) { + var ms = []; + for (var i = 1; i <= 7; i++) { + var dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; +} +function listStuff(loc, length, englishFn, intlFn) { + var mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } +} +function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn"; + } +} + +/** + * @private + */ +var PolyNumberFormatter = /*#__PURE__*/function () { + function PolyNumberFormatter(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + opts.padTo; + opts.floor; + var otherOpts = _objectWithoutPropertiesLoose(opts, _excluded2); + if (!forceSimple || Object.keys(otherOpts).length > 0) { + var intlOpts = _extends({ + useGrouping: false + }, opts); + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + var _proto = PolyNumberFormatter.prototype; + _proto.format = function format(i) { + if (this.inf) { + var fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + var _fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(_fixed, this.padTo); + } + }; + return PolyNumberFormatter; +}(); +/** + * @private + */ +var PolyDateFormatter = /*#__PURE__*/function () { + function PolyDateFormatter(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + var z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + var gmtOffset = -1 * (dt.offset / 60); + var offsetZ = gmtOffset >= 0 ? "Etc/GMT+" + gmtOffset : "Etc/GMT" + gmtOffset; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + var intlOpts = _extends({}, this.opts); + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + var _proto2 = PolyDateFormatter.prototype; + _proto2.format = function format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(function (_ref) { + var value = _ref.value; + return value; + }).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + }; + _proto2.formatToParts = function formatToParts() { + var _this = this; + var parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(function (part) { + if (part.type === "timeZoneName") { + var offsetName = _this.originalZone.offsetName(_this.dt.ts, { + locale: _this.dt.locale, + format: _this.opts.timeZoneName + }); + return _extends({}, part, { + value: offsetName + }); + } else { + return part; + } + }); + } + return parts; + }; + _proto2.resolvedOptions = function resolvedOptions() { + return this.dtf.resolvedOptions(); + }; + return PolyDateFormatter; +}(); +/** + * @private + */ +var PolyRelFormatter = /*#__PURE__*/function () { + function PolyRelFormatter(intl, isEnglish, opts) { + this.opts = _extends({ + style: "long" + }, opts); + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + var _proto3 = PolyRelFormatter.prototype; + _proto3.format = function format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + }; + _proto3.formatToParts = function formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + }; + return PolyRelFormatter; +}(); +var fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] +}; + +/** + * @private + */ +var Locale = /*#__PURE__*/function () { + Locale.fromOpts = function fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + }; + Locale.create = function create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN) { + if (defaultToEN === void 0) { + defaultToEN = false; + } + var specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human readable strings but annoying for parsing/formatting known formats + var localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + var numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + var outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + var weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + }; + Locale.resetCache = function resetCache() { + sysLocaleCache = null; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; + }; + Locale.fromObject = function fromObject(_temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + locale = _ref2.locale, + numberingSystem = _ref2.numberingSystem, + outputCalendar = _ref2.outputCalendar, + weekSettings = _ref2.weekSettings; + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + }; + function Locale(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + var _parseLocaleString = parseLocaleString(locale), + parsedLocale = _parseLocaleString[0], + parsedNumberingSystem = _parseLocaleString[1], + parsedOutputCalendar = _parseLocaleString[2]; + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + var _proto4 = Locale.prototype; + _proto4.listingMode = function listingMode() { + var isActuallyEn = this.isEnglish(); + var hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + }; + _proto4.clone = function clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + }; + _proto4.redefaultToEN = function redefaultToEN(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: true + })); + }; + _proto4.redefaultToSystem = function redefaultToSystem(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: false + })); + }; + _proto4.months = function months$1(length, format) { + var _this2 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, months, function () { + var intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this2.monthsCache[formatStr][length]) { + _this2.monthsCache[formatStr][length] = mapMonths(function (dt) { + return _this2.extract(dt, intl, "month"); + }); + } + return _this2.monthsCache[formatStr][length]; + }); + }; + _proto4.weekdays = function weekdays$1(length, format) { + var _this3 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, weekdays, function () { + var intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this3.weekdaysCache[formatStr][length]) { + _this3.weekdaysCache[formatStr][length] = mapWeekdays(function (dt) { + return _this3.extract(dt, intl, "weekday"); + }); + } + return _this3.weekdaysCache[formatStr][length]; + }); + }; + _proto4.meridiems = function meridiems$1() { + var _this4 = this; + return listStuff(this, undefined, function () { + return meridiems; + }, function () { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!_this4.meridiemCache) { + var intl = { + hour: "numeric", + hourCycle: "h12" + }; + _this4.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(function (dt) { + return _this4.extract(dt, intl, "dayperiod"); + }); + } + return _this4.meridiemCache; + }); + }; + _proto4.eras = function eras$1(length) { + var _this5 = this; + return listStuff(this, length, eras, function () { + var intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!_this5.eraCache[length]) { + _this5.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(function (dt) { + return _this5.extract(dt, intl, "era"); + }); + } + return _this5.eraCache[length]; + }); + }; + _proto4.extract = function extract(dt, intlOpts, field) { + var df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(function (m) { + return m.type.toLowerCase() === field; + }); + return matching ? matching.value : null; + }; + _proto4.numberFormatter = function numberFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + }; + _proto4.dtFormatter = function dtFormatter(dt, intlOpts) { + if (intlOpts === void 0) { + intlOpts = {}; + } + return new PolyDateFormatter(dt, this.intl, intlOpts); + }; + _proto4.relFormatter = function relFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + }; + _proto4.listFormatter = function listFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return getCachedLF(this.intl, opts); + }; + _proto4.isEnglish = function isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us"); + }; + _proto4.getWeekSettings = function getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + }; + _proto4.getStartOfWeek = function getStartOfWeek() { + return this.getWeekSettings().firstDay; + }; + _proto4.getMinDaysInFirstWeek = function getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + }; + _proto4.getWeekendDays = function getWeekendDays() { + return this.getWeekSettings().weekend; + }; + _proto4.equals = function equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + }; + _createClass(Locale, [{ + key: "fastNumbers", + get: function get() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + }]); + return Locale; +}(); + +var singleton = null; + +/** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ +var FixedOffsetZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(FixedOffsetZone, _Zone); + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + FixedOffsetZone.instance = function instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */; + FixedOffsetZone.parseSpecifier = function parseSpecifier(s) { + if (s) { + var r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + }; + function FixedOffsetZone(offset) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.fixed = offset; + return _this; + } + + /** @override **/ + var _proto = FixedOffsetZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return this.name; + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.fixed, format); + } + + /** @override **/; + /** @override **/ + _proto.offset = function offset() { + return this.fixed; + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** @override **/; + _createClass(FixedOffsetZone, [{ + key: "type", + get: function get() { + return "fixed"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.fixed === 0 ? "UTC" : "UTC" + formatOffset(this.fixed, "narrow"); + } + }, { + key: "ianaName", + get: function get() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return "Etc/GMT" + formatOffset(-this.fixed, "narrow"); + } + } + }, { + key: "isUniversal", + get: function get() { + return true; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "utcInstance", + get: + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + function get() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + }]); + return FixedOffsetZone; +}(Zone); + +/** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ +var InvalidZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(InvalidZone, _Zone); + function InvalidZone(zoneName) { + var _this; + _this = _Zone.call(this) || this; + /** @private */ + _this.zoneName = zoneName; + return _this; + } + + /** @override **/ + var _proto = InvalidZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return null; + } + + /** @override **/; + _proto.formatOffset = function formatOffset() { + return ""; + } + + /** @override **/; + _proto.offset = function offset() { + return NaN; + } + + /** @override **/; + _proto.equals = function equals() { + return false; + } + + /** @override **/; + _createClass(InvalidZone, [{ + key: "type", + get: function get() { + return "invalid"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return false; + } + }]); + return InvalidZone; +}(Zone); + +/** + * @private + */ +function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + var lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } +} + +var now = function now() { + return Date.now(); + }, + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + +/** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ +var Settings = /*#__PURE__*/function () { + function Settings() {} + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + Settings.resetCaches = function resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + }; + _createClass(Settings, null, [{ + key: "now", + get: + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + function get() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */, + set: function set(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + }, { + key: "defaultZone", + get: + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + function get() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(zone) { + defaultZone = zone; + } + }, { + key: "defaultLocale", + get: function get() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultNumberingSystem", + get: function get() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultOutputCalendar", + get: function get() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + }, { + key: "defaultWeekSettings", + get: function get() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */, + set: function set(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + */ + }, { + key: "twoDigitCutoffYear", + get: function get() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */, + set: function set(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + }, { + key: "throwOnInvalid", + get: function get() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */, + set: function set(t) { + throwOnInvalid = t; + } + }]); + return Settings; +}(); + +var Invalid = /*#__PURE__*/function () { + function Invalid(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + var _proto = Invalid.prototype; + _proto.toMessage = function toMessage() { + if (this.explanation) { + return this.reason + ": " + this.explanation; + } else { + return this.reason; + } + }; + return Invalid; +}(); + +var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; +function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", "you specified " + value + " (of type " + typeof value + ") as a " + unit + ", which is invalid"); +} +function dayOfWeek(year, month, day) { + var d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + var js = d.getUTCDay(); + return js === 0 ? 7 : js; +} +function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; +} +function uncomputeOrdinal(year, ordinal) { + var table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(function (i) { + return i < ordinal; + }), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day: day + }; +} +function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; +} + +/** + * @private + */ + +function gregorianToWeek(gregObj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var year = gregObj.year, + month = gregObj.month, + day = gregObj.day, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + var weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return _extends({ + weekYear: weekYear, + weekNumber: weekNumber, + weekday: weekday + }, timeObject(gregObj)); +} +function weekToGregorian(weekData, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekYear = weekData.weekYear, + weekNumber = weekData.weekNumber, + weekday = weekData.weekday, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + var ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal.month, + day = _uncomputeOrdinal.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(weekData)); +} +function gregorianToOrdinal(gregData) { + var year = gregData.year, + month = gregData.month, + day = gregData.day; + var ordinal = computeOrdinal(year, month, day); + return _extends({ + year: year, + ordinal: ordinal + }, timeObject(gregData)); +} +function ordinalToGregorian(ordinalData) { + var year = ordinalData.year, + ordinal = ordinalData.ordinal; + var _uncomputeOrdinal2 = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal2.month, + day = _uncomputeOrdinal2.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(ordinalData)); +} + +/** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ +function usesLocalWeekValues(obj, loc) { + var hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + var hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } +} +function hasInvalidWeekData(obj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; +} +function hasInvalidOrdinalData(obj) { + var validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; +} +function hasInvalidGregorianData(obj) { + var validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; +} +function hasInvalidTimeData(obj) { + var hour = obj.hour, + minute = obj.minute, + second = obj.second, + millisecond = obj.millisecond; + var validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; +} + +/** + * @private + */ + +// TYPES + +function isUndefined(o) { + return typeof o === "undefined"; +} +function isNumber(o) { + return typeof o === "number"; +} +function isInteger(o) { + return typeof o === "number" && o % 1 === 0; +} +function isString(o) { + return typeof o === "string"; +} +function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; +} + +// CAPABILITIES + +function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } +} +function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } +} + +// OBJECTS AND ARRAYS + +function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; +} +function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce(function (best, next) { + var pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; +} +function pick(obj, keys) { + return keys.reduce(function (a, k) { + a[k] = obj[k]; + return a; + }, {}); +} +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} +function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function (v) { + return !integerBetween(v, 1, 7); + })) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } +} + +// NUMBERS AND STRINGS + +function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; +} + +// x % n but takes the sign of n instead of x +function floorMod(x, n) { + return x - n * Math.floor(x / n); +} +function padStart(input, n) { + if (n === void 0) { + n = 2; + } + var isNeg = input < 0; + var padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; +} +function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } +} +function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } +} +function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + var f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } +} +function roundTo(number, digits, towardZero) { + if (towardZero === void 0) { + towardZero = false; + } + var factor = Math.pow(10, digits), + rounder = towardZero ? Math.trunc : Math.round; + return rounder(number * factor) / factor; +} + +// DATE BASICS + +function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} +function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; +} +function daysInMonth(year, month) { + var modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } +} + +// convert a calendar object to a local timestamp (epoch, but with the offset baked in) +function objToLocalTS(obj) { + var d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; +} + +// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js +function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + var fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; +} +function weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + var weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; +} +function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; +} + +// PARSING + +function parseZoneInfo(ts, offsetFormat, locale, timeZone) { + if (timeZone === void 0) { + timeZone = null; + } + var date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + var modified = _extends({ + timeZoneName: offsetFormat + }, intlOpts); + var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function (m) { + return m.type.toLowerCase() === "timezonename"; + }); + return parsed ? parsed.value : null; +} + +// signedOffset('-5', '30') -> -330 +function signedOffset(offHourStr, offMinuteStr) { + var offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + var offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; +} + +// COERCION + +function asNumber(value) { + var numericValue = Number(value); + if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue)) throw new InvalidArgumentError("Invalid unit value " + value); + return numericValue; +} +function normalizeObject(obj, normalizer) { + var normalized = {}; + for (var u in obj) { + if (hasOwnProperty(obj, u)) { + var v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; +} +function formatOffset(offset, format) { + var hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2); + case "narrow": + return "" + sign + hours + (minutes > 0 ? ":" + minutes : ""); + case "techie": + return "" + sign + padStart(hours, 2) + padStart(minutes, 2); + default: + throw new RangeError("Value format " + format + " is out of range for property format"); + } +} +function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); +} + +/** + * @private + */ + +var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; +var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; +function months(length) { + switch (length) { + case "narrow": + return [].concat(monthsNarrow); + case "short": + return [].concat(monthsShort); + case "long": + return [].concat(monthsLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } +} +var weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; +var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; +var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; +function weekdays(length) { + switch (length) { + case "narrow": + return [].concat(weekdaysNarrow); + case "short": + return [].concat(weekdaysShort); + case "long": + return [].concat(weekdaysLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } +} +var meridiems = ["AM", "PM"]; +var erasLong = ["Before Christ", "Anno Domini"]; +var erasShort = ["BC", "AD"]; +var erasNarrow = ["B", "A"]; +function eras(length) { + switch (length) { + case "narrow": + return [].concat(erasNarrow); + case "short": + return [].concat(erasShort); + case "long": + return [].concat(erasLong); + default: + return null; + } +} +function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; +} +function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; +} +function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; +} +function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; +} +function formatRelativeTime(unit, count, numeric, narrow) { + if (numeric === void 0) { + numeric = "always"; + } + if (narrow === void 0) { + narrow = false; + } + var units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + var lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + var isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : "next " + units[unit][0]; + case -1: + return isDay ? "yesterday" : "last " + units[unit][0]; + case 0: + return isDay ? "today" : "this " + units[unit][0]; + } + } + + var isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? fmtValue + " " + fmtUnit + " ago" : "in " + fmtValue + " " + fmtUnit; +} + +function stringifyTokens(splits, tokenToString) { + var s = ""; + for (var _iterator = _createForOfIteratorHelperLoose(splits), _step; !(_step = _iterator()).done;) { + var token = _step.value; + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; +} +var _macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS +}; + +/** + * @private + */ +var Formatter = /*#__PURE__*/function () { + Formatter.create = function create(locale, opts) { + if (opts === void 0) { + opts = {}; + } + return new Formatter(locale, opts); + }; + Formatter.parseFormat = function parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + var current = null, + currentFull = "", + bracketed = false; + var splits = []; + for (var i = 0; i < fmt.length; i++) { + var c = fmt.charAt(i); + if (c === "'") { + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + }; + Formatter.macroTokenToFormatOpts = function macroTokenToFormatOpts(token) { + return _macroTokenToFormatOpts[token]; + }; + function Formatter(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + var _proto = Formatter.prototype; + _proto.formatWithSystemDefault = function formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + var df = this.systemLoc.dtFormatter(dt, _extends({}, this.opts, opts)); + return df.format(); + }; + _proto.dtFormatter = function dtFormatter(dt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.loc.dtFormatter(dt, _extends({}, this.opts, opts)); + }; + _proto.formatDateTime = function formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + }; + _proto.formatDateTimeParts = function formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + }; + _proto.formatInterval = function formatInterval(interval, opts) { + var df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + }; + _proto.resolvedOptions = function resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + }; + _proto.num = function num(n, p) { + if (p === void 0) { + p = 0; + } + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + var opts = _extends({}, this.opts); + if (p > 0) { + opts.padTo = p; + } + return this.loc.numberFormatter(opts).format(n); + }; + _proto.formatDateTimeFromString = function formatDateTimeFromString(dt, fmt) { + var _this = this; + var knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = function string(opts, extract) { + return _this.loc.extract(dt, opts, extract); + }, + formatOffset = function formatOffset(opts) { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = function meridiem() { + return knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"); + }, + month = function month(length, standalone) { + return knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"); + }, + weekday = function weekday(length, standalone) { + return knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"); + }, + maybeMacro = function maybeMacro(token) { + var formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return _this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = function era(length) { + return knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"); + }, + tokenToString = function tokenToString(token) { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return _this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return _this.num(dt.millisecond, 3); + // seconds + case "s": + return _this.num(dt.second); + case "ss": + return _this.num(dt.second, 2); + // fractional seconds + case "uu": + return _this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return _this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return _this.num(dt.minute); + case "mm": + return _this.num(dt.minute, 2); + // hours + case "h": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return _this.num(dt.hour); + case "HH": + return _this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: _this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: _this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: _this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: _this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: _this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : _this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : _this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return _this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return _this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : _this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : _this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : _this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : _this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : _this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return _this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return _this.num(dt.weekYear, 4); + case "W": + return _this.num(dt.weekNumber); + case "WW": + return _this.num(dt.weekNumber, 2); + case "n": + return _this.num(dt.localWeekNumber); + case "nn": + return _this.num(dt.localWeekNumber, 2); + case "ii": + return _this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return _this.num(dt.localWeekYear, 4); + case "o": + return _this.num(dt.ordinal); + case "ooo": + return _this.num(dt.ordinal, 3); + case "q": + // like 1 + return _this.num(dt.quarter); + case "qq": + // like 01 + return _this.num(dt.quarter, 2); + case "X": + return _this.num(Math.floor(dt.ts / 1000)); + case "x": + return _this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + }; + _proto.formatDurationFromString = function formatDurationFromString(dur, fmt) { + var _this2 = this; + var tokenToField = function tokenToField(token) { + switch (token[0]) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + return "hour"; + case "d": + return "day"; + case "w": + return "week"; + case "M": + return "month"; + case "y": + return "year"; + default: + return null; + } + }, + tokenToString = function tokenToString(lildur) { + return function (token) { + var mapped = tokenToField(token); + if (mapped) { + return _this2.num(lildur.get(mapped), token.length); + } else { + return token; + } + }; + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce(function (found, _ref) { + var literal = _ref.literal, + val = _ref.val; + return literal ? found : found.concat(val); + }, []), + collapsed = dur.shiftTo.apply(dur, realTokens.map(tokenToField).filter(function (t) { + return t; + })); + return stringifyTokens(tokens, tokenToString(collapsed)); + }; + return Formatter; +}(); + +/* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + +var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; +function combineRegexes() { + for (var _len = arguments.length, regexes = new Array(_len), _key = 0; _key < _len; _key++) { + regexes[_key] = arguments[_key]; + } + var full = regexes.reduce(function (f, r) { + return f + r.source; + }, ""); + return RegExp("^" + full + "$"); +} +function combineExtractors() { + for (var _len2 = arguments.length, extractors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + extractors[_key2] = arguments[_key2]; + } + return function (m) { + return extractors.reduce(function (_ref, ex) { + var mergedVals = _ref[0], + mergedZone = _ref[1], + cursor = _ref[2]; + var _ex = ex(m, cursor), + val = _ex[0], + zone = _ex[1], + next = _ex[2]; + return [_extends({}, mergedVals, val), zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); + }; +} +function parse(s) { + if (s == null) { + return [null, null]; + } + for (var _len3 = arguments.length, patterns = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + patterns[_key3 - 1] = arguments[_key3]; + } + for (var _i = 0, _patterns = patterns; _i < _patterns.length; _i++) { + var _patterns$_i = _patterns[_i], + regex = _patterns$_i[0], + extractor = _patterns$_i[1]; + var m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; +} +function simpleParse() { + for (var _len4 = arguments.length, keys = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + keys[_key4] = arguments[_key4]; + } + return function (match, cursor) { + var ret = {}; + var i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; +} + +// ISO and SQL parsing +var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/; +var isoExtendedZone = "(?:" + offsetRegex.source + "?(?:\\[(" + ianaRegex.source + ")\\])?)?"; +var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; +var isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + isoExtendedZone); +var isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?"); +var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; +var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; +var isoOrdinalRegex = /(\d{4})-?(\d{3})/; +var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); +var extractISOOrdinalData = simpleParse("year", "ordinal"); +var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one +var sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?"); +var sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?"); +function int(match, pos, fallback) { + var m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); +} +function extractISOYmd(match, cursor) { + var item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; +} +function extractISOTime(match, cursor) { + var item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; +} +function extractISOOffset(match, cursor) { + var local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; +} +function extractIANAZone(match, cursor) { + var zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; +} + +// ISO time parsing + +var isoTimeOnly = RegExp("^T?" + isoTimeBaseRegex.source + "$"); + +// ISO duration parsing + +var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; +function extractISODuration(match) { + var s = match[0], + yearStr = match[1], + monthStr = match[2], + weekStr = match[3], + dayStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + millisecondsStr = match[8]; + var hasNegativePrefix = s[0] === "-"; + var negativeSeconds = secondStr && secondStr[0] === "-"; + var maybeNegate = function maybeNegate(num, force) { + if (force === void 0) { + force = false; + } + return num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + }; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; +} + +// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York +// and not just that we're in -240 *right now*. But since I don't think these are used that often +// I'm just going to ignore that +var obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 +}; +function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; +} + +// RFC 2822/5322 +var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; +function extractRFC2822(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + obsOffset = match[8], + milOffset = match[9], + offHourStr = match[10], + offMinuteStr = match[11], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + var offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; +} +function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); +} + +// http date + +var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; +function extractRFC1123Or850(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +function extractASCII(match) { + var weekdayStr = match[1], + monthStr = match[2], + dayStr = match[3], + hourStr = match[4], + minuteStr = match[5], + secondStr = match[6], + yearStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); +var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); +var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); +var isoTimeCombinedRegex = combineRegexes(isoTimeRegex); +var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); +var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); +var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); +var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + +/* + * @private + */ + +function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); +} +function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); +} +function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); +} +function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); +} +var extractISOTimeOnly = combineExtractors(extractISOTime); +function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); +} +var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); +var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); +var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); +function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); +} + +var INVALID$2 = "Invalid Duration"; + +// unit conversion constants +var lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix), + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix); + +// units ordered by size +var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; +var reverseUnits = orderedUnits$1.slice(0).reverse(); + +// clone really means "create another instance just like this one, but with these changes" +function clone$1(dur, alts, clear) { + if (clear === void 0) { + clear = false; + } + // deep merge for vals + var conf = { + values: clear ? alts.values : _extends({}, dur.values, alts.values || {}), + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); +} +function durationToMillis(matrix, vals) { + var _vals$milliseconds; + var sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (var _iterator = _createForOfIteratorHelperLoose(reverseUnits.slice(1)), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; +} + +// NB: mutates parameters +function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + var factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var previousVal = vals[previous] * factor; + var conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + var rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); +} + +// Remove all properties with a value of 0 from an object +function removeZeroes(vals) { + var newVals = {}; + for (var _i = 0, _Object$entries = Object.entries(vals); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _Object$entries[_i], + key = _Object$entries$_i[0], + value = _Object$entries$_i[1]; + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; +} + +/** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ +var Duration = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Duration(config) { + var accurate = config.conversionAccuracy === "longterm" || false; + var matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + Duration.fromMillis = function fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */; + Duration.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got " + (obj === null ? "null" : typeof obj)); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */; + Duration.fromDurationLike = function fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError("Unknown duration argument " + durationLike + " of type " + typeof durationLike); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */; + Duration.fromISO = function fromISO(text, opts) { + var _parseISODuration = parseISODuration(text), + parsed = _parseISODuration[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */; + Duration.fromISOTime = function fromISOTime(text, opts) { + var _parseISOTimeOnly = parseISOTimeOnly(text), + parsed = _parseISOTimeOnly[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */; + Duration.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid: invalid + }); + } + } + + /** + * @private + */; + Duration.normalizeUnit = function normalizeUnit(unit) { + var normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Duration.isDuration = function isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */; + var _proto = Duration.prototype; + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @return {string} + */ + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + var fmtOpts = _extends({}, opts, { + floor: opts.round !== false && opts.floor !== false + }); + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @example + * ```js + * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' + * ``` + */; + _proto.toHuman = function toHuman(opts) { + var _this = this; + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return INVALID$2; + var l = orderedUnits$1.map(function (unit) { + var val = _this.values[unit]; + if (isUndefined(val)) { + return null; + } + return _this.loc.numberFormatter(_extends({ + style: "unit", + unitDisplay: "long" + }, opts, { + unit: unit.slice(0, -1) + })).format(val); + }).filter(function (n) { + return n; + }); + return this.loc.listFormatter(_extends({ + type: "conjunction", + style: opts.listStyle || "narrow" + }, opts)).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */; + _proto.toObject = function toObject() { + if (!this.isValid) return {}; + return _extends({}, this.values); + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */; + _proto.toISO = function toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + var s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return null; + var millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = _extends({ + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended" + }, opts, { + includeOffset: false + }); + var dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */; + _proto.toString = function toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Duration { values: " + JSON.stringify(this.values) + " }"; + } else { + return "Duration { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */; + _proto.toMillis = function toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration), + result = {}; + for (var _i2 = 0, _orderedUnits = orderedUnits$1; _i2 < _orderedUnits.length; _i2++) { + var k = _orderedUnits[_i2]; + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */; + _proto.mapUnits = function mapUnits(fn) { + if (!this.isValid) return this; + var result = {}; + for (var _i3 = 0, _Object$keys = Object.keys(this.values); _i3 < _Object$keys.length; _i3++) { + var k = _Object$keys[_i3]; + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */; + _proto.get = function get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var mixed = _extends({}, this.values, normalizeObject(values, Duration.normalizeUnit)); + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */; + _proto.reconfigure = function reconfigure(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + locale = _ref.locale, + numberingSystem = _ref.numberingSystem, + conversionAccuracy = _ref.conversionAccuracy, + matrix = _ref.matrix; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem + }); + var opts = { + loc: loc, + matrix: matrix, + conversionAccuracy: conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */; + _proto.as = function as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */; + _proto.normalize = function normalize() { + if (!this.isValid) return this; + var vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */; + _proto.rescale = function rescale() { + if (!this.isValid) return this; + var vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */; + _proto.shiftTo = function shiftTo() { + for (var _len = arguments.length, units = new Array(_len), _key = 0; _key < _len; _key++) { + units[_key] = arguments[_key]; + } + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(function (u) { + return Duration.normalizeUnit(u); + }); + var built = {}, + accumulated = {}, + vals = this.toObject(); + var lastUnit; + for (var _i4 = 0, _orderedUnits2 = orderedUnits$1; _i4 < _orderedUnits2.length; _i4++) { + var k = _orderedUnits2[_i4]; + if (units.indexOf(k) >= 0) { + lastUnit = k; + var own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (var ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + var i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (var key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */; + _proto.shiftToAll = function shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */; + _proto.negate = function negate() { + if (!this.isValid) return this; + var negated = {}; + for (var _i5 = 0, _Object$keys2 = Object.keys(this.values); _i5 < _Object$keys2.length; _i5++) { + var k = _Object$keys2[_i5]; + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Get the years. + * @type {number} + */; + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (var _i6 = 0, _orderedUnits3 = orderedUnits$1; _i6 < _orderedUnits3.length; _i6++) { + var u = _orderedUnits3[_i6]; + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + }; + _createClass(Duration, [{ + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + }, { + key: "years", + get: function get() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + }, { + key: "quarters", + get: function get() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + }, { + key: "months", + get: function get() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + }, { + key: "weeks", + get: function get() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + }, { + key: "days", + get: function get() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + }, { + key: "hours", + get: function get() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + }, { + key: "minutes", + get: function get() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + }, { + key: "seconds", + get: function get() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + }, { + key: "milliseconds", + get: function get() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Duration; +}(Symbol.for("nodejs.util.inspect.custom")); + +var INVALID$1 = "Invalid Interval"; + +// checks if the start is equal to or before the end +function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", "The end of an interval must be after its start, but you had start=" + start.toISO() + " and end=" + end.toISO()); + } else { + return null; + } +} + +/** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ +var Interval = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Interval(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + Interval.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid: invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */; + Interval.fromDateTimes = function fromDateTimes(start, end) { + var builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + var validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.after = function after(start, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.before = function before(end, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */; + Interval.fromISO = function fromISO(text, opts) { + var _split = (text || "").split("/", 2), + s = _split[0], + e = _split[1]; + if (s && e) { + var start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + var end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + var dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + var _dur = Duration.fromISO(s, opts); + if (_dur.isValid) { + return Interval.before(end, _dur); + } + } + } + return Interval.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Interval.isInterval = function isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */; + var _proto = Interval.prototype; + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + _proto.length = function length(unit) { + if (unit === void 0) { + unit = "milliseconds"; + } + return this.isValid ? this.toDuration.apply(this, [unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */; + _proto.count = function count(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (!this.isValid) return NaN; + var start = this.start.startOf(unit, opts); + var end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */; + _proto.hasSame = function hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */; + _proto.isEmpty = function isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isAfter = function isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isBefore = function isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.contains = function contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */; + _proto.set = function set(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + start = _ref.start, + end = _ref.end; + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */; + _proto.splitAt = function splitAt() { + var _this = this; + if (!this.isValid) return []; + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + var sorted = dateTimes.map(friendlyDateTime).filter(function (d) { + return _this.contains(d); + }).sort(function (a, b) { + return a.toMillis() - b.toMillis(); + }), + results = []; + var s = this.s, + i = 0; + while (s < this.e) { + var added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */; + _proto.splitBy = function splitBy(duration) { + var dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + var s = this.s, + idx = 1, + next; + var results = []; + while (s < this.e) { + var added = this.start.plus(dur.mapUnits(function (x) { + return x * idx; + })); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */; + _proto.divideEqually = function divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */; + _proto.overlaps = function overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsStart = function abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsEnd = function abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Return whether this Interval engulfs the start and end of the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.engulfs = function engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */; + _proto.intersection = function intersection(other) { + if (!this.isValid) return this; + var s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */; + _proto.union = function union(other) { + if (!this.isValid) return this; + var s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into a equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.merge = function merge(intervals) { + var _intervals$sort$reduc = intervals.sort(function (a, b) { + return a.s - b.s; + }).reduce(function (_ref2, item) { + var sofar = _ref2[0], + current = _ref2[1]; + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]), + found = _intervals$sort$reduc[0], + final = _intervals$sort$reduc[1]; + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.xor = function xor(intervals) { + var _Array$prototype; + var start = null, + currentCount = 0; + var results = [], + ends = intervals.map(function (i) { + return [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]; + }), + flattened = (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, ends), + arr = flattened.sort(function (a, b) { + return a.time - b.time; + }); + for (var _iterator = _createForOfIteratorHelperLoose(arr), _step; !(_step = _iterator()).done;) { + var i = _step.value; + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */; + _proto.difference = function difference() { + var _this2 = this; + for (var _len2 = arguments.length, intervals = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + intervals[_key2] = arguments[_key2]; + } + return Interval.xor([this].concat(intervals)).map(function (i) { + return _this2.intersection(i); + }).filter(function (i) { + return i && !i.isEmpty(); + }); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */; + _proto.toString = function toString() { + if (!this.isValid) return INVALID$1; + return "[" + this.s.toISO() + " \u2013 " + this.e.toISO() + ")"; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Interval { start: " + this.s.toISO() + ", end: " + this.e.toISO() + " }"; + } else { + return "Interval { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISO = function toISO(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISO(opts) + "/" + this.e.toISO(opts); + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */; + _proto.toISODate = function toISODate() { + if (!this.isValid) return INVALID$1; + return this.s.toISODate() + "/" + this.e.toISODate(); + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISOTime(opts) + "/" + this.e.toISOTime(opts); + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */; + _proto.toFormat = function toFormat(dateFormat, _temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + _ref3$separator = _ref3.separator, + separator = _ref3$separator === void 0 ? " – " : _ref3$separator; + if (!this.isValid) return INVALID$1; + return "" + this.s.toFormat(dateFormat) + separator + this.e.toFormat(dateFormat); + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */; + _proto.toDuration = function toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */; + _proto.mapEndpoints = function mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + }; + _createClass(Interval, [{ + key: "start", + get: function get() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval + * @type {DateTime} + */ + }, { + key: "end", + get: function get() { + return this.isValid ? this.e : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Interval; +}(Symbol.for("nodejs.util.inspect.custom")); + +/** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ +var Info = /*#__PURE__*/function () { + function Info() {} + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + Info.hasDST = function hasDST(zone) { + if (zone === void 0) { + zone = Settings.defaultZone; + } + var proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */; + Info.isValidIANAZone = function isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */; + Info.normalizeZone = function normalizeZone$1(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */; + Info.getStartOfWeek = function getStartOfWeek(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$locale = _ref.locale, + locale = _ref$locale === void 0 ? null : _ref$locale, + _ref$locObj = _ref.locObj, + locObj = _ref$locObj === void 0 ? null : _ref$locObj; + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */; + Info.getMinimumDaysInFirstWeek = function getMinimumDaysInFirstWeek(_temp2) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$locale = _ref2.locale, + locale = _ref2$locale === void 0 ? null : _ref2$locale, + _ref2$locObj = _ref2.locObj, + locObj = _ref2$locObj === void 0 ? null : _ref2$locObj; + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */; + Info.getWeekendWeekdays = function getWeekendWeekdays(_temp3) { + var _ref3 = _temp3 === void 0 ? {} : _temp3, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? null : _ref3$locale, + _ref3$locObj = _ref3.locObj, + locObj = _ref3$locObj === void 0 ? null : _ref3$locObj; + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */; + Info.months = function months(length, _temp4) { + if (length === void 0) { + length = "long"; + } + var _ref4 = _temp4 === void 0 ? {} : _temp4, + _ref4$locale = _ref4.locale, + locale = _ref4$locale === void 0 ? null : _ref4$locale, + _ref4$numberingSystem = _ref4.numberingSystem, + numberingSystem = _ref4$numberingSystem === void 0 ? null : _ref4$numberingSystem, + _ref4$locObj = _ref4.locObj, + locObj = _ref4$locObj === void 0 ? null : _ref4$locObj, + _ref4$outputCalendar = _ref4.outputCalendar, + outputCalendar = _ref4$outputCalendar === void 0 ? "gregory" : _ref4$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */; + Info.monthsFormat = function monthsFormat(length, _temp5) { + if (length === void 0) { + length = "long"; + } + var _ref5 = _temp5 === void 0 ? {} : _temp5, + _ref5$locale = _ref5.locale, + locale = _ref5$locale === void 0 ? null : _ref5$locale, + _ref5$numberingSystem = _ref5.numberingSystem, + numberingSystem = _ref5$numberingSystem === void 0 ? null : _ref5$numberingSystem, + _ref5$locObj = _ref5.locObj, + locObj = _ref5$locObj === void 0 ? null : _ref5$locObj, + _ref5$outputCalendar = _ref5.outputCalendar, + outputCalendar = _ref5$outputCalendar === void 0 ? "gregory" : _ref5$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */; + Info.weekdays = function weekdays(length, _temp6) { + if (length === void 0) { + length = "long"; + } + var _ref6 = _temp6 === void 0 ? {} : _temp6, + _ref6$locale = _ref6.locale, + locale = _ref6$locale === void 0 ? null : _ref6$locale, + _ref6$numberingSystem = _ref6.numberingSystem, + numberingSystem = _ref6$numberingSystem === void 0 ? null : _ref6$numberingSystem, + _ref6$locObj = _ref6.locObj, + locObj = _ref6$locObj === void 0 ? null : _ref6$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */; + Info.weekdaysFormat = function weekdaysFormat(length, _temp7) { + if (length === void 0) { + length = "long"; + } + var _ref7 = _temp7 === void 0 ? {} : _temp7, + _ref7$locale = _ref7.locale, + locale = _ref7$locale === void 0 ? null : _ref7$locale, + _ref7$numberingSystem = _ref7.numberingSystem, + numberingSystem = _ref7$numberingSystem === void 0 ? null : _ref7$numberingSystem, + _ref7$locObj = _ref7.locObj, + locObj = _ref7$locObj === void 0 ? null : _ref7$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */; + Info.meridiems = function meridiems(_temp8) { + var _ref8 = _temp8 === void 0 ? {} : _temp8, + _ref8$locale = _ref8.locale, + locale = _ref8$locale === void 0 ? null : _ref8$locale; + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */; + Info.eras = function eras(length, _temp9) { + if (length === void 0) { + length = "short"; + } + var _ref9 = _temp9 === void 0 ? {} : _temp9, + _ref9$locale = _ref9.locale, + locale = _ref9$locale === void 0 ? null : _ref9$locale; + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */; + Info.features = function features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + }; + return Info; +}(); + +function dayDiff(earlier, later) { + var utcDayStart = function utcDayStart(dt) { + return dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(); + }, + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); +} +function highOrderDiffs(cursor, later, units) { + var differs = [["years", function (a, b) { + return b.year - a.year; + }], ["quarters", function (a, b) { + return b.quarter - a.quarter + (b.year - a.year) * 4; + }], ["months", function (a, b) { + return b.month - a.month + (b.year - a.year) * 12; + }], ["weeks", function (a, b) { + var days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + var results = {}; + var earlier = cursor; + var lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (var _i = 0, _differs = differs; _i < _differs.length; _i++) { + var _differs$_i = _differs[_i], + unit = _differs$_i[0], + differ = _differs$_i[1]; + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; +} +function _diff (earlier, later, units, opts) { + var _highOrderDiffs = highOrderDiffs(earlier, later, units), + cursor = _highOrderDiffs[0], + results = _highOrderDiffs[1], + highWater = _highOrderDiffs[2], + lowestOrder = _highOrderDiffs[3]; + var remainingMillis = later - cursor; + var lowerOrderUnits = units.filter(function (u) { + return ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0; + }); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + var _cursor$plus; + highWater = cursor.plus((_cursor$plus = {}, _cursor$plus[lowestOrder] = 1, _cursor$plus)); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + var duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + var _Duration$fromMillis; + return (_Duration$fromMillis = Duration.fromMillis(remainingMillis, opts)).shiftTo.apply(_Duration$fromMillis, lowerOrderUnits).plus(duration); + } else { + return duration; + } +} + +var numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" +}; +var numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] +}; +var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); +function parseDigits(str) { + var value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (var i = 0; i < str.length; i++) { + var code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (var key in numberingSystemsUTF16) { + var _numberingSystemsUTF = numberingSystemsUTF16[key], + min = _numberingSystemsUTF[0], + max = _numberingSystemsUTF[1]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } +} +function digitRegex(_ref, append) { + var numberingSystem = _ref.numberingSystem; + if (append === void 0) { + append = ""; + } + return new RegExp("" + numberingSystems[numberingSystem || "latn"] + append); +} + +var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; +function intUnit(regex, post) { + if (post === void 0) { + post = function post(i) { + return i; + }; + } + return { + regex: regex, + deser: function deser(_ref) { + var s = _ref[0]; + return post(parseDigits(s)); + } + }; +} +var NBSP = String.fromCharCode(160); +var spaceOrNBSP = "[ " + NBSP + "]"; +var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); +function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); +} +function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); +} +function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: function deser(_ref2) { + var s = _ref2[0]; + return strings.findIndex(function (i) { + return stripInsensitivities(s) === stripInsensitivities(i); + }) + startIndex; + } + }; + } +} +function offset(regex, groups) { + return { + regex: regex, + deser: function deser(_ref3) { + var h = _ref3[1], + m = _ref3[2]; + return signedOffset(h, m); + }, + groups: groups + }; +} +function simple(regex) { + return { + regex: regex, + deser: function deser(_ref4) { + var s = _ref4[0]; + return s; + } + }; +} +function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); +} + +/** + * @param token + * @param {Locale} loc + */ +function unitForToken(token, loc) { + var one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = function literal(t) { + return { + regex: RegExp(escapeToken(t.val)), + deser: function deser(_ref5) { + var s = _ref5[0]; + return s; + }, + literal: true + }; + }, + unitate = function unitate(t) { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(?::(" + two.source + "))?"), 2); + case "ZZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(" + two.source + ")?"), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + var unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; +} +var partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } +}; +function tokenForPart(part, formatOpts, resolvedOpts) { + var type = part.type, + value = part.value; + if (type === "literal") { + var isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + var style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + var actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + var val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val: val + }; + } + return undefined; +} +function buildRegex(units) { + var re = units.map(function (u) { + return u.regex; + }).reduce(function (f, r) { + return f + "(" + r.source + ")"; + }, ""); + return ["^" + re + "$", units]; +} +function match(input, regex, handlers) { + var matches = input.match(regex); + if (matches) { + var all = {}; + var matchIndex = 1; + for (var i in handlers) { + if (hasOwnProperty(handlers, i)) { + var h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } +} +function dateTimeFromMatches(matches) { + var toField = function toField(token) { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + var zone = null; + var specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + var vals = Object.keys(matches).reduce(function (r, k) { + var f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; +} +var dummyDateTimeCache = null; +function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; +} +function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + var formatOpts = Formatter.macroTokenToFormatOpts(token.val); + var tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; +} +function expandMacroTokens(tokens, locale) { + var _Array$prototype; + return (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, tokens.map(function (t) { + return maybeExpandMacroToken(t, locale); + })); +} + +/** + * @private + */ + +function explainFromTokens(locale, input, format) { + var tokens = expandMacroTokens(Formatter.parseFormat(format), locale), + units = tokens.map(function (t) { + return unitForToken(t, locale); + }), + disqualifyingUnit = units.find(function (t) { + return t.invalidReason; + }); + if (disqualifyingUnit) { + return { + input: input, + tokens: tokens, + invalidReason: disqualifyingUnit.invalidReason + }; + } else { + var _buildRegex = buildRegex(units), + regexString = _buildRegex[0], + handlers = _buildRegex[1], + regex = RegExp(regexString, "i"), + _match = match(input, regex, handlers), + rawMatches = _match[0], + matches = _match[1], + _ref6 = matches ? dateTimeFromMatches(matches) : [null, null, undefined], + result = _ref6[0], + zone = _ref6[1], + specificOffset = _ref6[2]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input: input, + tokens: tokens, + regex: regex, + rawMatches: rawMatches, + matches: matches, + result: result, + zone: zone, + specificOffset: specificOffset + }; + } +} +function parseFromTokens(locale, input, format) { + var _explainFromTokens = explainFromTokens(locale, input, format), + result = _explainFromTokens.result, + zone = _explainFromTokens.zone, + specificOffset = _explainFromTokens.specificOffset, + invalidReason = _explainFromTokens.invalidReason; + return [result, zone, specificOffset, invalidReason]; +} +function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + var formatter = Formatter.create(locale, formatOpts); + var df = formatter.dtFormatter(getDummyDateTime()); + var parts = df.formatToParts(); + var resolvedOpts = df.resolvedOptions(); + return parts.map(function (p) { + return tokenForPart(p, formatOpts, resolvedOpts); + }); +} + +var INVALID = "Invalid DateTime"; +var MAX_DATE = 8.64e15; +function unsupportedZone(zone) { + return new Invalid("unsupported zone", "the zone \"" + zone.name + "\" is not supported"); +} + +// we cache week data on the DT object and this intermediates the cache +/** + * @param {DateTime} dt + */ +function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; +} + +/** + * @param {DateTime} dt + */ +function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; +} + +// clone really means, "make a new object with these modifications". all "setters" really use this +// to create a new object while only changing some of the properties +function clone(inst, alts) { + var current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime(_extends({}, current, alts, { + old: current + })); +} + +// find the right offset a given local time. The o input is our guess, which determines which +// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) +function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + var utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + var o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + var o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; +} + +// convert an epoch timestamp into a calendar object with the given offset +function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + var d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; +} + +// convert a calendar object to a epoch timestamp +function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); +} + +// create a new DT instance by adding a duration, adjusting for DSTs +function adjustTime(inst, dur) { + var oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = _extends({}, inst.c, { + year: year, + month: month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }), + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + var _fixOffset = fixOffset(localTS, oPre, inst.zone), + ts = _fixOffset[0], + o = _fixOffset[1]; + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts: ts, + o: o + }; +} + +// helper useful in turning the results of parsing into real dates +// by handling the zone options +function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + var setZone = opts.setZone, + zone = opts.zone; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + var interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, _extends({}, opts, { + zone: interpretationZone, + specificOffset: specificOffset + })); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", "the input \"" + text + "\" can't be parsed as " + format)); + } +} + +// if you want to output a technical format (e.g. RFC 2822), this helper +// helps handle the details +function toTechFormat(dt, format, allowZ) { + if (allowZ === void 0) { + allowZ = true; + } + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ: allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; +} +function _toISODate(o, extended) { + var longFormat = o.c.year > 9999 || o.c.year < 0; + var c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (extended) { + c += "-"; + c += padStart(o.c.month); + c += "-"; + c += padStart(o.c.day); + } else { + c += padStart(o.c.month); + c += padStart(o.c.day); + } + return c; +} +function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) { + var c = padStart(o.c.hour); + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += ":"; + } + } else { + c += padStart(o.c.minute); + } + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += padStart(o.c.second); + if (o.c.millisecond !== 0 || !suppressMilliseconds) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; +} + +// defaults for unspecified units in the supported calendars +var defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + +// Units in the supported calendars, sorted by bigness +var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + +// standardize case and plurality in units +function normalizeUnit(unit) { + var normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; +} +function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } +} + +// this is a dumbed down version of fromObject() that runs about 60% faster +// but doesn't do any validation, makes a bunch of assumptions about what units +// are present, and so on. +function quickDT(obj, opts) { + var zone = normalizeZone(opts.zone, Settings.defaultZone), + loc = Locale.fromObject(opts), + tsNow = Settings.now(); + var ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (var _i = 0, _orderedUnits = orderedUnits; _i < _orderedUnits.length; _i++) { + var u = _orderedUnits[_i]; + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + var invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + var offsetProvis = zone.offset(tsNow); + var _objToTS = objToTS(obj, offsetProvis, zone); + ts = _objToTS[0]; + o = _objToTS[1]; + } else { + ts = tsNow; + } + return new DateTime({ + ts: ts, + zone: zone, + loc: loc, + o: o + }); +} +function diffRelative(start, end, opts) { + var round = isUndefined(opts.round) ? true : opts.round, + format = function format(c, unit) { + c = roundTo(c, round || opts.calendary ? 0 : 2, true); + var formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = function differ(unit) { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (var _iterator = _createForOfIteratorHelperLoose(opts.units), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + var count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); +} +function lastOpts(argList) { + var opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; +} + +/** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ +var DateTime = /*#__PURE__*/function (_Symbol$for) { + /** + * @access private + */ + function DateTime(config) { + var zone = config.zone || Settings.defaultZone; + var invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + var c = null, + o = null; + if (!invalid) { + var unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + var _ref = [config.old.c, config.old.o]; + c = _ref[0]; + o = _ref[1]; + } else { + var ot = zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + DateTime.now = function now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */; + DateTime.local = function local() { + var _lastOpts = lastOpts(arguments), + opts = _lastOpts[0], + args = _lastOpts[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */; + DateTime.utc = function utc() { + var _lastOpts2 = lastOpts(arguments), + opts = _lastOpts2[0], + args = _lastOpts2[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */; + DateTime.fromJSDate = function fromJSDate(date, options) { + if (options === void 0) { + options = {}; + } + var ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + var zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromMillis = function fromMillis(milliseconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError("fromMillis requires a numerical input, but received a " + typeof milliseconds + " with value " + milliseconds); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromSeconds = function fromSeconds(seconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */; + DateTime.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + obj = obj || {}; + var zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + var loc = Locale.fromObject(opts); + var normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues = usesLocalWeekValues(normalized, loc), + minDaysInFirstWeek = _usesLocalWeekValues.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues.startOfWeek; + var tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + var units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + var foundFirst = false; + for (var _iterator2 = _createForOfIteratorHelperLoose(units), _step2; !(_step2 = _iterator2()).done;) { + var u = _step2.value; + var v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + var higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + var gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + _objToTS2 = objToTS(gregorian, offsetProvis, zoneToUse), + tsFinal = _objToTS2[0], + offsetFinal = _objToTS2[1], + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc: loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", "you can't specify both a weekday of " + normalized.weekday + " and a date of " + inst.toISO()); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */; + DateTime.fromISO = function fromISO(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseISODate = parseISODate(text), + vals = _parseISODate[0], + parsedZone = _parseISODate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */; + DateTime.fromRFC2822 = function fromRFC2822(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseRFC2822Date = parseRFC2822Date(text), + vals = _parseRFC2822Date[0], + parsedZone = _parseRFC2822Date[1]; + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */; + DateTime.fromHTTP = function fromHTTP(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseHTTPDate = parseHTTPDate(text), + vals = _parseHTTPDate[0], + parsedZone = _parseHTTPDate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromFormat = function fromFormat(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + var _opts = opts, + _opts$locale = _opts.locale, + locale = _opts$locale === void 0 ? null : _opts$locale, + _opts$numberingSystem = _opts.numberingSystem, + numberingSystem = _opts$numberingSystem === void 0 ? null : _opts$numberingSystem, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }), + _parseFromTokens = parseFromTokens(localeToUse, text, fmt), + vals = _parseFromTokens[0], + parsedZone = _parseFromTokens[1], + specificOffset = _parseFromTokens[2], + invalid = _parseFromTokens[3]; + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */; + DateTime.fromString = function fromString(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */; + DateTime.fromSQL = function fromSQL(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseSQL = parseSQL(text), + vals = _parseSQL[0], + parsedZone = _parseSQL[1]; + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */; + DateTime.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid: invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + DateTime.isDateTime = function isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */; + DateTime.parseFormatForOpts = function parseFormatForOpts(formatOpts, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(function (t) { + return t ? t.val : null; + }).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */; + DateTime.expandFormat = function expandFormat(fmt, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(function (t) { + return t.val; + }).join(""); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */; + var _proto = DateTime.prototype; + _proto.get = function get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */; + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + _proto.getPossibleOffsets = function getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + var dayMs = 86400000; + var minuteMs = 60000; + var localTS = objToLocalTS(this.c); + var oEarlier = this.zone.offset(localTS - dayMs); + var oLater = this.zone.offset(localTS + dayMs); + var o1 = this.zone.offset(localTS - oEarlier * minuteMs); + var o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + var ts1 = localTS - o1 * minuteMs; + var ts2 = localTS - o2 * minuteMs; + var c1 = tsToObj(ts1, o1); + var c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */; + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + _proto.resolvedLocaleOptions = function resolvedLocaleOptions(opts) { + if (opts === void 0) { + opts = {}; + } + var _Formatter$create$res = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this), + locale = _Formatter$create$res.locale, + numberingSystem = _Formatter$create$res.numberingSystem, + calendar = _Formatter$create$res.calendar; + return { + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */; + _proto.toUTC = function toUTC(offset, opts) { + if (offset === void 0) { + offset = 0; + } + if (opts === void 0) { + opts = {}; + } + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */; + _proto.toLocal = function toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */; + _proto.setZone = function setZone(zone, _temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + _ref2$keepLocalTime = _ref2.keepLocalTime, + keepLocalTime = _ref2$keepLocalTime === void 0 ? false : _ref2$keepLocalTime, + _ref2$keepCalendarTim = _ref2.keepCalendarTime, + keepCalendarTime = _ref2$keepCalendarTim === void 0 ? false : _ref2$keepCalendarTim; + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + var newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + var offsetGuess = zone.offset(this.ts); + var asObj = this.toObject(); + var _objToTS3 = objToTS(asObj, offsetGuess, zone); + newTS = _objToTS3[0]; + } + return clone(this, { + ts: newTS, + zone: zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */; + _proto.reconfigure = function reconfigure(_temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + locale = _ref3.locale, + numberingSystem = _ref3.numberingSystem, + outputCalendar = _ref3.outputCalendar; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: outputCalendar + }); + return clone(this, { + loc: loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */; + _proto.setLocale = function setLocale(locale) { + return this.reconfigure({ + locale: locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues2 = usesLocalWeekValues(normalized, this.loc), + minDaysInFirstWeek = _usesLocalWeekValues2.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues2.startOfWeek; + var settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var mixed; + if (settingWeekStuff) { + mixed = weekToGregorian(_extends({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian(_extends({}, gregorianToOrdinal(this.c), normalized)); + } else { + mixed = _extends({}, this.toObject(), normalized); + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + var _objToTS4 = objToTS(mixed, this.o, this.zone), + ts = _objToTS4[0], + o = _objToTS4[1]; + return clone(this, { + ts: ts, + o: o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */; + _proto.startOf = function startOf(unit, _temp3) { + var _ref4 = _temp3 === void 0 ? {} : _temp3, + _ref4$useLocaleWeeks = _ref4.useLocaleWeeks, + useLocaleWeeks = _ref4$useLocaleWeeks === void 0 ? false : _ref4$useLocaleWeeks; + if (!this.isValid) return this; + var o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + var startOfWeek = this.loc.getStartOfWeek(); + var weekday = this.weekday; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + var q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */; + _proto.endOf = function endOf(unit, opts) { + var _this$plus; + return this.isValid ? this.plus((_this$plus = {}, _this$plus[unit] = 1, _this$plus)).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */; + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */; + _proto.toLocaleParts = function toLocaleParts(opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @return {string} + */; + _proto.toISO = function toISO(_temp4) { + var _ref5 = _temp4 === void 0 ? {} : _temp4, + _ref5$format = _ref5.format, + format = _ref5$format === void 0 ? "extended" : _ref5$format, + _ref5$suppressSeconds = _ref5.suppressSeconds, + suppressSeconds = _ref5$suppressSeconds === void 0 ? false : _ref5$suppressSeconds, + _ref5$suppressMillise = _ref5.suppressMilliseconds, + suppressMilliseconds = _ref5$suppressMillise === void 0 ? false : _ref5$suppressMillise, + _ref5$includeOffset = _ref5.includeOffset, + includeOffset = _ref5$includeOffset === void 0 ? true : _ref5$includeOffset, + _ref5$extendedZone = _ref5.extendedZone, + extendedZone = _ref5$extendedZone === void 0 ? false : _ref5$extendedZone; + if (!this.isValid) { + return null; + } + var ext = format === "extended"; + var c = _toISODate(this, ext); + c += "T"; + c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @return {string} + */; + _proto.toISODate = function toISODate(_temp5) { + var _ref6 = _temp5 === void 0 ? {} : _temp5, + _ref6$format = _ref6.format, + format = _ref6$format === void 0 ? "extended" : _ref6$format; + if (!this.isValid) { + return null; + } + return _toISODate(this, format === "extended"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */; + _proto.toISOWeekDate = function toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @return {string} + */; + _proto.toISOTime = function toISOTime(_temp6) { + var _ref7 = _temp6 === void 0 ? {} : _temp6, + _ref7$suppressMillise = _ref7.suppressMilliseconds, + suppressMilliseconds = _ref7$suppressMillise === void 0 ? false : _ref7$suppressMillise, + _ref7$suppressSeconds = _ref7.suppressSeconds, + suppressSeconds = _ref7$suppressSeconds === void 0 ? false : _ref7$suppressSeconds, + _ref7$includeOffset = _ref7.includeOffset, + includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset, + _ref7$includePrefix = _ref7.includePrefix, + includePrefix = _ref7$includePrefix === void 0 ? false : _ref7$includePrefix, + _ref7$extendedZone = _ref7.extendedZone, + extendedZone = _ref7$extendedZone === void 0 ? false : _ref7$extendedZone, + _ref7$format = _ref7.format, + format = _ref7$format === void 0 ? "extended" : _ref7$format; + if (!this.isValid) { + return null; + } + var c = includePrefix ? "T" : ""; + return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */; + _proto.toRFC2822 = function toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */; + _proto.toHTTP = function toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string} + */; + _proto.toSQLDate = function toSQLDate() { + if (!this.isValid) { + return null; + } + return _toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */; + _proto.toSQLTime = function toSQLTime(_temp7) { + var _ref8 = _temp7 === void 0 ? {} : _temp7, + _ref8$includeOffset = _ref8.includeOffset, + includeOffset = _ref8$includeOffset === void 0 ? true : _ref8$includeOffset, + _ref8$includeZone = _ref8.includeZone, + includeZone = _ref8$includeZone === void 0 ? false : _ref8$includeZone, + _ref8$includeOffsetSp = _ref8.includeOffsetSpace, + includeOffsetSpace = _ref8$includeOffsetSp === void 0 ? true : _ref8$includeOffsetSp; + var fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */; + _proto.toSQL = function toSQL(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) { + return null; + } + return this.toSQLDate() + " " + this.toSQLTime(opts); + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */; + _proto.toString = function toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "DateTime { ts: " + this.toISO() + ", zone: " + this.zone.name + ", locale: " + this.locale + " }"; + } else { + return "DateTime { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */; + _proto.toMillis = function toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds of this DateTime. + * @return {number} + */; + _proto.toSeconds = function toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */; + _proto.toUnixInteger = function toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */; + _proto.toBSON = function toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */; + _proto.toObject = function toObject(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return {}; + var base = _extends({}, this.c); + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */; + _proto.toJSDate = function toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */; + _proto.diff = function diff(otherDateTime, unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + var durOpts = _extends({ + locale: this.locale, + numberingSystem: this.numberingSystem + }, opts); + var units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = _diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */; + _proto.diffNow = function diffNow(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval} + */; + _proto.until = function until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */; + _proto.hasSame = function hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + var inputMs = otherDateTime.valueOf(); + var adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */; + _proto.equals = function equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds down by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */; + _proto.toRelative = function toRelative(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + var base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + var units = ["years", "months", "days", "hours", "minutes", "seconds"]; + var unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), _extends({}, options, { + numeric: "always", + units: units, + unit: unit + })); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */; + _proto.toRelativeCalendar = function toRelativeCalendar(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, _extends({}, options, { + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + })); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */; + DateTime.min = function min() { + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */; + DateTime.max = function max() { + for (var _len2 = arguments.length, dateTimes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + dateTimes[_key2] = arguments[_key2]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */; + DateTime.fromFormatExplain = function fromFormatExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + var _options = options, + _options$locale = _options.locale, + locale = _options$locale === void 0 ? null : _options$locale, + _options$numberingSys = _options.numberingSystem, + numberingSystem = _options$numberingSys === void 0 ? null : _options$numberingSys, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */; + DateTime.fromStringExplain = function fromStringExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + return DateTime.fromFormatExplain(text, fmt, options); + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */; + _createClass(DateTime, [{ + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "outputCalendar", + get: function get() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + }, { + key: "zone", + get: function get() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + }, { + key: "zoneName", + get: function get() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + }, { + key: "year", + get: function get() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + }, { + key: "quarter", + get: function get() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + }, { + key: "month", + get: function get() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + }, { + key: "day", + get: function get() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + }, { + key: "hour", + get: function get() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + }, { + key: "minute", + get: function get() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + }, { + key: "second", + get: function get() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + }, { + key: "millisecond", + get: function get() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + }, { + key: "weekYear", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + }, { + key: "weekNumber", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + }, { + key: "weekday", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + }, { + key: "isWeekend", + get: function get() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + }, { + key: "localWeekday", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + }, { + key: "localWeekNumber", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + }, { + key: "localWeekYear", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + }, { + key: "ordinal", + get: function get() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + }, { + key: "monthShort", + get: function get() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + }, { + key: "monthLong", + get: function get() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + }, { + key: "weekdayShort", + get: function get() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + }, { + key: "weekdayLong", + get: function get() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + }, { + key: "offset", + get: function get() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameShort", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameLong", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + }, { + key: "isOffsetFixed", + get: function get() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + }, { + key: "isInDST", + get: function get() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + }, { + key: "isInLeapYear", + get: function get() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + }, { + key: "daysInMonth", + get: function get() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + }, { + key: "daysInYear", + get: function get() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + }, { + key: "weeksInWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + }, { + key: "weeksInLocalWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + }], [{ + key: "DATE_SHORT", + get: function get() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED", + get: function get() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED_WITH_WEEKDAY", + get: function get() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_FULL", + get: function get() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_HUGE", + get: function get() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_SIMPLE", + get: function get() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SECONDS", + get: function get() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SHORT_OFFSET", + get: function get() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_LONG_OFFSET", + get: function get() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_SIMPLE", + get: function get() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SECONDS", + get: function get() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SHORT_OFFSET", + get: function get() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_LONG_OFFSET", + get: function get() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT", + get: function get() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT_WITH_SECONDS", + get: function get() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED", + get: function get() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_SECONDS", + get: function get() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_WEEKDAY", + get: function get() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL", + get: function get() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL_WITH_SECONDS", + get: function get() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE", + get: function get() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE_WITH_SECONDS", + get: function get() { + return DATETIME_HUGE_WITH_SECONDS; + } + }]); + return DateTime; +}(Symbol.for("nodejs.util.inspect.custom")); +function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError("Unknown datetime argument: " + dateTimeish + ", of type " + typeof dateTimeish); + } +} + +var VERSION = "3.4.4"; + +exports.DateTime = DateTime; +exports.Duration = Duration; +exports.FixedOffsetZone = FixedOffsetZone; +exports.IANAZone = IANAZone; +exports.Info = Info; +exports.Interval = Interval; +exports.InvalidZone = InvalidZone; +exports.Settings = Settings; +exports.SystemZone = SystemZone; +exports.VERSION = VERSION; +exports.Zone = Zone; +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/cjs-browser/luxon.js.map b/node_modules/luxon/build/cjs-browser/luxon.js.map new file mode 100644 index 0000000..a882167 --- /dev/null +++ b/node_modules/luxon/build/cjs-browser/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/digits.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.4.4\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","_Error","_inheritsLoose","apply","arguments","_wrapNativeSuper","Error","InvalidDateTimeError","_LuxonError","reason","call","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","prototype","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","_createClass","key","get","name","singleton","SystemZone","_Zone","_ref","locale","parseZoneInfo","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","makeDTF","zone","hour12","era","typeToPos","hackyOffset","dtf","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","_formatted$i","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","resetCache","isValidSpecifier","isValidZone","e","_this","zoneName","valid","isNaN","NaN","_ref2","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","_opts","base","cacheKeyOpts","_objectWithoutPropertiesLoose","_excluded","RelativeTimeFormat","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","_options","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","intl","PolyNumberFormatter","forceSimple","padTo","floor","otherOpts","_excluded2","Object","keys","intlOpts","_extends","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","undefined","z","gmtOffset","offsetZ","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_proto3","count","English","numeric","fallbackWeekSettings","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","_temp","numbering","_parseLocaleString","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","_this2","formatStr","extract","weekdays","_this3","meridiems","_this4","eras","_this5","field","df","dtFormatter","results","matching","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","FixedOffsetZone","instance","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","now","twoDigitCutoffYear","throwOnInvalid","resetCaches","set","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","toString","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","towardZero","factor","pow","rounder","trunc","round","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","normalizeObject","normalizer","normalized","u","hours","sign","RangeError","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","_iterator","_createForOfIteratorHelperLoose","_step","done","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","tokenToField","lildur","mapped","tokens","realTokens","found","collapsed","shiftTo","filter","ianaRegex","combineRegexes","_len","regexes","_key","full","source","RegExp","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","regex","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","clear","conf","values","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","_Object$entries","entries","_Object$entries$_i","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","_parseISODuration","fromISOTime","_parseISOTimeOnly","week","toFormat","fmtOpts","toHuman","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","invalidReason","valueOf","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","_i4","_orderedUnits2","own","ak","negated","_i5","_Object$keys2","eq","v1","v2","_i6","_orderedUnits3","Symbol","for","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","_split","split","startIsValid","endIsValid","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","sofar","final","xor","_Array$prototype","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8","_ref8$locale","_temp9","_ref9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","_differs","_differs$_i","differ","_highOrderDiffs","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","parseDigits","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","digitRegex","append","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","explainFromTokens","disqualifyingUnit","_buildRegex","regexString","_match","rawMatches","parseFromTokens","_explainFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","longFormat","extendedZone","ianaName","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","quickDT","tsNow","offsetProvis","_objToTS","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","_iterator2","_step2","higherOrderInvalid","gregorian","_objToTS2","tsFinal","offsetFinal","_parseISODate","fromRFC2822","_parseRFC2822Date","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","resolvedLocaleOptions","_Formatter$create$res","toLocal","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","newTS","offsetGuess","asObj","_objToTS3","setLocale","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","ceil","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","ext","_ref6$format","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","dateTimeish","VERSION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AAFA,IAGMA,UAAU,0BAAAC,MAAA,EAAA;EAAAC,cAAA,CAAAF,UAAA,EAAAC,MAAA,CAAA,CAAA;AAAA,EAAA,SAAAD,UAAA,GAAA;AAAA,IAAA,OAAAC,MAAA,CAAAE,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,IAAA,IAAA,CAAA;AAAA,GAAA;AAAA,EAAA,OAAAJ,UAAA,CAAA;AAAA,CAAAK,eAAAA,gBAAA,CAASC,KAAK,CAAA,CAAA,CAAA;AAE9B;AACA;AACA;AACaC,IAAAA,oBAAoB,0BAAAC,WAAA,EAAA;EAAAN,cAAA,CAAAK,oBAAA,EAAAC,WAAA,CAAA,CAAA;EAC/B,S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AA1T,QAAA,CAAA;AAAA,CAAA,CA9cAkkB,MAAM,CAACC,GAAG,CAAC,4BAA4B,CAAC,EAAA;AAodpC,SAASM,gBAAgBA,CAAC8Y,WAAW,EAAE;AAC5C,EAAA,IAAIv9B,QAAQ,CAACu4B,UAAU,CAACgF,WAAW,CAAC,EAAE;AACpC,IAAA,OAAOA,WAAW,CAAA;AACpB,GAAC,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACpb,OAAO,IAAI/Z,QAAQ,CAACm1B,WAAW,CAACpb,OAAO,EAAE,CAAC,EAAE;AAChF,IAAA,OAAOniB,QAAQ,CAACs2B,UAAU,CAACiH,WAAW,CAAC,CAAA;GACxC,MAAM,IAAIA,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;AACzD,IAAA,OAAOv9B,QAAQ,CAACsE,UAAU,CAACi5B,WAAW,CAAC,CAAA;AACzC,GAAC,MAAM;AACL,IAAA,MAAM,IAAI5nC,oBAAoB,CAAA,6BAAA,GACE4nC,WAAW,GAAa,YAAA,GAAA,OAAOA,WAC/D,CAAC,CAAA;AACH,GAAA;AACF;;AC12EMC,IAAAA,OAAO,GAAG;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/build/es6/luxon.js b/node_modules/luxon/build/es6/luxon.js new file mode 100644 index 0000000..8582729 --- /dev/null +++ b/node_modules/luxon/build/es6/luxon.js @@ -0,0 +1,7695 @@ +// these aren't really private, but nor are they really useful to document + +/** + * @private + */ +class LuxonError extends Error {} + +/** + * @private + */ +class InvalidDateTimeError extends LuxonError { + constructor(reason) { + super(`Invalid DateTime: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidIntervalError extends LuxonError { + constructor(reason) { + super(`Invalid Interval: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidDurationError extends LuxonError { + constructor(reason) { + super(`Invalid Duration: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class ConflictingSpecificationError extends LuxonError {} + +/** + * @private + */ +class InvalidUnitError extends LuxonError { + constructor(unit) { + super(`Invalid unit ${unit}`); + } +} + +/** + * @private + */ +class InvalidArgumentError extends LuxonError {} + +/** + * @private + */ +class ZoneIsAbstractError extends LuxonError { + constructor() { + super("Zone is an abstract class"); + } +} + +/** + * @private + */ + +const n = "numeric", + s = "short", + l = "long"; + +const DATE_SHORT = { + year: n, + month: n, + day: n, +}; + +const DATE_MED = { + year: n, + month: s, + day: n, +}; + +const DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, +}; + +const DATE_FULL = { + year: n, + month: l, + day: n, +}; + +const DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l, +}; + +const TIME_SIMPLE = { + hour: n, + minute: n, +}; + +const TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n, +}; + +const TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s, +}; + +const TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l, +}; + +const TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23", +}; + +const TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", +}; + +const TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s, +}; + +const TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l, +}; + +const DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n, +}; + +const DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n, +}; + +const DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n, +}; + +const DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n, +}; + +const DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n, +}; + +const DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s, +}; + +const DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s, +}; + +const DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l, +}; + +const DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l, +}; + +/** + * @interface + */ +class Zone { + /** + * The type of zone + * @abstract + * @type {string} + */ + get type() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + get name() { + throw new ZoneIsAbstractError(); + } + + get ianaName() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + get isUniversal() { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */ + offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */ + get isValid() { + throw new ZoneIsAbstractError(); + } +} + +let singleton$1 = null; + +/** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ +class SystemZone extends Zone { + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + static get instance() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + + /** @override **/ + get type() { + return "system"; + } + + /** @override **/ + get name() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName(ts, { format, locale }) { + return parseZoneInfo(ts, format, locale); + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/ + offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/ + get isValid() { + return true; + } +} + +let dtfCache = {}; +function makeDTF(zone) { + if (!dtfCache[zone]) { + dtfCache[zone] = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zone, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short", + }); + } + return dtfCache[zone]; +} + +const typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6, +}; + +function hackyOffset(dtf, date) { + const formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; +} + +function partsOffset(dtf, date) { + const formatted = dtf.formatToParts(date); + const filled = []; + for (let i = 0; i < formatted.length; i++) { + const { type, value } = formatted[i]; + const pos = typeToPos[type]; + + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; +} + +let ianaZoneCache = {}; +/** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ +class IANAZone extends Zone { + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + static create(name) { + if (!ianaZoneCache[name]) { + ianaZoneCache[name] = new IANAZone(name); + } + return ianaZoneCache[name]; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCache() { + ianaZoneCache = {}; + dtfCache = {}; + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated This method returns false for some valid IANA names. Use isValidZone instead. + * @return {boolean} + */ + static isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */ + static isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { timeZone: zone }).format(); + return true; + } catch (e) { + return false; + } + } + + constructor(name) { + super(); + /** @private **/ + this.zoneName = name; + /** @private **/ + this.valid = IANAZone.isValidZone(name); + } + + /** @override **/ + get type() { + return "iana"; + } + + /** @override **/ + get name() { + return this.zoneName; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName(ts, { format, locale }) { + return parseZoneInfo(ts, format, locale, this.name); + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/ + offset(ts) { + const date = new Date(ts); + + if (isNaN(date)) return NaN; + + const dtf = makeDTF(this.name); + let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts + ? partsOffset(dtf, date) + : hackyOffset(dtf, date); + + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + const adjustedHour = hour === 24 ? 0 : hour; + + const asUTC = objToLocalTS({ + year, + month, + day, + hour: adjustedHour, + minute, + second, + millisecond: 0, + }); + + let asTS = +date; + const over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** @override **/ + get isValid() { + return this.valid; + } +} + +// todo - remap caching + +let intlLFCache = {}; +function getCachedLF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; +} + +let intlDTCache = {}; +function getCachedDTF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlDTCache[key]; + if (!dtf) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache[key] = dtf; + } + return dtf; +} + +let intlNumCache = {}; +function getCachedINF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let inf = intlNumCache[key]; + if (!inf) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache[key] = inf; + } + return inf; +} + +let intlRelCache = {}; +function getCachedRTF(locString, opts = {}) { + const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options + const key = JSON.stringify([locString, cacheKeyOpts]); + let inf = intlRelCache[key]; + if (!inf) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache[key] = inf; + } + return inf; +} + +let sysLocaleCache = null; +function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } +} + +let weekInfoCache = {}; +function getCachedWeekInfo(locString) { + let data = weekInfoCache[locString]; + if (!data) { + const locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + weekInfoCache[locString] = data; + } + return data; +} + +function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + const xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + + const uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + let options; + let selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + const smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + + const { numberingSystem, calendar } = options; + return [selectedStr, numberingSystem, calendar]; + } +} + +function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + + if (outputCalendar) { + localeStr += `-ca-${outputCalendar}`; + } + + if (numberingSystem) { + localeStr += `-nu-${numberingSystem}`; + } + return localeStr; + } else { + return localeStr; + } +} + +function mapMonths(f) { + const ms = []; + for (let i = 1; i <= 12; i++) { + const dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; +} + +function mapWeekdays(f) { + const ms = []; + for (let i = 1; i <= 7; i++) { + const dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; +} + +function listStuff(loc, length, englishFn, intlFn) { + const mode = loc.listingMode(); + + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } +} + +function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return ( + loc.numberingSystem === "latn" || + !loc.locale || + loc.locale.startsWith("en") || + new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn" + ); + } +} + +/** + * @private + */ + +class PolyNumberFormatter { + constructor(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + + const { padTo, floor, ...otherOpts } = opts; + + if (!forceSimple || Object.keys(otherOpts).length > 0) { + const intlOpts = { useGrouping: false, ...opts }; + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + + format(i) { + if (this.inf) { + const fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + const fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(fixed, this.padTo); + } + } +} + +/** + * @private + */ + +class PolyDateFormatter { + constructor(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + + let z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + const gmtOffset = -1 * (dt.offset / 60); + const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ minutes: dt.offset }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ minutes: dt.offset }); + this.originalZone = dt.zone; + } + + const intlOpts = { ...this.opts }; + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + + format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts() + .map(({ value }) => value) + .join(""); + } + return this.dtf.format(this.dt.toJSDate()); + } + + formatToParts() { + const parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map((part) => { + if (part.type === "timeZoneName") { + const offsetName = this.originalZone.offsetName(this.dt.ts, { + locale: this.dt.locale, + format: this.opts.timeZoneName, + }); + return { + ...part, + value: offsetName, + }; + } else { + return part; + } + }); + } + return parts; + } + + resolvedOptions() { + return this.dtf.resolvedOptions(); + } +} + +/** + * @private + */ +class PolyRelFormatter { + constructor(intl, isEnglish, opts) { + this.opts = { style: "long", ...opts }; + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + + format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + } + + formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + } +} + +const fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7], +}; + +/** + * @private + */ + +class Locale { + static fromOpts(opts) { + return Locale.create( + opts.locale, + opts.numberingSystem, + opts.outputCalendar, + opts.weekSettings, + opts.defaultToEN + ); + } + + static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) { + const specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human readable strings but annoying for parsing/formatting known formats + const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + } + + static resetCache() { + sysLocaleCache = null; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; + } + + static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) { + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + } + + constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale); + + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + + this.weekdaysCache = { format: {}, standalone: {} }; + this.monthsCache = { format: {}, standalone: {} }; + this.meridiemCache = null; + this.eraCache = {}; + + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + + get fastNumbers() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + + return this.fastNumbersCached; + } + + listingMode() { + const isActuallyEn = this.isEnglish(); + const hasNoWeirdness = + (this.numberingSystem === null || this.numberingSystem === "latn") && + (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + } + + clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create( + alts.locale || this.specifiedLocale, + alts.numberingSystem || this.numberingSystem, + alts.outputCalendar || this.outputCalendar, + validateWeekSettings(alts.weekSettings) || this.weekSettings, + alts.defaultToEN || false + ); + } + } + + redefaultToEN(alts = {}) { + return this.clone({ ...alts, defaultToEN: true }); + } + + redefaultToSystem(alts = {}) { + return this.clone({ ...alts, defaultToEN: false }); + } + + months(length, format = false) { + return listStuff(this, length, months, () => { + const intl = format ? { month: length, day: "numeric" } : { month: length }, + formatStr = format ? "format" : "standalone"; + if (!this.monthsCache[formatStr][length]) { + this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, "month")); + } + return this.monthsCache[formatStr][length]; + }); + } + + weekdays(length, format = false) { + return listStuff(this, length, weekdays, () => { + const intl = format + ? { weekday: length, year: "numeric", month: "long", day: "numeric" } + : { weekday: length }, + formatStr = format ? "format" : "standalone"; + if (!this.weekdaysCache[formatStr][length]) { + this.weekdaysCache[formatStr][length] = mapWeekdays((dt) => + this.extract(dt, intl, "weekday") + ); + } + return this.weekdaysCache[formatStr][length]; + }); + } + + meridiems() { + return listStuff( + this, + undefined, + () => meridiems, + () => { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!this.meridiemCache) { + const intl = { hour: "numeric", hourCycle: "h12" }; + this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map( + (dt) => this.extract(dt, intl, "dayperiod") + ); + } + + return this.meridiemCache; + } + ); + } + + eras(length) { + return listStuff(this, length, eras, () => { + const intl = { era: length }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!this.eraCache[length]) { + this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) => + this.extract(dt, intl, "era") + ); + } + + return this.eraCache[length]; + }); + } + + extract(dt, intlOpts, field) { + const df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find((m) => m.type.toLowerCase() === field); + return matching ? matching.value : null; + } + + numberFormatter(opts = {}) { + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + } + + dtFormatter(dt, intlOpts = {}) { + return new PolyDateFormatter(dt, this.intl, intlOpts); + } + + relFormatter(opts = {}) { + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + } + + listFormatter(opts = {}) { + return getCachedLF(this.intl, opts); + } + + isEnglish() { + return ( + this.locale === "en" || + this.locale.toLowerCase() === "en-us" || + new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us") + ); + } + + getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + } + + getStartOfWeek() { + return this.getWeekSettings().firstDay; + } + + getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + } + + getWeekendDays() { + return this.getWeekSettings().weekend; + } + + equals(other) { + return ( + this.locale === other.locale && + this.numberingSystem === other.numberingSystem && + this.outputCalendar === other.outputCalendar + ); + } +} + +let singleton = null; + +/** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ +class FixedOffsetZone extends Zone { + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + static get utcInstance() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + static instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */ + static parseSpecifier(s) { + if (s) { + const r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + } + + constructor(offset) { + super(); + /** @private **/ + this.fixed = offset; + } + + /** @override **/ + get type() { + return "fixed"; + } + + /** @override **/ + get name() { + return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`; + } + + get ianaName() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`; + } + } + + /** @override **/ + offsetName() { + return this.name; + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.fixed, format); + } + + /** @override **/ + get isUniversal() { + return true; + } + + /** @override **/ + offset() { + return this.fixed; + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** @override **/ + get isValid() { + return true; + } +} + +/** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ +class InvalidZone extends Zone { + constructor(zoneName) { + super(); + /** @private */ + this.zoneName = zoneName; + } + + /** @override **/ + get type() { + return "invalid"; + } + + /** @override **/ + get name() { + return this.zoneName; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName() { + return null; + } + + /** @override **/ + formatOffset() { + return ""; + } + + /** @override **/ + offset() { + return NaN; + } + + /** @override **/ + equals() { + return false; + } + + /** @override **/ + get isValid() { + return false; + } +} + +/** + * @private + */ + +function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + const lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone; + else if (lowered === "local" || lowered === "system") return SystemZone.instance; + else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance; + else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } +} + +let now = () => Date.now(), + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + +/** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ +class Settings { + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + static get now() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */ + static set now(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + static set defaultZone(zone) { + defaultZone = zone; + } + + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + static get defaultZone() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultLocale() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultLocale(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultNumberingSystem() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultNumberingSystem(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultOutputCalendar() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultOutputCalendar(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + static get defaultWeekSettings() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */ + static set defaultWeekSettings(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + */ + static get twoDigitCutoffYear() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */ + static set twoDigitCutoffYear(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static get throwOnInvalid() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static set throwOnInvalid(t) { + throwOnInvalid = t; + } + + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + } +} + +class Invalid { + constructor(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + + toMessage() { + if (this.explanation) { + return `${this.reason}: ${this.explanation}`; + } else { + return this.reason; + } + } +} + +const nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; + +function unitOutOfRange(unit, value) { + return new Invalid( + "unit out of range", + `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid` + ); +} + +function dayOfWeek(year, month, day) { + const d = new Date(Date.UTC(year, month - 1, day)); + + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + + const js = d.getUTCDay(); + + return js === 0 ? 7 : js; +} + +function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; +} + +function uncomputeOrdinal(year, ordinal) { + const table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex((i) => i < ordinal), + day = ordinal - table[month0]; + return { month: month0 + 1, day }; +} + +function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return ((isoWeekday - startOfWeek + 7) % 7) + 1; +} + +/** + * @private + */ + +function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { year, month, day } = gregObj, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + + let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + + return { weekYear, weekNumber, weekday, ...timeObject(gregObj) }; +} + +function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { weekYear, weekNumber, weekday } = weekData, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + + let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + + const { month, day } = uncomputeOrdinal(year, ordinal); + return { year, month, day, ...timeObject(weekData) }; +} + +function gregorianToOrdinal(gregData) { + const { year, month, day } = gregData; + const ordinal = computeOrdinal(year, month, day); + return { year, ordinal, ...timeObject(gregData) }; +} + +function ordinalToGregorian(ordinalData) { + const { year, ordinal } = ordinalData; + const { month, day } = uncomputeOrdinal(year, ordinal); + return { year, month, day, ...timeObject(ordinalData) }; +} + +/** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ +function usesLocalWeekValues(obj, loc) { + const hasLocaleWeekData = + !isUndefined(obj.localWeekday) || + !isUndefined(obj.localWeekNumber) || + !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + const hasIsoWeekData = + !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + + if (hasIsoWeekData) { + throw new ConflictingSpecificationError( + "Cannot mix locale-based week fields with ISO-based week fields" + ); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek(), + }; + } else { + return { minDaysInFirstWeek: 4, startOfWeek: 1 }; + } +} + +function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const validYear = isInteger(obj.weekYear), + validWeek = integerBetween( + obj.weekNumber, + 1, + weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek) + ), + validWeekday = integerBetween(obj.weekday, 1, 7); + + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; +} + +function hasInvalidOrdinalData(obj) { + const validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; +} + +function hasInvalidGregorianData(obj) { + const validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; +} + +function hasInvalidTimeData(obj) { + const { hour, minute, second, millisecond } = obj; + const validHour = + integerBetween(hour, 0, 23) || + (hour === 24 && minute === 0 && second === 0 && millisecond === 0), + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; +} + +/* + This is just a junk drawer, containing anything used across multiple classes. + Because Luxon is small(ish), this should stay small and we won't worry about splitting + it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area. +*/ + +/** + * @private + */ + +// TYPES + +function isUndefined(o) { + return typeof o === "undefined"; +} + +function isNumber(o) { + return typeof o === "number"; +} + +function isInteger(o) { + return typeof o === "number" && o % 1 === 0; +} + +function isString(o) { + return typeof o === "string"; +} + +function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; +} + +// CAPABILITIES + +function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } +} + +function hasLocaleWeekInfo() { + try { + return ( + typeof Intl !== "undefined" && + !!Intl.Locale && + ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype) + ); + } catch (e) { + return false; + } +} + +// OBJECTS AND ARRAYS + +function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; +} + +function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce((best, next) => { + const pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; +} + +function pick(obj, keys) { + return keys.reduce((a, k) => { + a[k] = obj[k]; + return a; + }, {}); +} + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if ( + !integerBetween(settings.firstDay, 1, 7) || + !integerBetween(settings.minimalDays, 1, 7) || + !Array.isArray(settings.weekend) || + settings.weekend.some((v) => !integerBetween(v, 1, 7)) + ) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend), + }; + } +} + +// NUMBERS AND STRINGS + +function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; +} + +// x % n but takes the sign of n instead of x +function floorMod(x, n) { + return x - n * Math.floor(x / n); +} + +function padStart(input, n = 2) { + const isNeg = input < 0; + let padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; +} + +function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } +} + +function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } +} + +function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + const f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } +} + +function roundTo(number, digits, towardZero = false) { + const factor = 10 ** digits, + rounder = towardZero ? Math.trunc : Math.round; + return rounder(number * factor) / factor; +} + +// DATE BASICS + +function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + +function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; +} + +function daysInMonth(year, month) { + const modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } +} + +// convert a calendar object to a local timestamp (epoch, but with the offset baked in) +function objToLocalTS(obj) { + let d = Date.UTC( + obj.year, + obj.month - 1, + obj.day, + obj.hour, + obj.minute, + obj.second, + obj.millisecond + ); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; +} + +// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js +function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; +} + +function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) { + const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; +} + +function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; +} + +// PARSING + +function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) { + const date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + }; + + if (timeZone) { + intlOpts.timeZone = timeZone; + } + + const modified = { timeZoneName: offsetFormat, ...intlOpts }; + + const parsed = new Intl.DateTimeFormat(locale, modified) + .formatToParts(date) + .find((m) => m.type.toLowerCase() === "timezonename"); + return parsed ? parsed.value : null; +} + +// signedOffset('-5', '30') -> -330 +function signedOffset(offHourStr, offMinuteStr) { + let offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + + const offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; +} + +// COERCION + +function asNumber(value) { + const numericValue = Number(value); + if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue)) + throw new InvalidArgumentError(`Invalid unit value ${value}`); + return numericValue; +} + +function normalizeObject(obj, normalizer) { + const normalized = {}; + for (const u in obj) { + if (hasOwnProperty(obj, u)) { + const v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; +} + +function formatOffset(offset, format) { + const hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + + switch (format) { + case "short": + return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`; + case "narrow": + return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`; + case "techie": + return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`; + default: + throw new RangeError(`Value format ${format} is out of range for property format`); + } +} + +function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); +} + +/** + * @private + */ + +const monthsLong = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +]; + +const monthsShort = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", +]; + +const monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + +function months(length) { + switch (length) { + case "narrow": + return [...monthsNarrow]; + case "short": + return [...monthsShort]; + case "long": + return [...monthsLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } +} + +const weekdaysLong = [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", +]; + +const weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; + +const weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; + +function weekdays(length) { + switch (length) { + case "narrow": + return [...weekdaysNarrow]; + case "short": + return [...weekdaysShort]; + case "long": + return [...weekdaysLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } +} + +const meridiems = ["AM", "PM"]; + +const erasLong = ["Before Christ", "Anno Domini"]; + +const erasShort = ["BC", "AD"]; + +const erasNarrow = ["B", "A"]; + +function eras(length) { + switch (length) { + case "narrow": + return [...erasNarrow]; + case "short": + return [...erasShort]; + case "long": + return [...erasLong]; + default: + return null; + } +} + +function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; +} + +function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; +} + +function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; +} + +function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; +} + +function formatRelativeTime(unit, count, numeric = "always", narrow = false) { + const units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."], + }; + + const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + + if (numeric === "auto" && lastable) { + const isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : `next ${units[unit][0]}`; + case -1: + return isDay ? "yesterday" : `last ${units[unit][0]}`; + case 0: + return isDay ? "today" : `this ${units[unit][0]}`; + } + } + + const isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow + ? singular + ? lilUnits[1] + : lilUnits[2] || lilUnits[1] + : singular + ? units[unit][0] + : unit; + return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`; +} + +function stringifyTokens(splits, tokenToString) { + let s = ""; + for (const token of splits) { + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; +} + +const macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS, +}; + +/** + * @private + */ + +class Formatter { + static create(locale, opts = {}) { + return new Formatter(locale, opts); + } + + static parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + let current = null, + currentFull = "", + bracketed = false; + const splits = []; + for (let i = 0; i < fmt.length; i++) { + const c = fmt.charAt(i); + if (c === "'") { + if (currentFull.length > 0) { + splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ literal: /^\s+$/.test(currentFull), val: currentFull }); + } + currentFull = c; + current = c; + } + } + + if (currentFull.length > 0) { + splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull }); + } + + return splits; + } + + static macroTokenToFormatOpts(token) { + return macroTokenToFormatOpts[token]; + } + + constructor(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + + formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts }); + return df.format(); + } + + dtFormatter(dt, opts = {}) { + return this.loc.dtFormatter(dt, { ...this.opts, ...opts }); + } + + formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + } + + formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + } + + formatInterval(interval, opts) { + const df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + } + + resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + } + + num(n, p = 0) { + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + + const opts = { ...this.opts }; + + if (p > 0) { + opts.padTo = p; + } + + return this.loc.numberFormatter(opts).format(n); + } + + formatDateTimeFromString(dt, fmt) { + const knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = (opts, extract) => this.loc.extract(dt, opts, extract), + formatOffset = (opts) => { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = () => + knownEnglish + ? meridiemForDateTime(dt) + : string({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), + month = (length, standalone) => + knownEnglish + ? monthForDateTime(dt, length) + : string(standalone ? { month: length } : { month: length, day: "numeric" }, "month"), + weekday = (length, standalone) => + knownEnglish + ? weekdayForDateTime(dt, length) + : string( + standalone ? { weekday: length } : { weekday: length, month: "long", day: "numeric" }, + "weekday" + ), + maybeMacro = (token) => { + const formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = (length) => + knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, "era"), + tokenToString = (token) => { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return this.num(dt.millisecond, 3); + // seconds + case "s": + return this.num(dt.second); + case "ss": + return this.num(dt.second, 2); + // fractional seconds + case "uu": + return this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return this.num(dt.minute); + case "mm": + return this.num(dt.minute, 2); + // hours + case "h": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return this.num(dt.hour); + case "HH": + return this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ format: "narrow", allowZ: this.opts.allowZ }); + case "ZZ": + // like +06:00 + return formatOffset({ format: "short", allowZ: this.opts.allowZ }); + case "ZZZ": + // like +0600 + return formatOffset({ format: "techie", allowZ: this.opts.allowZ }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter + ? string({ month: "numeric", day: "numeric" }, "month") + : this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter + ? string({ month: "2-digit", day: "numeric" }, "month") + : this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter + ? string({ month: "numeric" }, "month") + : this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter + ? string({ month: "2-digit" }, "month") + : this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter + ? string({ year: "2-digit" }, "year") + : this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter + ? string({ year: "numeric" }, "year") + : this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter + ? string({ year: "numeric" }, "year") + : this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return this.num(dt.weekYear, 4); + case "W": + return this.num(dt.weekNumber); + case "WW": + return this.num(dt.weekNumber, 2); + case "n": + return this.num(dt.localWeekNumber); + case "nn": + return this.num(dt.localWeekNumber, 2); + case "ii": + return this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return this.num(dt.localWeekYear, 4); + case "o": + return this.num(dt.ordinal); + case "ooo": + return this.num(dt.ordinal, 3); + case "q": + // like 1 + return this.num(dt.quarter); + case "qq": + // like 01 + return this.num(dt.quarter, 2); + case "X": + return this.num(Math.floor(dt.ts / 1000)); + case "x": + return this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + } + + formatDurationFromString(dur, fmt) { + const tokenToField = (token) => { + switch (token[0]) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + return "hour"; + case "d": + return "day"; + case "w": + return "week"; + case "M": + return "month"; + case "y": + return "year"; + default: + return null; + } + }, + tokenToString = (lildur) => (token) => { + const mapped = tokenToField(token); + if (mapped) { + return this.num(lildur.get(mapped), token.length); + } else { + return token; + } + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce( + (found, { literal, val }) => (literal ? found : found.concat(val)), + [] + ), + collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)); + return stringifyTokens(tokens, tokenToString(collapsed)); + } +} + +/* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + +const ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; + +function combineRegexes(...regexes) { + const full = regexes.reduce((f, r) => f + r.source, ""); + return RegExp(`^${full}$`); +} + +function combineExtractors(...extractors) { + return (m) => + extractors + .reduce( + ([mergedVals, mergedZone, cursor], ex) => { + const [val, zone, next] = ex(m, cursor); + return [{ ...mergedVals, ...val }, zone || mergedZone, next]; + }, + [{}, null, 1] + ) + .slice(0, 2); +} + +function parse(s, ...patterns) { + if (s == null) { + return [null, null]; + } + + for (const [regex, extractor] of patterns) { + const m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; +} + +function simpleParse(...keys) { + return (match, cursor) => { + const ret = {}; + let i; + + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; +} + +// ISO and SQL parsing +const offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/; +const isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`; +const isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; +const isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`); +const isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`); +const isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; +const isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; +const isoOrdinalRegex = /(\d{4})-?(\d{3})/; +const extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); +const extractISOOrdinalData = simpleParse("year", "ordinal"); +const sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one +const sqlTimeRegex = RegExp( + `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?` +); +const sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`); + +function int(match, pos, fallback) { + const m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); +} + +function extractISOYmd(match, cursor) { + const item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1), + }; + + return [item, null, cursor + 3]; +} + +function extractISOTime(match, cursor) { + const item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]), + }; + + return [item, null, cursor + 4]; +} + +function extractISOOffset(match, cursor) { + const local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; +} + +function extractIANAZone(match, cursor) { + const zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; +} + +// ISO time parsing + +const isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`); + +// ISO duration parsing + +const isoDuration = + /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; + +function extractISODuration(match) { + const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = + match; + + const hasNegativePrefix = s[0] === "-"; + const negativeSeconds = secondStr && secondStr[0] === "-"; + + const maybeNegate = (num, force = false) => + num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num; + + return [ + { + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds), + }, + ]; +} + +// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York +// and not just that we're in -240 *right now*. But since I don't think these are used that often +// I'm just going to ignore that +const obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60, +}; + +function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + const result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr), + }; + + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = + weekdayStr.length > 3 + ? weekdaysLong.indexOf(weekdayStr) + 1 + : weekdaysShort.indexOf(weekdayStr) + 1; + } + + return result; +} + +// RFC 2822/5322 +const rfc2822 = + /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; + +function extractRFC2822(match) { + const [ + , + weekdayStr, + dayStr, + monthStr, + yearStr, + hourStr, + minuteStr, + secondStr, + obsOffset, + milOffset, + offHourStr, + offMinuteStr, + ] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + + let offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + + return [result, new FixedOffsetZone(offset)]; +} + +function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s + .replace(/\([^()]*\)|[\n\t]/g, " ") + .replace(/(\s\s+)/g, " ") + .trim(); +} + +// http date + +const rfc1123 = + /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = + /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = + /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; + +function extractRFC1123Or850(match) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} + +function extractASCII(match) { + const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} + +const isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); +const isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); +const isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); +const isoTimeCombinedRegex = combineRegexes(isoTimeRegex); + +const extractISOYmdTimeAndOffset = combineExtractors( + extractISOYmd, + extractISOTime, + extractISOOffset, + extractIANAZone +); +const extractISOWeekTimeAndOffset = combineExtractors( + extractISOWeekData, + extractISOTime, + extractISOOffset, + extractIANAZone +); +const extractISOOrdinalDateAndTime = combineExtractors( + extractISOOrdinalData, + extractISOTime, + extractISOOffset, + extractIANAZone +); +const extractISOTimeAndOffset = combineExtractors( + extractISOTime, + extractISOOffset, + extractIANAZone +); + +/* + * @private + */ + +function parseISODate(s) { + return parse( + s, + [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], + [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], + [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], + [isoTimeCombinedRegex, extractISOTimeAndOffset] + ); +} + +function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); +} + +function parseHTTPDate(s) { + return parse( + s, + [rfc1123, extractRFC1123Or850], + [rfc850, extractRFC1123Or850], + [ascii, extractASCII] + ); +} + +function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); +} + +const extractISOTimeOnly = combineExtractors(extractISOTime); + +function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); +} + +const sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); +const sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); + +const extractISOTimeOffsetAndIANAZone = combineExtractors( + extractISOTime, + extractISOOffset, + extractIANAZone +); + +function parseSQL(s) { + return parse( + s, + [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], + [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone] + ); +} + +const INVALID$2 = "Invalid Duration"; + +// unit conversion constants +const lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000, + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000, + }, + hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 }, + minutes: { seconds: 60, milliseconds: 60 * 1000 }, + seconds: { milliseconds: 1000 }, + }, + casualMatrix = { + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000, + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000, + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000, + }, + + ...lowOrderMatrix, + }, + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = { + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000, + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: (daysInYearAccurate * 24) / 4, + minutes: (daysInYearAccurate * 24 * 60) / 4, + seconds: (daysInYearAccurate * 24 * 60 * 60) / 4, + milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4, + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000, + }, + ...lowOrderMatrix, + }; + +// units ordered by size +const orderedUnits$1 = [ + "years", + "quarters", + "months", + "weeks", + "days", + "hours", + "minutes", + "seconds", + "milliseconds", +]; + +const reverseUnits = orderedUnits$1.slice(0).reverse(); + +// clone really means "create another instance just like this one, but with these changes" +function clone$1(dur, alts, clear = false) { + // deep merge for vals + const conf = { + values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) }, + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix, + }; + return new Duration(conf); +} + +function durationToMillis(matrix, vals) { + let sum = vals.milliseconds ?? 0; + for (const unit of reverseUnits.slice(1)) { + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; +} + +// NB: mutates parameters +function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + + orderedUnits$1.reduceRight((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const previousVal = vals[previous] * factor; + const conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + const rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); +} + +// Remove all properties with a value of 0 from an object +function removeZeroes(vals) { + const newVals = {}; + for (const [key, value] of Object.entries(vals)) { + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; +} + +/** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ +class Duration { + /** + * @private + */ + constructor(config) { + const accurate = config.conversionAccuracy === "longterm" || false; + let matrix = accurate ? accurateMatrix : casualMatrix; + + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + static fromMillis(count, opts) { + return Duration.fromObject({ milliseconds: count }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */ + static fromObject(obj, opts = {}) { + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError( + `Duration.fromObject: argument expected to be an object, got ${ + obj === null ? "null" : typeof obj + }` + ); + } + + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix, + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */ + static fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError( + `Unknown duration argument ${durationLike} of type ${typeof durationLike}` + ); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */ + static fromISO(text, opts) { + const [parsed] = parseISODuration(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */ + static fromISOTime(text, opts) { + const [parsed] = parseISOTimeOnly(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ invalid }); + } + } + + /** + * @private + */ + static normalizeUnit(unit) { + const normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds", + }[unit ? unit.toLowerCase() : unit]; + + if (!normalized) throw new InvalidUnitError(unit); + + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDuration(o) { + return (o && o.isLuxonDuration) || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @return {string} + */ + toFormat(fmt, opts = {}) { + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + const fmtOpts = { + ...opts, + floor: opts.round !== false && opts.floor !== false, + }; + return this.isValid + ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) + : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @example + * ```js + * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' + * ``` + */ + toHuman(opts = {}) { + if (!this.isValid) return INVALID$2; + + const l = orderedUnits$1 + .map((unit) => { + const val = this.values[unit]; + if (isUndefined(val)) { + return null; + } + return this.loc + .numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) }) + .format(val); + }) + .filter((n) => n); + + return this.loc + .listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }) + .format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */ + toObject() { + if (!this.isValid) return {}; + return { ...this.values }; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */ + toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + + let s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) + s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */ + toISOTime(opts = {}) { + if (!this.isValid) return null; + + const millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + + opts = { + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended", + ...opts, + includeOffset: false, + }; + + const dateTime = DateTime.fromMillis(millis, { zone: "UTC" }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */ + toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Duration { values: ${JSON.stringify(this.values)} }`; + } else { + return `Duration { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */ + toMillis() { + if (!this.isValid) return NaN; + + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + plus(duration) { + if (!this.isValid) return this; + + const dur = Duration.fromDurationLike(duration), + result = {}; + + for (const k of orderedUnits$1) { + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + + return clone$1(this, { values: result }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + minus(duration) { + if (!this.isValid) return this; + + const dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */ + mapUnits(fn) { + if (!this.isValid) return this; + const result = {}; + for (const k of Object.keys(this.values)) { + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { values: result }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */ + get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */ + set(values) { + if (!this.isValid) return this; + + const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) }; + return clone$1(this, { values: mixed }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */ + reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) { + const loc = this.loc.clone({ locale, numberingSystem }); + const opts = { loc, matrix, conversionAccuracy }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */ + as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */ + normalize() { + if (!this.isValid) return this; + const vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { values: vals }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */ + rescale() { + if (!this.isValid) return this; + const vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { values: vals }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */ + shiftTo(...units) { + if (!this.isValid) return this; + + if (units.length === 0) { + return this; + } + + units = units.map((u) => Duration.normalizeUnit(u)); + + const built = {}, + accumulated = {}, + vals = this.toObject(); + let lastUnit; + + for (const k of orderedUnits$1) { + if (units.indexOf(k) >= 0) { + lastUnit = k; + + let own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (const ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + const i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (const key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += + key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + + normalizeValues(this.matrix, built); + return clone$1(this, { values: built }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */ + shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo( + "years", + "months", + "weeks", + "days", + "hours", + "minutes", + "seconds", + "milliseconds" + ); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */ + negate() { + if (!this.isValid) return this; + const negated = {}; + for (const k of Object.keys(this.values)) { + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { values: negated }, true); + } + + /** + * Get the years. + * @type {number} + */ + get years() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + get quarters() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + get months() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + get weeks() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + get days() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + get hours() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + get minutes() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + get seconds() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + get milliseconds() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + + if (!this.loc.equals(other.loc)) { + return false; + } + + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + + for (const u of orderedUnits$1) { + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + } +} + +const INVALID$1 = "Invalid Interval"; + +// checks if the start is equal to or before the end +function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid( + "end before start", + `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}` + ); + } else { + return null; + } +} + +/** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ +class Interval { + /** + * @private + */ + constructor(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ invalid }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */ + static fromDateTimes(start, end) { + const builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + + const validateError = validateStartEnd(builtStart, builtEnd); + + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd, + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static after(start, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static before(end, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */ + static fromISO(text, opts) { + const [s, e] = (text || "").split("/", 2); + if (s && e) { + let start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + + let end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + + if (startIsValid) { + const dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + const dur = Duration.fromISO(s, opts); + if (dur.isValid) { + return Interval.before(end, dur); + } + } + } + return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isInterval(o) { + return (o && o.isLuxonInterval) || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */ + get start() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval + * @type {DateTime} + */ + get end() { + return this.isValid ? this.e : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + get isValid() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + length(unit = "milliseconds") { + return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */ + count(unit = "milliseconds", opts) { + if (!this.isValid) return NaN; + const start = this.start.startOf(unit, opts); + let end; + if (opts?.useLocaleWeeks) { + end = this.end.reconfigure({ locale: start.locale }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */ + hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */ + isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */ + set({ start, end } = {}) { + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */ + splitAt(...dateTimes) { + if (!this.isValid) return []; + const sorted = dateTimes + .map(friendlyDateTime) + .filter((d) => this.contains(d)) + .sort((a, b) => a.toMillis() - b.toMillis()), + results = []; + let { s } = this, + i = 0; + + while (s < this.e) { + const added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */ + splitBy(duration) { + const dur = Duration.fromDurationLike(duration); + + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + + let { s } = this, + idx = 1, + next; + + const results = []; + while (s < this.e) { + const added = this.start.plus(dur.mapUnits((x) => x * idx)); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */ + divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */ + overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */ + abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */ + abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Return whether this Interval engulfs the start and end of the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */ + intersection(other) { + if (!this.isValid) return this; + const s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */ + union(other) { + if (!this.isValid) return this; + const s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into a equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * @param {Array} intervals + * @return {Array} + */ + static merge(intervals) { + const [found, final] = intervals + .sort((a, b) => a.s - b.s) + .reduce( + ([sofar, current], item) => { + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, + [[], null] + ); + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */ + static xor(intervals) { + let start = null, + currentCount = 0; + const results = [], + ends = intervals.map((i) => [ + { time: i.s, type: "s" }, + { time: i.e, type: "e" }, + ]), + flattened = Array.prototype.concat(...ends), + arr = flattened.sort((a, b) => a.time - b.time); + + for (const i of arr) { + currentCount += i.type === "s" ? 1 : -1; + + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + + start = null; + } + } + + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */ + difference(...intervals) { + return Interval.xor([this].concat(intervals)) + .map((i) => this.intersection(i)) + .filter((i) => i && !i.isEmpty()); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */ + toString() { + if (!this.isValid) return INVALID$1; + return `[${this.s.toISO()} – ${this.e.toISO()})`; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`; + } else { + return `Interval { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid + ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) + : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISO(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */ + toISODate() { + if (!this.isValid) return INVALID$1; + return `${this.s.toISODate()}/${this.e.toISODate()}`; + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */ + toFormat(dateFormat, { separator = " – " } = {}) { + if (!this.isValid) return INVALID$1; + return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */ + toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */ + mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + } +} + +/** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ +class Info { + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + static hasDST(zone = Settings.defaultZone) { + const proto = DateTime.now().setZone(zone).set({ month: 12 }); + + return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */ + static isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */ + static normalizeZone(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */ + static getStartOfWeek({ locale = null, locObj = null } = {}) { + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */ + static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) { + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */ + static getWeekendWeekdays({ locale = null, locObj = null } = {}) { + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */ + static months( + length = "long", + { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {} + ) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */ + static monthsFormat( + length = "long", + { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {} + ) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */ + static weekdays(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */ + static weekdaysFormat( + length = "long", + { locale = null, numberingSystem = null, locObj = null } = {} + ) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */ + static meridiems({ locale = null } = {}) { + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */ + static eras(length = "short", { locale = null } = {}) { + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */ + static features() { + return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() }; + } +} + +function dayDiff(earlier, later) { + const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); +} + +function highOrderDiffs(cursor, later, units) { + const differs = [ + ["years", (a, b) => b.year - a.year], + ["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4], + ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], + [ + "weeks", + (a, b) => { + const days = dayDiff(a, b); + return (days - (days % 7)) / 7; + }, + ], + ["days", dayDiff], + ]; + + const results = {}; + const earlier = cursor; + let lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (const [unit, differ] of differs) { + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + + return [cursor, results, highWater, lowestOrder]; +} + +function diff (earlier, later, units, opts) { + let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units); + + const remainingMillis = later - cursor; + + const lowerOrderUnits = units.filter( + (u) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0 + ); + + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + highWater = cursor.plus({ [lowestOrder]: 1 }); + } + + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + + const duration = Duration.fromObject(results, opts); + + if (lowerOrderUnits.length > 0) { + return Duration.fromMillis(remainingMillis, opts) + .shiftTo(...lowerOrderUnits) + .plus(duration); + } else { + return duration; + } +} + +const numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d", +}; + +const numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881], +}; + +const hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); + +function parseDigits(str) { + let value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (const key in numberingSystemsUTF16) { + const [min, max] = numberingSystemsUTF16[key]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } +} + +function digitRegex({ numberingSystem }, append = "") { + return new RegExp(`${numberingSystems[numberingSystem || "latn"]}${append}`); +} + +const MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; + +function intUnit(regex, post = (i) => i) { + return { regex, deser: ([s]) => post(parseDigits(s)) }; +} + +const NBSP = String.fromCharCode(160); +const spaceOrNBSP = `[ ${NBSP}]`; +const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); + +function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); +} + +function stripInsensitivities(s) { + return s + .replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); +} + +function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: ([s]) => + strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex, + }; + } +} + +function offset(regex, groups) { + return { regex, deser: ([, h, m]) => signedOffset(h, m), groups }; +} + +function simple(regex) { + return { regex, deser: ([s]) => s }; +} + +function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); +} + +/** + * @param token + * @param {Locale} loc + */ +function unitForToken(token, loc) { + const one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }), + unitate = (t) => { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); + case "ZZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + + const unit = unitate(token) || { + invalidReason: MISSING_FTP, + }; + + unit.token = token; + + return unit; +} + +const partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy", + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM", + }, + day: { + numeric: "d", + "2-digit": "dd", + }, + weekday: { + short: "EEE", + long: "EEEE", + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh", + }, + hour24: { + numeric: "H", + "2-digit": "HH", + }, + minute: { + numeric: "m", + "2-digit": "mm", + }, + second: { + numeric: "s", + "2-digit": "ss", + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ", + }, +}; + +function tokenForPart(part, formatOpts, resolvedOpts) { + const { type, value } = part; + + if (type === "literal") { + const isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value, + }; + } + + const style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + let actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + let val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + + if (val) { + return { + literal: false, + val, + }; + } + + return undefined; +} + +function buildRegex(units) { + const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, ""); + return [`^${re}$`, units]; +} + +function match(input, regex, handlers) { + const matches = input.match(regex); + + if (matches) { + const all = {}; + let matchIndex = 1; + for (const i in handlers) { + if (hasOwnProperty(handlers, i)) { + const h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } +} + +function dateTimeFromMatches(matches) { + const toField = (token) => { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + + let zone = null; + let specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + + const vals = Object.keys(matches).reduce((r, k) => { + const f = toField(k); + if (f) { + r[f] = matches[k]; + } + + return r; + }, {}); + + return [vals, zone, specificOffset]; +} + +let dummyDateTimeCache = null; + +function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + + return dummyDateTimeCache; +} + +function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + + const formatOpts = Formatter.macroTokenToFormatOpts(token.val); + const tokens = formatOptsToTokens(formatOpts, locale); + + if (tokens == null || tokens.includes(undefined)) { + return token; + } + + return tokens; +} + +function expandMacroTokens(tokens, locale) { + return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale))); +} + +/** + * @private + */ + +function explainFromTokens(locale, input, format) { + const tokens = expandMacroTokens(Formatter.parseFormat(format), locale), + units = tokens.map((t) => unitForToken(t, locale)), + disqualifyingUnit = units.find((t) => t.invalidReason); + + if (disqualifyingUnit) { + return { input, tokens, invalidReason: disqualifyingUnit.invalidReason }; + } else { + const [regexString, handlers] = buildRegex(units), + regex = RegExp(regexString, "i"), + [rawMatches, matches] = match(input, regex, handlers), + [result, zone, specificOffset] = matches + ? dateTimeFromMatches(matches) + : [null, null, undefined]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError( + "Can't include meridiem when specifying 24-hour format" + ); + } + return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset }; + } +} + +function parseFromTokens(locale, input, format) { + const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format); + return [result, zone, specificOffset, invalidReason]; +} + +function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + + const formatter = Formatter.create(locale, formatOpts); + const df = formatter.dtFormatter(getDummyDateTime()); + const parts = df.formatToParts(); + const resolvedOpts = df.resolvedOptions(); + return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts)); +} + +const INVALID = "Invalid DateTime"; +const MAX_DATE = 8.64e15; + +function unsupportedZone(zone) { + return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`); +} + +// we cache week data on the DT object and this intermediates the cache +/** + * @param {DateTime} dt + */ +function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; +} + +/** + * @param {DateTime} dt + */ +function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek( + dt.c, + dt.loc.getMinDaysInFirstWeek(), + dt.loc.getStartOfWeek() + ); + } + return dt.localWeekData; +} + +// clone really means, "make a new object with these modifications". all "setters" really use this +// to create a new object while only changing some of the properties +function clone(inst, alts) { + const current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid, + }; + return new DateTime({ ...current, ...alts, old: current }); +} + +// find the right offset a given local time. The o input is our guess, which determines which +// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) +function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + let utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + const o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + const o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; +} + +// convert an epoch timestamp into a calendar object with the given offset +function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + + const d = new Date(ts); + + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds(), + }; +} + +// convert a calendar object to a epoch timestamp +function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); +} + +// create a new DT instance by adding a duration, adjusting for DSTs +function adjustTime(inst, dur) { + const oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = { + ...inst.c, + year, + month, + day: + Math.min(inst.c.day, daysInMonth(year, month)) + + Math.trunc(dur.days) + + Math.trunc(dur.weeks) * 7, + }, + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds, + }).as("milliseconds"), + localTS = objToLocalTS(c); + + let [ts, o] = fixOffset(localTS, oPre, inst.zone); + + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + + return { ts, o }; +} + +// helper useful in turning the results of parsing into real dates +// by handling the zone options +function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + const { setZone, zone } = opts; + if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) { + const interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, { + ...opts, + zone: interpretationZone, + specificOffset, + }); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid( + new Invalid("unparsable", `the input "${text}" can't be parsed as ${format}`) + ); + } +} + +// if you want to output a technical format (e.g. RFC 2822), this helper +// helps handle the details +function toTechFormat(dt, format, allowZ = true) { + return dt.isValid + ? Formatter.create(Locale.create("en-US"), { + allowZ, + forceSimple: true, + }).formatDateTimeFromString(dt, format) + : null; +} + +function toISODate(o, extended) { + const longFormat = o.c.year > 9999 || o.c.year < 0; + let c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + + if (extended) { + c += "-"; + c += padStart(o.c.month); + c += "-"; + c += padStart(o.c.day); + } else { + c += padStart(o.c.month); + c += padStart(o.c.day); + } + return c; +} + +function toISOTime( + o, + extended, + suppressSeconds, + suppressMilliseconds, + includeOffset, + extendedZone +) { + let c = padStart(o.c.hour); + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += ":"; + } + } else { + c += padStart(o.c.minute); + } + + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += padStart(o.c.second); + + if (o.c.millisecond !== 0 || !suppressMilliseconds) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; +} + +// defaults for unspecified units in the supported calendars +const defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + }; + +// Units in the supported calendars, sorted by bigness +const orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = [ + "weekYear", + "weekNumber", + "weekday", + "hour", + "minute", + "second", + "millisecond", + ], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + +// standardize case and plurality in units +function normalizeUnit(unit) { + const normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal", + }[unit.toLowerCase()]; + + if (!normalized) throw new InvalidUnitError(unit); + + return normalized; +} + +function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } +} + +// this is a dumbed down version of fromObject() that runs about 60% faster +// but doesn't do any validation, makes a bunch of assumptions about what units +// are present, and so on. +function quickDT(obj, opts) { + const zone = normalizeZone(opts.zone, Settings.defaultZone), + loc = Locale.fromObject(opts), + tsNow = Settings.now(); + + let ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (const u of orderedUnits) { + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + + const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + + const offsetProvis = zone.offset(tsNow); + [ts, o] = objToTS(obj, offsetProvis, zone); + } else { + ts = tsNow; + } + + return new DateTime({ ts, zone, loc, o }); +} + +function diffRelative(start, end, opts) { + const round = isUndefined(opts.round) ? true : opts.round, + format = (c, unit) => { + c = roundTo(c, round || opts.calendary ? 0 : 2, true); + const formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = (unit) => { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + + for (const unit of opts.units) { + const count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); +} + +function lastOpts(argList) { + let opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; +} + +/** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ +class DateTime { + /** + * @access private + */ + constructor(config) { + const zone = config.zone || Settings.defaultZone; + + let invalid = + config.invalid || + (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || + (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + + let c = null, + o = null; + if (!invalid) { + const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + + if (unchanged) { + [c, o] = [config.old.c, config.old.o]; + } else { + const ot = zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + static now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */ + static local() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + return quickDT({ year, month, day, hour, minute, second, millisecond }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */ + static utc() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ year, month, day, hour, minute, second, millisecond }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */ + static fromJSDate(date, options = {}) { + const ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + + const zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options), + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromMillis(milliseconds, options = {}) { + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError( + `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}` + ); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options), + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromSeconds(seconds, options = {}) { + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options), + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */ + static fromObject(obj, opts = {}) { + obj = obj || {}; + const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + + const loc = Locale.fromObject(opts); + const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc); + + const tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) + ? opts.specificOffset + : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError( + "Can't mix weekYear/weekNumber units with year/month/day or ordinals" + ); + } + + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + + const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor); + + // configure ourselves to deal with gregorian dates or week stuff + let units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + let foundFirst = false; + for (const u of units) { + const v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + const higherOrderInvalid = useWeekData + ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) + : containsOrdinal + ? hasInvalidOrdinalData(normalized) + : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + const gregorian = useWeekData + ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) + : containsOrdinal + ? ordinalToGregorian(normalized) + : normalized, + [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc, + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid( + "mismatched weekday", + `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}` + ); + } + + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */ + static fromISO(text, opts = {}) { + const [vals, parsedZone] = parseISODate(text); + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */ + static fromRFC2822(text, opts = {}) { + const [vals, parsedZone] = parseRFC2822Date(text); + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */ + static fromHTTP(text, opts = {}) { + const [vals, parsedZone] = parseHTTPDate(text); + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromFormat(text, fmt, opts = {}) { + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + + const { locale = null, numberingSystem = null } = opts, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true, + }), + [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt); + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */ + static fromString(text, fmt, opts = {}) { + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */ + static fromSQL(text, opts = {}) { + const [vals, parsedZone] = parseSQL(text); + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ invalid }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDateTime(o) { + return (o && o.isLuxonDateTime) || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */ + static parseFormatForOpts(formatOpts, localeOpts = {}) { + const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */ + static expandFormat(fmt, localeOpts = {}) { + const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map((t) => t.val).join(""); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */ + get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + get outputCalendar() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + get zone() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + get zoneName() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + get year() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + get quarter() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + get month() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + get day() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + get hour() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + get minute() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + get second() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + get millisecond() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + get weekYear() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + get weekNumber() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + get weekday() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + get isWeekend() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + get localWeekday() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + get localWeekNumber() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + get localWeekYear() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + get ordinal() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + get monthShort() { + return this.isValid ? Info.months("short", { locObj: this.loc })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + get monthLong() { + return this.isValid ? Info.months("long", { locObj: this.loc })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + get weekdayShort() { + return this.isValid ? Info.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + get weekdayLong() { + return this.isValid ? Info.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + get offset() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameShort() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale, + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameLong() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale, + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + get isOffsetFixed() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + get isInDST() { + if (this.isOffsetFixed) { + return false; + } else { + return ( + this.offset > this.set({ month: 1, day: 1 }).offset || + this.offset > this.set({ month: 5 }).offset + ); + } + } + + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + const dayMs = 86400000; + const minuteMs = 60000; + const localTS = objToLocalTS(this.c); + const oEarlier = this.zone.offset(localTS - dayMs); + const oLater = this.zone.offset(localTS + dayMs); + + const o1 = this.zone.offset(localTS - oEarlier * minuteMs); + const o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + const ts1 = localTS - o1 * minuteMs; + const ts2 = localTS - o2 * minuteMs; + const c1 = tsToObj(ts1, o1); + const c2 = tsToObj(ts2, o2); + if ( + c1.hour === c2.hour && + c1.minute === c2.minute && + c1.second === c2.second && + c1.millisecond === c2.millisecond + ) { + return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */ + get isInLeapYear() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + get daysInMonth() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + get daysInYear() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + get weeksInWeekYear() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + get weeksInLocalWeekYear() { + return this.isValid + ? weeksInWeekYear( + this.localWeekYear, + this.loc.getMinDaysInFirstWeek(), + this.loc.getStartOfWeek() + ) + : NaN; + } + + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + resolvedLocaleOptions(opts = {}) { + const { locale, numberingSystem, calendar } = Formatter.create( + this.loc.clone(opts), + opts + ).resolvedOptions(this); + return { locale, numberingSystem, outputCalendar: calendar }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */ + toUTC(offset = 0, opts = {}) { + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */ + toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */ + setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) { + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + let newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + const offsetGuess = zone.offset(this.ts); + const asObj = this.toObject(); + [newTS] = objToTS(asObj, offsetGuess, zone); + } + return clone(this, { ts: newTS, zone }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */ + reconfigure({ locale, numberingSystem, outputCalendar } = {}) { + const loc = this.loc.clone({ locale, numberingSystem, outputCalendar }); + return clone(this, { loc }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */ + setLocale(locale) { + return this.reconfigure({ locale }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */ + set(values) { + if (!this.isValid) return this; + + const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc); + + const settingWeekStuff = + !isUndefined(normalized.weekYear) || + !isUndefined(normalized.weekNumber) || + !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError( + "Can't mix weekYear/weekNumber units with year/month/day or ordinals" + ); + } + + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + + let mixed; + if (settingWeekStuff) { + mixed = weekToGregorian( + { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized }, + minDaysInFirstWeek, + startOfWeek + ); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized }); + } else { + mixed = { ...this.toObject(), ...normalized }; + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + + const [ts, o] = objToTS(mixed, this.o, this.zone); + return clone(this, { ts, o }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */ + plus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */ + minus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */ + startOf(unit, { useLocaleWeeks = false } = {}) { + if (!this.isValid) return this; + + const o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + const startOfWeek = this.loc.getStartOfWeek(); + const { weekday } = this; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + + if (normalizedUnit === "quarters") { + const q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */ + endOf(unit, opts) { + return this.isValid + ? this.plus({ [unit]: 1 }) + .startOf(unit, opts) + .minus(1) + : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */ + toFormat(fmt, opts = {}) { + return this.isValid + ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) + : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid + ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) + : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */ + toLocaleParts(opts = {}) { + return this.isValid + ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) + : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @return {string} + */ + toISO({ + format = "extended", + suppressSeconds = false, + suppressMilliseconds = false, + includeOffset = true, + extendedZone = false, + } = {}) { + if (!this.isValid) { + return null; + } + + const ext = format === "extended"; + + let c = toISODate(this, ext); + c += "T"; + c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @return {string} + */ + toISODate({ format = "extended" } = {}) { + if (!this.isValid) { + return null; + } + + return toISODate(this, format === "extended"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */ + toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @return {string} + */ + toISOTime({ + suppressMilliseconds = false, + suppressSeconds = false, + includeOffset = true, + includePrefix = false, + extendedZone = false, + format = "extended", + } = {}) { + if (!this.isValid) { + return null; + } + + let c = includePrefix ? "T" : ""; + return ( + c + + toISOTime( + this, + format === "extended", + suppressSeconds, + suppressMilliseconds, + includeOffset, + extendedZone + ) + ); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */ + toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */ + toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string} + */ + toSQLDate() { + if (!this.isValid) { + return null; + } + return toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */ + toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) { + let fmt = "HH:mm:ss.SSS"; + + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */ + toSQL(opts = {}) { + if (!this.isValid) { + return null; + } + + return `${this.toSQLDate()} ${this.toSQLTime(opts)}`; + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */ + toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`; + } else { + return `DateTime { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */ + toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds of this DateTime. + * @return {number} + */ + toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */ + toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */ + toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */ + toObject(opts = {}) { + if (!this.isValid) return {}; + + const base = { ...this.c }; + + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */ + toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */ + diff(otherDateTime, unit = "milliseconds", opts = {}) { + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + + const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts }; + + const units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = diff(earlier, later, units, durOpts); + + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + diffNow(unit = "milliseconds", opts = {}) { + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval} + */ + until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */ + hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + + const inputMs = otherDateTime.valueOf(); + const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true }); + return ( + adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts) + ); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */ + equals(other) { + return ( + this.isValid && + other.isValid && + this.valueOf() === other.valueOf() && + this.zone.equals(other.zone) && + this.loc.equals(other.loc) + ); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds down by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */ + toRelative(options = {}) { + if (!this.isValid) return null; + const base = options.base || DateTime.fromObject({}, { zone: this.zone }), + padding = options.padding ? (this < base ? -options.padding : options.padding) : 0; + let units = ["years", "months", "days", "hours", "minutes", "seconds"]; + let unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), { + ...options, + numeric: "always", + units, + unit, + }); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */ + toRelativeCalendar(options = {}) { + if (!this.isValid) return null; + + return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, { + ...options, + numeric: "auto", + units: ["years", "months", "days"], + calendary: true, + }); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */ + static min(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, (i) => i.valueOf(), Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */ + static max(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, (i) => i.valueOf(), Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */ + static fromFormatExplain(text, fmt, options = {}) { + const { locale = null, numberingSystem = null } = options, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true, + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */ + static fromStringExplain(text, fmt, options = {}) { + return DateTime.fromFormatExplain(text, fmt, options); + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */ + static get DATE_SHORT() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED_WITH_WEEKDAY() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + static get DATE_FULL() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + static get DATE_HUGE() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_SIMPLE() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SECONDS() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SHORT_OFFSET() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_LONG_OFFSET() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + static get TIME_24_SIMPLE() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SECONDS() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SHORT_OFFSET() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_LONG_OFFSET() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT_WITH_SECONDS() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_SECONDS() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_WEEKDAY() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL_WITH_SECONDS() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE_WITH_SECONDS() { + return DATETIME_HUGE_WITH_SECONDS; + } +} + +/** + * @private + */ +function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError( + `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}` + ); + } +} + +const VERSION = "3.4.4"; + +export { DateTime, Duration, FixedOffsetZone, IANAZone, Info, Interval, InvalidZone, Settings, SystemZone, VERSION, Zone }; +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/es6/luxon.js.map b/node_modules/luxon/build/es6/luxon.js.map new file mode 100644 index 0000000..558928e --- /dev/null +++ b/node_modules/luxon/build/es6/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/digits.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.4.4\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["singleton","English.formatRelativeTime","English.months","English.weekdays","English.meridiems","English.eras","Formats.DATE_SHORT","Formats.DATE_MED","Formats.DATE_FULL","Formats.DATE_HUGE","Formats.TIME_SIMPLE","Formats.TIME_WITH_SECONDS","Formats.TIME_WITH_SHORT_OFFSET","Formats.TIME_WITH_LONG_OFFSET","Formats.TIME_24_SIMPLE","Formats.TIME_24_WITH_SECONDS","Formats.TIME_24_WITH_SHORT_OFFSET","Formats.TIME_24_WITH_LONG_OFFSET","Formats.DATETIME_SHORT","Formats.DATETIME_MED","Formats.DATETIME_FULL","Formats.DATETIME_HUGE","Formats.DATETIME_SHORT_WITH_SECONDS","Formats.DATETIME_MED_WITH_SECONDS","Formats.DATETIME_FULL_WITH_SECONDS","Formats.DATETIME_HUGE_WITH_SECONDS","English.meridiemForDateTime","English.monthForDateTime","English.weekdayForDateTime","English.eraForDateTime","English.monthsShort","English.weekdaysLong","English.weekdaysShort","INVALID","orderedUnits","clone","Formats.DATE_MED_WITH_WEEKDAY","Formats.DATETIME_MED_WITH_WEEKDAY"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,SAAS,KAAK,CAAC,EAAE;AACjC;AACA;AACA;AACA;AACO,MAAM,oBAAoB,SAAS,UAAU,CAAC;AACrD,EAAE,WAAW,CAAC,MAAM,EAAE;AACtB,IAAI,KAAK,CAAC,CAAC,kBAAkB,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AACrD,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACO,MAAM,oBAAoB,SAAS,UAAU,CAAC;AACrD,EAAE,WAAW,CAAC,MAAM,EAAE;AACtB,IAAI,KAAK,CAAC,CAAC,kBAAkB,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AACrD,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACO,MAAM,oBAAoB,SAAS,UAAU,CAAC;AACrD,EAAE,WAAW,CAAC,MAAM,EAAE;AACtB,IAAI,KAAK,CAAC,CAAC,kBAAkB,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AACrD,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACO,MAAM,6BAA6B,SAAS,UAAU,CAAC,EAAE;AAChE;AACA;AACA;AACA;AACO,MAAM,gBAAgB,SAAS,UAAU,CAAC;AACjD,EAAE,WAAW,CAAC,IAAI,EAAE;AACpB,IAAI,KAAK,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAClC,GAAG;AACH,CAAC;A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AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,aAAa,GAAG;AAC7B,IAAI,OAAOH,aAAqB,CAAC;AACjC,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,0BAA0B,GAAG;AAC1C,IAAI,OAAOI,0BAAkC,CAAC;AAC9C,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,WAAW,EAAE;AAC9C,EAAE,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;AACxC,IAAI,OAAO,WAAW,CAAC;AACvB,GAAG,MAAM,IAAI,WAAW,IAAI,WAAW,CAAC,OAAO,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE;AACpF,IAAI,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC5C,GAAG,MAAM,IAAI,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;AAC7D,IAAI,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC5C,GAAG,MAAM;AACT,IAAI,MAAM,IAAI,oBAAoB;AAClC,MAAM,CAAC,2BAA2B,EAAE,WAAW,CAAC,UAAU,EAAE,OAAO,WAAW,CAAC,CAAC;AAChF,KAAK,CAAC;AACN,GAAG;AACH;;AC12EK,MAAC,OAAO,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/build/global/luxon.js b/node_modules/luxon/build/global/luxon.js new file mode 100644 index 0000000..659219a --- /dev/null +++ b/node_modules/luxon/build/global/luxon.js @@ -0,0 +1,8314 @@ +var luxon = (function (exports) { + 'use strict'; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } + function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + + // these aren't really private, but nor are they really useful to document + /** + * @private + */ + var LuxonError = /*#__PURE__*/function (_Error) { + _inheritsLoose(LuxonError, _Error); + function LuxonError() { + return _Error.apply(this, arguments) || this; + } + return LuxonError; + }( /*#__PURE__*/_wrapNativeSuper(Error)); + /** + * @private + */ + var InvalidDateTimeError = /*#__PURE__*/function (_LuxonError) { + _inheritsLoose(InvalidDateTimeError, _LuxonError); + function InvalidDateTimeError(reason) { + return _LuxonError.call(this, "Invalid DateTime: " + reason.toMessage()) || this; + } + return InvalidDateTimeError; + }(LuxonError); + + /** + * @private + */ + var InvalidIntervalError = /*#__PURE__*/function (_LuxonError2) { + _inheritsLoose(InvalidIntervalError, _LuxonError2); + function InvalidIntervalError(reason) { + return _LuxonError2.call(this, "Invalid Interval: " + reason.toMessage()) || this; + } + return InvalidIntervalError; + }(LuxonError); + + /** + * @private + */ + var InvalidDurationError = /*#__PURE__*/function (_LuxonError3) { + _inheritsLoose(InvalidDurationError, _LuxonError3); + function InvalidDurationError(reason) { + return _LuxonError3.call(this, "Invalid Duration: " + reason.toMessage()) || this; + } + return InvalidDurationError; + }(LuxonError); + + /** + * @private + */ + var ConflictingSpecificationError = /*#__PURE__*/function (_LuxonError4) { + _inheritsLoose(ConflictingSpecificationError, _LuxonError4); + function ConflictingSpecificationError() { + return _LuxonError4.apply(this, arguments) || this; + } + return ConflictingSpecificationError; + }(LuxonError); + + /** + * @private + */ + var InvalidUnitError = /*#__PURE__*/function (_LuxonError5) { + _inheritsLoose(InvalidUnitError, _LuxonError5); + function InvalidUnitError(unit) { + return _LuxonError5.call(this, "Invalid unit " + unit) || this; + } + return InvalidUnitError; + }(LuxonError); + + /** + * @private + */ + var InvalidArgumentError = /*#__PURE__*/function (_LuxonError6) { + _inheritsLoose(InvalidArgumentError, _LuxonError6); + function InvalidArgumentError() { + return _LuxonError6.apply(this, arguments) || this; + } + return InvalidArgumentError; + }(LuxonError); + + /** + * @private + */ + var ZoneIsAbstractError = /*#__PURE__*/function (_LuxonError7) { + _inheritsLoose(ZoneIsAbstractError, _LuxonError7); + function ZoneIsAbstractError() { + return _LuxonError7.call(this, "Zone is an abstract class") || this; + } + return ZoneIsAbstractError; + }(LuxonError); + + /** + * @private + */ + + var n = "numeric", + s = "short", + l = "long"; + var DATE_SHORT = { + year: n, + month: n, + day: n + }; + var DATE_MED = { + year: n, + month: s, + day: n + }; + var DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s + }; + var DATE_FULL = { + year: n, + month: l, + day: n + }; + var DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l + }; + var TIME_SIMPLE = { + hour: n, + minute: n + }; + var TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n + }; + var TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + var TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s + }; + var TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l + }; + var DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n + }; + var DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n + }; + var DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n + }; + var DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s + }; + var DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l + }; + var DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + + /** + * @interface + */ + var Zone = /*#__PURE__*/function () { + function Zone() {} + var _proto = Zone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */; + _createClass(Zone, [{ + key: "type", + get: + /** + * The type of zone + * @abstract + * @type {string} + */ + function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + }, { + key: "name", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "ianaName", + get: function get() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "isValid", + get: function get() { + throw new ZoneIsAbstractError(); + } + }]); + return Zone; + }(); + + var singleton$1 = null; + + /** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ + var SystemZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(SystemZone, _Zone); + function SystemZone() { + return _Zone.apply(this, arguments) || this; + } + var _proto = SystemZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/; + _createClass(SystemZone, [{ + key: "type", + get: /** @override **/ + function get() { + return "system"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "instance", + get: + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + function get() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + }]); + return SystemZone; + }(Zone); + + var dtfCache = {}; + function makeDTF(zone) { + if (!dtfCache[zone]) { + dtfCache[zone] = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zone, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + } + return dtfCache[zone]; + } + var typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 + }; + function hackyOffset(dtf, date) { + var formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + fMonth = parsed[1], + fDay = parsed[2], + fYear = parsed[3], + fadOrBc = parsed[4], + fHour = parsed[5], + fMinute = parsed[6], + fSecond = parsed[7]; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; + } + function partsOffset(dtf, date) { + var formatted = dtf.formatToParts(date); + var filled = []; + for (var i = 0; i < formatted.length; i++) { + var _formatted$i = formatted[i], + type = _formatted$i.type, + value = _formatted$i.value; + var pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; + } + var ianaZoneCache = {}; + /** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ + var IANAZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(IANAZone, _Zone); + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + IANAZone.create = function create(name) { + if (!ianaZoneCache[name]) { + ianaZoneCache[name] = new IANAZone(name); + } + return ianaZoneCache[name]; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */; + IANAZone.resetCache = function resetCache() { + ianaZoneCache = {}; + dtfCache = {}; + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated This method returns false for some valid IANA names. Use isValidZone instead. + * @return {boolean} + */; + IANAZone.isValidSpecifier = function isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */; + IANAZone.isValidZone = function isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + }; + function IANAZone(name) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.zoneName = name; + /** @private **/ + _this.valid = IANAZone.isValidZone(name); + return _this; + } + + /** @override **/ + var _proto = IANAZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale, this.name); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + var date = new Date(ts); + if (isNaN(date)) return NaN; + var dtf = makeDTF(this.name); + var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date), + year = _ref2[0], + month = _ref2[1], + day = _ref2[2], + adOrBc = _ref2[3], + hour = _ref2[4], + minute = _ref2[5], + second = _ref2[6]; + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + var adjustedHour = hour === 24 ? 0 : hour; + var asUTC = objToLocalTS({ + year: year, + month: month, + day: day, + hour: adjustedHour, + minute: minute, + second: second, + millisecond: 0 + }); + var asTS = +date; + var over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** @override **/; + _createClass(IANAZone, [{ + key: "type", + get: function get() { + return "iana"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return this.valid; + } + }]); + return IANAZone; + }(Zone); + + var _excluded = ["base"], + _excluded2 = ["padTo", "floor"]; + + // todo - remap caching + + var intlLFCache = {}; + function getCachedLF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; + } + var intlDTCache = {}; + function getCachedDTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlDTCache[key]; + if (!dtf) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache[key] = dtf; + } + return dtf; + } + var intlNumCache = {}; + function getCachedINF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var inf = intlNumCache[key]; + if (!inf) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache[key] = inf; + } + return inf; + } + var intlRelCache = {}; + function getCachedRTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var _opts = opts; + _opts.base; + var cacheKeyOpts = _objectWithoutPropertiesLoose(_opts, _excluded); // exclude `base` from the options + var key = JSON.stringify([locString, cacheKeyOpts]); + var inf = intlRelCache[key]; + if (!inf) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache[key] = inf; + } + return inf; + } + var sysLocaleCache = null; + function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } + } + var weekInfoCache = {}; + function getCachedWeekInfo(locString) { + var data = weekInfoCache[locString]; + if (!data) { + var locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + weekInfoCache[locString] = data; + } + return data; + } + function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + var xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + var uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + var options; + var selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + var smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + var _options = options, + numberingSystem = _options.numberingSystem, + calendar = _options.calendar; + return [selectedStr, numberingSystem, calendar]; + } + } + function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += "-ca-" + outputCalendar; + } + if (numberingSystem) { + localeStr += "-nu-" + numberingSystem; + } + return localeStr; + } else { + return localeStr; + } + } + function mapMonths(f) { + var ms = []; + for (var i = 1; i <= 12; i++) { + var dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; + } + function mapWeekdays(f) { + var ms = []; + for (var i = 1; i <= 7; i++) { + var dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; + } + function listStuff(loc, length, englishFn, intlFn) { + var mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } + } + function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn"; + } + } + + /** + * @private + */ + var PolyNumberFormatter = /*#__PURE__*/function () { + function PolyNumberFormatter(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + opts.padTo; + opts.floor; + var otherOpts = _objectWithoutPropertiesLoose(opts, _excluded2); + if (!forceSimple || Object.keys(otherOpts).length > 0) { + var intlOpts = _extends({ + useGrouping: false + }, opts); + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + var _proto = PolyNumberFormatter.prototype; + _proto.format = function format(i) { + if (this.inf) { + var fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + var _fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(_fixed, this.padTo); + } + }; + return PolyNumberFormatter; + }(); + /** + * @private + */ + var PolyDateFormatter = /*#__PURE__*/function () { + function PolyDateFormatter(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + var z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + var gmtOffset = -1 * (dt.offset / 60); + var offsetZ = gmtOffset >= 0 ? "Etc/GMT+" + gmtOffset : "Etc/GMT" + gmtOffset; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + var intlOpts = _extends({}, this.opts); + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + var _proto2 = PolyDateFormatter.prototype; + _proto2.format = function format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(function (_ref) { + var value = _ref.value; + return value; + }).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + }; + _proto2.formatToParts = function formatToParts() { + var _this = this; + var parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(function (part) { + if (part.type === "timeZoneName") { + var offsetName = _this.originalZone.offsetName(_this.dt.ts, { + locale: _this.dt.locale, + format: _this.opts.timeZoneName + }); + return _extends({}, part, { + value: offsetName + }); + } else { + return part; + } + }); + } + return parts; + }; + _proto2.resolvedOptions = function resolvedOptions() { + return this.dtf.resolvedOptions(); + }; + return PolyDateFormatter; + }(); + /** + * @private + */ + var PolyRelFormatter = /*#__PURE__*/function () { + function PolyRelFormatter(intl, isEnglish, opts) { + this.opts = _extends({ + style: "long" + }, opts); + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + var _proto3 = PolyRelFormatter.prototype; + _proto3.format = function format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + }; + _proto3.formatToParts = function formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + }; + return PolyRelFormatter; + }(); + var fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] + }; + + /** + * @private + */ + var Locale = /*#__PURE__*/function () { + Locale.fromOpts = function fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + }; + Locale.create = function create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN) { + if (defaultToEN === void 0) { + defaultToEN = false; + } + var specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human readable strings but annoying for parsing/formatting known formats + var localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + var numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + var outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + var weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + }; + Locale.resetCache = function resetCache() { + sysLocaleCache = null; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; + }; + Locale.fromObject = function fromObject(_temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + locale = _ref2.locale, + numberingSystem = _ref2.numberingSystem, + outputCalendar = _ref2.outputCalendar, + weekSettings = _ref2.weekSettings; + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + }; + function Locale(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + var _parseLocaleString = parseLocaleString(locale), + parsedLocale = _parseLocaleString[0], + parsedNumberingSystem = _parseLocaleString[1], + parsedOutputCalendar = _parseLocaleString[2]; + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + var _proto4 = Locale.prototype; + _proto4.listingMode = function listingMode() { + var isActuallyEn = this.isEnglish(); + var hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + }; + _proto4.clone = function clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + }; + _proto4.redefaultToEN = function redefaultToEN(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: true + })); + }; + _proto4.redefaultToSystem = function redefaultToSystem(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: false + })); + }; + _proto4.months = function months$1(length, format) { + var _this2 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, months, function () { + var intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this2.monthsCache[formatStr][length]) { + _this2.monthsCache[formatStr][length] = mapMonths(function (dt) { + return _this2.extract(dt, intl, "month"); + }); + } + return _this2.monthsCache[formatStr][length]; + }); + }; + _proto4.weekdays = function weekdays$1(length, format) { + var _this3 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, weekdays, function () { + var intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this3.weekdaysCache[formatStr][length]) { + _this3.weekdaysCache[formatStr][length] = mapWeekdays(function (dt) { + return _this3.extract(dt, intl, "weekday"); + }); + } + return _this3.weekdaysCache[formatStr][length]; + }); + }; + _proto4.meridiems = function meridiems$1() { + var _this4 = this; + return listStuff(this, undefined, function () { + return meridiems; + }, function () { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!_this4.meridiemCache) { + var intl = { + hour: "numeric", + hourCycle: "h12" + }; + _this4.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(function (dt) { + return _this4.extract(dt, intl, "dayperiod"); + }); + } + return _this4.meridiemCache; + }); + }; + _proto4.eras = function eras$1(length) { + var _this5 = this; + return listStuff(this, length, eras, function () { + var intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!_this5.eraCache[length]) { + _this5.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(function (dt) { + return _this5.extract(dt, intl, "era"); + }); + } + return _this5.eraCache[length]; + }); + }; + _proto4.extract = function extract(dt, intlOpts, field) { + var df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(function (m) { + return m.type.toLowerCase() === field; + }); + return matching ? matching.value : null; + }; + _proto4.numberFormatter = function numberFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + }; + _proto4.dtFormatter = function dtFormatter(dt, intlOpts) { + if (intlOpts === void 0) { + intlOpts = {}; + } + return new PolyDateFormatter(dt, this.intl, intlOpts); + }; + _proto4.relFormatter = function relFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + }; + _proto4.listFormatter = function listFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return getCachedLF(this.intl, opts); + }; + _proto4.isEnglish = function isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us"); + }; + _proto4.getWeekSettings = function getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + }; + _proto4.getStartOfWeek = function getStartOfWeek() { + return this.getWeekSettings().firstDay; + }; + _proto4.getMinDaysInFirstWeek = function getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + }; + _proto4.getWeekendDays = function getWeekendDays() { + return this.getWeekSettings().weekend; + }; + _proto4.equals = function equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + }; + _createClass(Locale, [{ + key: "fastNumbers", + get: function get() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + }]); + return Locale; + }(); + + var singleton = null; + + /** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ + var FixedOffsetZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(FixedOffsetZone, _Zone); + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + FixedOffsetZone.instance = function instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */; + FixedOffsetZone.parseSpecifier = function parseSpecifier(s) { + if (s) { + var r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + }; + function FixedOffsetZone(offset) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.fixed = offset; + return _this; + } + + /** @override **/ + var _proto = FixedOffsetZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return this.name; + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.fixed, format); + } + + /** @override **/; + /** @override **/ + _proto.offset = function offset() { + return this.fixed; + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** @override **/; + _createClass(FixedOffsetZone, [{ + key: "type", + get: function get() { + return "fixed"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.fixed === 0 ? "UTC" : "UTC" + formatOffset(this.fixed, "narrow"); + } + }, { + key: "ianaName", + get: function get() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return "Etc/GMT" + formatOffset(-this.fixed, "narrow"); + } + } + }, { + key: "isUniversal", + get: function get() { + return true; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "utcInstance", + get: + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + function get() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + }]); + return FixedOffsetZone; + }(Zone); + + /** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ + var InvalidZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(InvalidZone, _Zone); + function InvalidZone(zoneName) { + var _this; + _this = _Zone.call(this) || this; + /** @private */ + _this.zoneName = zoneName; + return _this; + } + + /** @override **/ + var _proto = InvalidZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return null; + } + + /** @override **/; + _proto.formatOffset = function formatOffset() { + return ""; + } + + /** @override **/; + _proto.offset = function offset() { + return NaN; + } + + /** @override **/; + _proto.equals = function equals() { + return false; + } + + /** @override **/; + _createClass(InvalidZone, [{ + key: "type", + get: function get() { + return "invalid"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return false; + } + }]); + return InvalidZone; + }(Zone); + + /** + * @private + */ + function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + var lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } + } + + var now = function now() { + return Date.now(); + }, + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + + /** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ + var Settings = /*#__PURE__*/function () { + function Settings() {} + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + Settings.resetCaches = function resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + }; + _createClass(Settings, null, [{ + key: "now", + get: + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + function get() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */, + set: function set(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + }, { + key: "defaultZone", + get: + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + function get() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(zone) { + defaultZone = zone; + } + }, { + key: "defaultLocale", + get: function get() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultNumberingSystem", + get: function get() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultOutputCalendar", + get: function get() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + }, { + key: "defaultWeekSettings", + get: function get() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */, + set: function set(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + */ + }, { + key: "twoDigitCutoffYear", + get: function get() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */, + set: function set(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + }, { + key: "throwOnInvalid", + get: function get() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */, + set: function set(t) { + throwOnInvalid = t; + } + }]); + return Settings; + }(); + + var Invalid = /*#__PURE__*/function () { + function Invalid(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + var _proto = Invalid.prototype; + _proto.toMessage = function toMessage() { + if (this.explanation) { + return this.reason + ": " + this.explanation; + } else { + return this.reason; + } + }; + return Invalid; + }(); + + var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; + function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", "you specified " + value + " (of type " + typeof value + ") as a " + unit + ", which is invalid"); + } + function dayOfWeek(year, month, day) { + var d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + var js = d.getUTCDay(); + return js === 0 ? 7 : js; + } + function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; + } + function uncomputeOrdinal(year, ordinal) { + var table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(function (i) { + return i < ordinal; + }), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day: day + }; + } + function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; + } + + /** + * @private + */ + + function gregorianToWeek(gregObj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var year = gregObj.year, + month = gregObj.month, + day = gregObj.day, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + var weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return _extends({ + weekYear: weekYear, + weekNumber: weekNumber, + weekday: weekday + }, timeObject(gregObj)); + } + function weekToGregorian(weekData, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekYear = weekData.weekYear, + weekNumber = weekData.weekNumber, + weekday = weekData.weekday, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + var ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal.month, + day = _uncomputeOrdinal.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(weekData)); + } + function gregorianToOrdinal(gregData) { + var year = gregData.year, + month = gregData.month, + day = gregData.day; + var ordinal = computeOrdinal(year, month, day); + return _extends({ + year: year, + ordinal: ordinal + }, timeObject(gregData)); + } + function ordinalToGregorian(ordinalData) { + var year = ordinalData.year, + ordinal = ordinalData.ordinal; + var _uncomputeOrdinal2 = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal2.month, + day = _uncomputeOrdinal2.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(ordinalData)); + } + + /** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ + function usesLocalWeekValues(obj, loc) { + var hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + var hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } + } + function hasInvalidWeekData(obj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; + } + function hasInvalidOrdinalData(obj) { + var validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; + } + function hasInvalidGregorianData(obj) { + var validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; + } + function hasInvalidTimeData(obj) { + var hour = obj.hour, + minute = obj.minute, + second = obj.second, + millisecond = obj.millisecond; + var validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; + } + + /** + * @private + */ + + // TYPES + + function isUndefined(o) { + return typeof o === "undefined"; + } + function isNumber(o) { + return typeof o === "number"; + } + function isInteger(o) { + return typeof o === "number" && o % 1 === 0; + } + function isString(o) { + return typeof o === "string"; + } + function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; + } + + // CAPABILITIES + + function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } + } + function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } + } + + // OBJECTS AND ARRAYS + + function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; + } + function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce(function (best, next) { + var pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; + } + function pick(obj, keys) { + return keys.reduce(function (a, k) { + a[k] = obj[k]; + return a; + }, {}); + } + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function (v) { + return !integerBetween(v, 1, 7); + })) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } + } + + // NUMBERS AND STRINGS + + function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; + } + + // x % n but takes the sign of n instead of x + function floorMod(x, n) { + return x - n * Math.floor(x / n); + } + function padStart(input, n) { + if (n === void 0) { + n = 2; + } + var isNeg = input < 0; + var padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; + } + function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } + } + function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } + } + function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + var f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } + } + function roundTo(number, digits, towardZero) { + if (towardZero === void 0) { + towardZero = false; + } + var factor = Math.pow(10, digits), + rounder = towardZero ? Math.trunc : Math.round; + return rounder(number * factor) / factor; + } + + // DATE BASICS + + function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + } + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + function daysInMonth(year, month) { + var modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } + } + + // convert a calendar object to a local timestamp (epoch, but with the offset baked in) + function objToLocalTS(obj) { + var d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; + } + + // adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js + function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + var fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; + } + function weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + var weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; + } + function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; + } + + // PARSING + + function parseZoneInfo(ts, offsetFormat, locale, timeZone) { + if (timeZone === void 0) { + timeZone = null; + } + var date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + var modified = _extends({ + timeZoneName: offsetFormat + }, intlOpts); + var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function (m) { + return m.type.toLowerCase() === "timezonename"; + }); + return parsed ? parsed.value : null; + } + + // signedOffset('-5', '30') -> -330 + function signedOffset(offHourStr, offMinuteStr) { + var offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + var offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; + } + + // COERCION + + function asNumber(value) { + var numericValue = Number(value); + if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue)) throw new InvalidArgumentError("Invalid unit value " + value); + return numericValue; + } + function normalizeObject(obj, normalizer) { + var normalized = {}; + for (var u in obj) { + if (hasOwnProperty(obj, u)) { + var v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; + } + function formatOffset(offset, format) { + var hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2); + case "narrow": + return "" + sign + hours + (minutes > 0 ? ":" + minutes : ""); + case "techie": + return "" + sign + padStart(hours, 2) + padStart(minutes, 2); + default: + throw new RangeError("Value format " + format + " is out of range for property format"); + } + } + function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); + } + + /** + * @private + */ + + var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + function months(length) { + switch (length) { + case "narrow": + return [].concat(monthsNarrow); + case "short": + return [].concat(monthsShort); + case "long": + return [].concat(monthsLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } + } + var weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; + var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; + var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; + function weekdays(length) { + switch (length) { + case "narrow": + return [].concat(weekdaysNarrow); + case "short": + return [].concat(weekdaysShort); + case "long": + return [].concat(weekdaysLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } + } + var meridiems = ["AM", "PM"]; + var erasLong = ["Before Christ", "Anno Domini"]; + var erasShort = ["BC", "AD"]; + var erasNarrow = ["B", "A"]; + function eras(length) { + switch (length) { + case "narrow": + return [].concat(erasNarrow); + case "short": + return [].concat(erasShort); + case "long": + return [].concat(erasLong); + default: + return null; + } + } + function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; + } + function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; + } + function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; + } + function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; + } + function formatRelativeTime(unit, count, numeric, narrow) { + if (numeric === void 0) { + numeric = "always"; + } + if (narrow === void 0) { + narrow = false; + } + var units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + var lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + var isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : "next " + units[unit][0]; + case -1: + return isDay ? "yesterday" : "last " + units[unit][0]; + case 0: + return isDay ? "today" : "this " + units[unit][0]; + } + } + + var isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? fmtValue + " " + fmtUnit + " ago" : "in " + fmtValue + " " + fmtUnit; + } + + function stringifyTokens(splits, tokenToString) { + var s = ""; + for (var _iterator = _createForOfIteratorHelperLoose(splits), _step; !(_step = _iterator()).done;) { + var token = _step.value; + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; + } + var _macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS + }; + + /** + * @private + */ + var Formatter = /*#__PURE__*/function () { + Formatter.create = function create(locale, opts) { + if (opts === void 0) { + opts = {}; + } + return new Formatter(locale, opts); + }; + Formatter.parseFormat = function parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + var current = null, + currentFull = "", + bracketed = false; + var splits = []; + for (var i = 0; i < fmt.length; i++) { + var c = fmt.charAt(i); + if (c === "'") { + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + }; + Formatter.macroTokenToFormatOpts = function macroTokenToFormatOpts(token) { + return _macroTokenToFormatOpts[token]; + }; + function Formatter(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + var _proto = Formatter.prototype; + _proto.formatWithSystemDefault = function formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + var df = this.systemLoc.dtFormatter(dt, _extends({}, this.opts, opts)); + return df.format(); + }; + _proto.dtFormatter = function dtFormatter(dt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.loc.dtFormatter(dt, _extends({}, this.opts, opts)); + }; + _proto.formatDateTime = function formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + }; + _proto.formatDateTimeParts = function formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + }; + _proto.formatInterval = function formatInterval(interval, opts) { + var df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + }; + _proto.resolvedOptions = function resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + }; + _proto.num = function num(n, p) { + if (p === void 0) { + p = 0; + } + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + var opts = _extends({}, this.opts); + if (p > 0) { + opts.padTo = p; + } + return this.loc.numberFormatter(opts).format(n); + }; + _proto.formatDateTimeFromString = function formatDateTimeFromString(dt, fmt) { + var _this = this; + var knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = function string(opts, extract) { + return _this.loc.extract(dt, opts, extract); + }, + formatOffset = function formatOffset(opts) { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = function meridiem() { + return knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"); + }, + month = function month(length, standalone) { + return knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"); + }, + weekday = function weekday(length, standalone) { + return knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"); + }, + maybeMacro = function maybeMacro(token) { + var formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return _this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = function era(length) { + return knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"); + }, + tokenToString = function tokenToString(token) { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return _this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return _this.num(dt.millisecond, 3); + // seconds + case "s": + return _this.num(dt.second); + case "ss": + return _this.num(dt.second, 2); + // fractional seconds + case "uu": + return _this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return _this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return _this.num(dt.minute); + case "mm": + return _this.num(dt.minute, 2); + // hours + case "h": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return _this.num(dt.hour); + case "HH": + return _this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: _this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: _this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: _this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: _this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: _this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : _this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : _this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return _this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return _this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : _this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : _this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : _this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : _this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : _this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return _this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return _this.num(dt.weekYear, 4); + case "W": + return _this.num(dt.weekNumber); + case "WW": + return _this.num(dt.weekNumber, 2); + case "n": + return _this.num(dt.localWeekNumber); + case "nn": + return _this.num(dt.localWeekNumber, 2); + case "ii": + return _this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return _this.num(dt.localWeekYear, 4); + case "o": + return _this.num(dt.ordinal); + case "ooo": + return _this.num(dt.ordinal, 3); + case "q": + // like 1 + return _this.num(dt.quarter); + case "qq": + // like 01 + return _this.num(dt.quarter, 2); + case "X": + return _this.num(Math.floor(dt.ts / 1000)); + case "x": + return _this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + }; + _proto.formatDurationFromString = function formatDurationFromString(dur, fmt) { + var _this2 = this; + var tokenToField = function tokenToField(token) { + switch (token[0]) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + return "hour"; + case "d": + return "day"; + case "w": + return "week"; + case "M": + return "month"; + case "y": + return "year"; + default: + return null; + } + }, + tokenToString = function tokenToString(lildur) { + return function (token) { + var mapped = tokenToField(token); + if (mapped) { + return _this2.num(lildur.get(mapped), token.length); + } else { + return token; + } + }; + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce(function (found, _ref) { + var literal = _ref.literal, + val = _ref.val; + return literal ? found : found.concat(val); + }, []), + collapsed = dur.shiftTo.apply(dur, realTokens.map(tokenToField).filter(function (t) { + return t; + })); + return stringifyTokens(tokens, tokenToString(collapsed)); + }; + return Formatter; + }(); + + /* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + + var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; + function combineRegexes() { + for (var _len = arguments.length, regexes = new Array(_len), _key = 0; _key < _len; _key++) { + regexes[_key] = arguments[_key]; + } + var full = regexes.reduce(function (f, r) { + return f + r.source; + }, ""); + return RegExp("^" + full + "$"); + } + function combineExtractors() { + for (var _len2 = arguments.length, extractors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + extractors[_key2] = arguments[_key2]; + } + return function (m) { + return extractors.reduce(function (_ref, ex) { + var mergedVals = _ref[0], + mergedZone = _ref[1], + cursor = _ref[2]; + var _ex = ex(m, cursor), + val = _ex[0], + zone = _ex[1], + next = _ex[2]; + return [_extends({}, mergedVals, val), zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); + }; + } + function parse(s) { + if (s == null) { + return [null, null]; + } + for (var _len3 = arguments.length, patterns = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + patterns[_key3 - 1] = arguments[_key3]; + } + for (var _i = 0, _patterns = patterns; _i < _patterns.length; _i++) { + var _patterns$_i = _patterns[_i], + regex = _patterns$_i[0], + extractor = _patterns$_i[1]; + var m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; + } + function simpleParse() { + for (var _len4 = arguments.length, keys = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + keys[_key4] = arguments[_key4]; + } + return function (match, cursor) { + var ret = {}; + var i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; + } + + // ISO and SQL parsing + var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/; + var isoExtendedZone = "(?:" + offsetRegex.source + "?(?:\\[(" + ianaRegex.source + ")\\])?)?"; + var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; + var isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + isoExtendedZone); + var isoTimeExtensionRegex = RegExp("(?:T" + isoTimeRegex.source + ")?"); + var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; + var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; + var isoOrdinalRegex = /(\d{4})-?(\d{3})/; + var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); + var extractISOOrdinalData = simpleParse("year", "ordinal"); + var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one + var sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?"); + var sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?"); + function int(match, pos, fallback) { + var m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); + } + function extractISOYmd(match, cursor) { + var item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; + } + function extractISOTime(match, cursor) { + var item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; + } + function extractISOOffset(match, cursor) { + var local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; + } + function extractIANAZone(match, cursor) { + var zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; + } + + // ISO time parsing + + var isoTimeOnly = RegExp("^T?" + isoTimeBaseRegex.source + "$"); + + // ISO duration parsing + + var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; + function extractISODuration(match) { + var s = match[0], + yearStr = match[1], + monthStr = match[2], + weekStr = match[3], + dayStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + millisecondsStr = match[8]; + var hasNegativePrefix = s[0] === "-"; + var negativeSeconds = secondStr && secondStr[0] === "-"; + var maybeNegate = function maybeNegate(num, force) { + if (force === void 0) { + force = false; + } + return num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + }; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; + } + + // These are a little braindead. EDT *should* tell us that we're in, say, America/New_York + // and not just that we're in -240 *right now*. But since I don't think these are used that often + // I'm just going to ignore that + var obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; + } + + // RFC 2822/5322 + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; + function extractRFC2822(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + obsOffset = match[8], + milOffset = match[9], + offHourStr = match[10], + offMinuteStr = match[11], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + var offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; + } + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); + } + + // http date + + var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; + function extractRFC1123Or850(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + function extractASCII(match) { + var weekdayStr = match[1], + monthStr = match[2], + dayStr = match[3], + hourStr = match[4], + minuteStr = match[5], + secondStr = match[6], + yearStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); + var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); + var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); + var isoTimeCombinedRegex = combineRegexes(isoTimeRegex); + var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + + /* + * @private + */ + + function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); + } + function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); + } + function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); + } + function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); + } + var extractISOTimeOnly = combineExtractors(extractISOTime); + function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); + } + var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); + var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); + var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); + } + + var INVALID$2 = "Invalid Duration"; + + // unit conversion constants + var lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix), + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix); + + // units ordered by size + var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; + var reverseUnits = orderedUnits$1.slice(0).reverse(); + + // clone really means "create another instance just like this one, but with these changes" + function clone$1(dur, alts, clear) { + if (clear === void 0) { + clear = false; + } + // deep merge for vals + var conf = { + values: clear ? alts.values : _extends({}, dur.values, alts.values || {}), + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); + } + function durationToMillis(matrix, vals) { + var _vals$milliseconds; + var sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (var _iterator = _createForOfIteratorHelperLoose(reverseUnits.slice(1)), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; + } + + // NB: mutates parameters + function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + var factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var previousVal = vals[previous] * factor; + var conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + var rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); + } + + // Remove all properties with a value of 0 from an object + function removeZeroes(vals) { + var newVals = {}; + for (var _i = 0, _Object$entries = Object.entries(vals); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _Object$entries[_i], + key = _Object$entries$_i[0], + value = _Object$entries$_i[1]; + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; + } + + /** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ + var Duration = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Duration(config) { + var accurate = config.conversionAccuracy === "longterm" || false; + var matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + Duration.fromMillis = function fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */; + Duration.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got " + (obj === null ? "null" : typeof obj)); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */; + Duration.fromDurationLike = function fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError("Unknown duration argument " + durationLike + " of type " + typeof durationLike); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */; + Duration.fromISO = function fromISO(text, opts) { + var _parseISODuration = parseISODuration(text), + parsed = _parseISODuration[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */; + Duration.fromISOTime = function fromISOTime(text, opts) { + var _parseISOTimeOnly = parseISOTimeOnly(text), + parsed = _parseISOTimeOnly[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */; + Duration.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid: invalid + }); + } + } + + /** + * @private + */; + Duration.normalizeUnit = function normalizeUnit(unit) { + var normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Duration.isDuration = function isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */; + var _proto = Duration.prototype; + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @return {string} + */ + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + var fmtOpts = _extends({}, opts, { + floor: opts.round !== false && opts.floor !== false + }); + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @example + * ```js + * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' + * ``` + */; + _proto.toHuman = function toHuman(opts) { + var _this = this; + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return INVALID$2; + var l = orderedUnits$1.map(function (unit) { + var val = _this.values[unit]; + if (isUndefined(val)) { + return null; + } + return _this.loc.numberFormatter(_extends({ + style: "unit", + unitDisplay: "long" + }, opts, { + unit: unit.slice(0, -1) + })).format(val); + }).filter(function (n) { + return n; + }); + return this.loc.listFormatter(_extends({ + type: "conjunction", + style: opts.listStyle || "narrow" + }, opts)).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */; + _proto.toObject = function toObject() { + if (!this.isValid) return {}; + return _extends({}, this.values); + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */; + _proto.toISO = function toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + var s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return null; + var millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = _extends({ + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended" + }, opts, { + includeOffset: false + }); + var dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */; + _proto.toString = function toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Duration { values: " + JSON.stringify(this.values) + " }"; + } else { + return "Duration { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */; + _proto.toMillis = function toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration), + result = {}; + for (var _i2 = 0, _orderedUnits = orderedUnits$1; _i2 < _orderedUnits.length; _i2++) { + var k = _orderedUnits[_i2]; + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */; + _proto.mapUnits = function mapUnits(fn) { + if (!this.isValid) return this; + var result = {}; + for (var _i3 = 0, _Object$keys = Object.keys(this.values); _i3 < _Object$keys.length; _i3++) { + var k = _Object$keys[_i3]; + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */; + _proto.get = function get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var mixed = _extends({}, this.values, normalizeObject(values, Duration.normalizeUnit)); + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */; + _proto.reconfigure = function reconfigure(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + locale = _ref.locale, + numberingSystem = _ref.numberingSystem, + conversionAccuracy = _ref.conversionAccuracy, + matrix = _ref.matrix; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem + }); + var opts = { + loc: loc, + matrix: matrix, + conversionAccuracy: conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */; + _proto.as = function as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */; + _proto.normalize = function normalize() { + if (!this.isValid) return this; + var vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */; + _proto.rescale = function rescale() { + if (!this.isValid) return this; + var vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */; + _proto.shiftTo = function shiftTo() { + for (var _len = arguments.length, units = new Array(_len), _key = 0; _key < _len; _key++) { + units[_key] = arguments[_key]; + } + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(function (u) { + return Duration.normalizeUnit(u); + }); + var built = {}, + accumulated = {}, + vals = this.toObject(); + var lastUnit; + for (var _i4 = 0, _orderedUnits2 = orderedUnits$1; _i4 < _orderedUnits2.length; _i4++) { + var k = _orderedUnits2[_i4]; + if (units.indexOf(k) >= 0) { + lastUnit = k; + var own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (var ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + var i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (var key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */; + _proto.shiftToAll = function shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */; + _proto.negate = function negate() { + if (!this.isValid) return this; + var negated = {}; + for (var _i5 = 0, _Object$keys2 = Object.keys(this.values); _i5 < _Object$keys2.length; _i5++) { + var k = _Object$keys2[_i5]; + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Get the years. + * @type {number} + */; + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (var _i6 = 0, _orderedUnits3 = orderedUnits$1; _i6 < _orderedUnits3.length; _i6++) { + var u = _orderedUnits3[_i6]; + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + }; + _createClass(Duration, [{ + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + }, { + key: "years", + get: function get() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + }, { + key: "quarters", + get: function get() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + }, { + key: "months", + get: function get() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + }, { + key: "weeks", + get: function get() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + }, { + key: "days", + get: function get() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + }, { + key: "hours", + get: function get() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + }, { + key: "minutes", + get: function get() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + }, { + key: "seconds", + get: function get() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + }, { + key: "milliseconds", + get: function get() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Duration; + }(Symbol.for("nodejs.util.inspect.custom")); + + var INVALID$1 = "Invalid Interval"; + + // checks if the start is equal to or before the end + function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", "The end of an interval must be after its start, but you had start=" + start.toISO() + " and end=" + end.toISO()); + } else { + return null; + } + } + + /** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ + var Interval = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Interval(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + Interval.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid: invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */; + Interval.fromDateTimes = function fromDateTimes(start, end) { + var builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + var validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.after = function after(start, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.before = function before(end, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */; + Interval.fromISO = function fromISO(text, opts) { + var _split = (text || "").split("/", 2), + s = _split[0], + e = _split[1]; + if (s && e) { + var start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + var end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + var dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + var _dur = Duration.fromISO(s, opts); + if (_dur.isValid) { + return Interval.before(end, _dur); + } + } + } + return Interval.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Interval.isInterval = function isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */; + var _proto = Interval.prototype; + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + _proto.length = function length(unit) { + if (unit === void 0) { + unit = "milliseconds"; + } + return this.isValid ? this.toDuration.apply(this, [unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */; + _proto.count = function count(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (!this.isValid) return NaN; + var start = this.start.startOf(unit, opts); + var end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */; + _proto.hasSame = function hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */; + _proto.isEmpty = function isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isAfter = function isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isBefore = function isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.contains = function contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */; + _proto.set = function set(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + start = _ref.start, + end = _ref.end; + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */; + _proto.splitAt = function splitAt() { + var _this = this; + if (!this.isValid) return []; + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + var sorted = dateTimes.map(friendlyDateTime).filter(function (d) { + return _this.contains(d); + }).sort(function (a, b) { + return a.toMillis() - b.toMillis(); + }), + results = []; + var s = this.s, + i = 0; + while (s < this.e) { + var added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */; + _proto.splitBy = function splitBy(duration) { + var dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + var s = this.s, + idx = 1, + next; + var results = []; + while (s < this.e) { + var added = this.start.plus(dur.mapUnits(function (x) { + return x * idx; + })); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */; + _proto.divideEqually = function divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */; + _proto.overlaps = function overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsStart = function abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsEnd = function abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Return whether this Interval engulfs the start and end of the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.engulfs = function engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */; + _proto.intersection = function intersection(other) { + if (!this.isValid) return this; + var s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */; + _proto.union = function union(other) { + if (!this.isValid) return this; + var s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into a equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.merge = function merge(intervals) { + var _intervals$sort$reduc = intervals.sort(function (a, b) { + return a.s - b.s; + }).reduce(function (_ref2, item) { + var sofar = _ref2[0], + current = _ref2[1]; + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]), + found = _intervals$sort$reduc[0], + final = _intervals$sort$reduc[1]; + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.xor = function xor(intervals) { + var _Array$prototype; + var start = null, + currentCount = 0; + var results = [], + ends = intervals.map(function (i) { + return [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]; + }), + flattened = (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, ends), + arr = flattened.sort(function (a, b) { + return a.time - b.time; + }); + for (var _iterator = _createForOfIteratorHelperLoose(arr), _step; !(_step = _iterator()).done;) { + var i = _step.value; + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */; + _proto.difference = function difference() { + var _this2 = this; + for (var _len2 = arguments.length, intervals = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + intervals[_key2] = arguments[_key2]; + } + return Interval.xor([this].concat(intervals)).map(function (i) { + return _this2.intersection(i); + }).filter(function (i) { + return i && !i.isEmpty(); + }); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */; + _proto.toString = function toString() { + if (!this.isValid) return INVALID$1; + return "[" + this.s.toISO() + " \u2013 " + this.e.toISO() + ")"; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Interval { start: " + this.s.toISO() + ", end: " + this.e.toISO() + " }"; + } else { + return "Interval { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISO = function toISO(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISO(opts) + "/" + this.e.toISO(opts); + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */; + _proto.toISODate = function toISODate() { + if (!this.isValid) return INVALID$1; + return this.s.toISODate() + "/" + this.e.toISODate(); + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISOTime(opts) + "/" + this.e.toISOTime(opts); + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */; + _proto.toFormat = function toFormat(dateFormat, _temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + _ref3$separator = _ref3.separator, + separator = _ref3$separator === void 0 ? " – " : _ref3$separator; + if (!this.isValid) return INVALID$1; + return "" + this.s.toFormat(dateFormat) + separator + this.e.toFormat(dateFormat); + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */; + _proto.toDuration = function toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */; + _proto.mapEndpoints = function mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + }; + _createClass(Interval, [{ + key: "start", + get: function get() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval + * @type {DateTime} + */ + }, { + key: "end", + get: function get() { + return this.isValid ? this.e : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Interval; + }(Symbol.for("nodejs.util.inspect.custom")); + + /** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ + var Info = /*#__PURE__*/function () { + function Info() {} + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + Info.hasDST = function hasDST(zone) { + if (zone === void 0) { + zone = Settings.defaultZone; + } + var proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */; + Info.isValidIANAZone = function isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */; + Info.normalizeZone = function normalizeZone$1(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */; + Info.getStartOfWeek = function getStartOfWeek(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$locale = _ref.locale, + locale = _ref$locale === void 0 ? null : _ref$locale, + _ref$locObj = _ref.locObj, + locObj = _ref$locObj === void 0 ? null : _ref$locObj; + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */; + Info.getMinimumDaysInFirstWeek = function getMinimumDaysInFirstWeek(_temp2) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$locale = _ref2.locale, + locale = _ref2$locale === void 0 ? null : _ref2$locale, + _ref2$locObj = _ref2.locObj, + locObj = _ref2$locObj === void 0 ? null : _ref2$locObj; + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */; + Info.getWeekendWeekdays = function getWeekendWeekdays(_temp3) { + var _ref3 = _temp3 === void 0 ? {} : _temp3, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? null : _ref3$locale, + _ref3$locObj = _ref3.locObj, + locObj = _ref3$locObj === void 0 ? null : _ref3$locObj; + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */; + Info.months = function months(length, _temp4) { + if (length === void 0) { + length = "long"; + } + var _ref4 = _temp4 === void 0 ? {} : _temp4, + _ref4$locale = _ref4.locale, + locale = _ref4$locale === void 0 ? null : _ref4$locale, + _ref4$numberingSystem = _ref4.numberingSystem, + numberingSystem = _ref4$numberingSystem === void 0 ? null : _ref4$numberingSystem, + _ref4$locObj = _ref4.locObj, + locObj = _ref4$locObj === void 0 ? null : _ref4$locObj, + _ref4$outputCalendar = _ref4.outputCalendar, + outputCalendar = _ref4$outputCalendar === void 0 ? "gregory" : _ref4$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */; + Info.monthsFormat = function monthsFormat(length, _temp5) { + if (length === void 0) { + length = "long"; + } + var _ref5 = _temp5 === void 0 ? {} : _temp5, + _ref5$locale = _ref5.locale, + locale = _ref5$locale === void 0 ? null : _ref5$locale, + _ref5$numberingSystem = _ref5.numberingSystem, + numberingSystem = _ref5$numberingSystem === void 0 ? null : _ref5$numberingSystem, + _ref5$locObj = _ref5.locObj, + locObj = _ref5$locObj === void 0 ? null : _ref5$locObj, + _ref5$outputCalendar = _ref5.outputCalendar, + outputCalendar = _ref5$outputCalendar === void 0 ? "gregory" : _ref5$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */; + Info.weekdays = function weekdays(length, _temp6) { + if (length === void 0) { + length = "long"; + } + var _ref6 = _temp6 === void 0 ? {} : _temp6, + _ref6$locale = _ref6.locale, + locale = _ref6$locale === void 0 ? null : _ref6$locale, + _ref6$numberingSystem = _ref6.numberingSystem, + numberingSystem = _ref6$numberingSystem === void 0 ? null : _ref6$numberingSystem, + _ref6$locObj = _ref6.locObj, + locObj = _ref6$locObj === void 0 ? null : _ref6$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */; + Info.weekdaysFormat = function weekdaysFormat(length, _temp7) { + if (length === void 0) { + length = "long"; + } + var _ref7 = _temp7 === void 0 ? {} : _temp7, + _ref7$locale = _ref7.locale, + locale = _ref7$locale === void 0 ? null : _ref7$locale, + _ref7$numberingSystem = _ref7.numberingSystem, + numberingSystem = _ref7$numberingSystem === void 0 ? null : _ref7$numberingSystem, + _ref7$locObj = _ref7.locObj, + locObj = _ref7$locObj === void 0 ? null : _ref7$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */; + Info.meridiems = function meridiems(_temp8) { + var _ref8 = _temp8 === void 0 ? {} : _temp8, + _ref8$locale = _ref8.locale, + locale = _ref8$locale === void 0 ? null : _ref8$locale; + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */; + Info.eras = function eras(length, _temp9) { + if (length === void 0) { + length = "short"; + } + var _ref9 = _temp9 === void 0 ? {} : _temp9, + _ref9$locale = _ref9.locale, + locale = _ref9$locale === void 0 ? null : _ref9$locale; + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */; + Info.features = function features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + }; + return Info; + }(); + + function dayDiff(earlier, later) { + var utcDayStart = function utcDayStart(dt) { + return dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(); + }, + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); + } + function highOrderDiffs(cursor, later, units) { + var differs = [["years", function (a, b) { + return b.year - a.year; + }], ["quarters", function (a, b) { + return b.quarter - a.quarter + (b.year - a.year) * 4; + }], ["months", function (a, b) { + return b.month - a.month + (b.year - a.year) * 12; + }], ["weeks", function (a, b) { + var days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + var results = {}; + var earlier = cursor; + var lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (var _i = 0, _differs = differs; _i < _differs.length; _i++) { + var _differs$_i = _differs[_i], + unit = _differs$_i[0], + differ = _differs$_i[1]; + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; + } + function _diff (earlier, later, units, opts) { + var _highOrderDiffs = highOrderDiffs(earlier, later, units), + cursor = _highOrderDiffs[0], + results = _highOrderDiffs[1], + highWater = _highOrderDiffs[2], + lowestOrder = _highOrderDiffs[3]; + var remainingMillis = later - cursor; + var lowerOrderUnits = units.filter(function (u) { + return ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0; + }); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + var _cursor$plus; + highWater = cursor.plus((_cursor$plus = {}, _cursor$plus[lowestOrder] = 1, _cursor$plus)); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + var duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + var _Duration$fromMillis; + return (_Duration$fromMillis = Duration.fromMillis(remainingMillis, opts)).shiftTo.apply(_Duration$fromMillis, lowerOrderUnits).plus(duration); + } else { + return duration; + } + } + + var numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" + }; + var numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] + }; + var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); + function parseDigits(str) { + var value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (var i = 0; i < str.length; i++) { + var code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (var key in numberingSystemsUTF16) { + var _numberingSystemsUTF = numberingSystemsUTF16[key], + min = _numberingSystemsUTF[0], + max = _numberingSystemsUTF[1]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } + } + function digitRegex(_ref, append) { + var numberingSystem = _ref.numberingSystem; + if (append === void 0) { + append = ""; + } + return new RegExp("" + numberingSystems[numberingSystem || "latn"] + append); + } + + var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; + function intUnit(regex, post) { + if (post === void 0) { + post = function post(i) { + return i; + }; + } + return { + regex: regex, + deser: function deser(_ref) { + var s = _ref[0]; + return post(parseDigits(s)); + } + }; + } + var NBSP = String.fromCharCode(160); + var spaceOrNBSP = "[ " + NBSP + "]"; + var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); + function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); + } + function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); + } + function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: function deser(_ref2) { + var s = _ref2[0]; + return strings.findIndex(function (i) { + return stripInsensitivities(s) === stripInsensitivities(i); + }) + startIndex; + } + }; + } + } + function offset(regex, groups) { + return { + regex: regex, + deser: function deser(_ref3) { + var h = _ref3[1], + m = _ref3[2]; + return signedOffset(h, m); + }, + groups: groups + }; + } + function simple(regex) { + return { + regex: regex, + deser: function deser(_ref4) { + var s = _ref4[0]; + return s; + } + }; + } + function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + } + + /** + * @param token + * @param {Locale} loc + */ + function unitForToken(token, loc) { + var one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = function literal(t) { + return { + regex: RegExp(escapeToken(t.val)), + deser: function deser(_ref5) { + var s = _ref5[0]; + return s; + }, + literal: true + }; + }, + unitate = function unitate(t) { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(?::(" + two.source + "))?"), 2); + case "ZZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(" + two.source + ")?"), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + var unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; + } + var partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } + }; + function tokenForPart(part, formatOpts, resolvedOpts) { + var type = part.type, + value = part.value; + if (type === "literal") { + var isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + var style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + var actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + var val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val: val + }; + } + return undefined; + } + function buildRegex(units) { + var re = units.map(function (u) { + return u.regex; + }).reduce(function (f, r) { + return f + "(" + r.source + ")"; + }, ""); + return ["^" + re + "$", units]; + } + function match(input, regex, handlers) { + var matches = input.match(regex); + if (matches) { + var all = {}; + var matchIndex = 1; + for (var i in handlers) { + if (hasOwnProperty(handlers, i)) { + var h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } + } + function dateTimeFromMatches(matches) { + var toField = function toField(token) { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + var zone = null; + var specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + var vals = Object.keys(matches).reduce(function (r, k) { + var f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; + } + var dummyDateTimeCache = null; + function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; + } + function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + var formatOpts = Formatter.macroTokenToFormatOpts(token.val); + var tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; + } + function expandMacroTokens(tokens, locale) { + var _Array$prototype; + return (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, tokens.map(function (t) { + return maybeExpandMacroToken(t, locale); + })); + } + + /** + * @private + */ + + function explainFromTokens(locale, input, format) { + var tokens = expandMacroTokens(Formatter.parseFormat(format), locale), + units = tokens.map(function (t) { + return unitForToken(t, locale); + }), + disqualifyingUnit = units.find(function (t) { + return t.invalidReason; + }); + if (disqualifyingUnit) { + return { + input: input, + tokens: tokens, + invalidReason: disqualifyingUnit.invalidReason + }; + } else { + var _buildRegex = buildRegex(units), + regexString = _buildRegex[0], + handlers = _buildRegex[1], + regex = RegExp(regexString, "i"), + _match = match(input, regex, handlers), + rawMatches = _match[0], + matches = _match[1], + _ref6 = matches ? dateTimeFromMatches(matches) : [null, null, undefined], + result = _ref6[0], + zone = _ref6[1], + specificOffset = _ref6[2]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input: input, + tokens: tokens, + regex: regex, + rawMatches: rawMatches, + matches: matches, + result: result, + zone: zone, + specificOffset: specificOffset + }; + } + } + function parseFromTokens(locale, input, format) { + var _explainFromTokens = explainFromTokens(locale, input, format), + result = _explainFromTokens.result, + zone = _explainFromTokens.zone, + specificOffset = _explainFromTokens.specificOffset, + invalidReason = _explainFromTokens.invalidReason; + return [result, zone, specificOffset, invalidReason]; + } + function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + var formatter = Formatter.create(locale, formatOpts); + var df = formatter.dtFormatter(getDummyDateTime()); + var parts = df.formatToParts(); + var resolvedOpts = df.resolvedOptions(); + return parts.map(function (p) { + return tokenForPart(p, formatOpts, resolvedOpts); + }); + } + + var INVALID = "Invalid DateTime"; + var MAX_DATE = 8.64e15; + function unsupportedZone(zone) { + return new Invalid("unsupported zone", "the zone \"" + zone.name + "\" is not supported"); + } + + // we cache week data on the DT object and this intermediates the cache + /** + * @param {DateTime} dt + */ + function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; + } + + /** + * @param {DateTime} dt + */ + function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; + } + + // clone really means, "make a new object with these modifications". all "setters" really use this + // to create a new object while only changing some of the properties + function clone(inst, alts) { + var current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime(_extends({}, current, alts, { + old: current + })); + } + + // find the right offset a given local time. The o input is our guess, which determines which + // offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) + function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + var utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + var o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + var o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; + } + + // convert an epoch timestamp into a calendar object with the given offset + function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + var d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; + } + + // convert a calendar object to a epoch timestamp + function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); + } + + // create a new DT instance by adding a duration, adjusting for DSTs + function adjustTime(inst, dur) { + var oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = _extends({}, inst.c, { + year: year, + month: month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }), + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + var _fixOffset = fixOffset(localTS, oPre, inst.zone), + ts = _fixOffset[0], + o = _fixOffset[1]; + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts: ts, + o: o + }; + } + + // helper useful in turning the results of parsing into real dates + // by handling the zone options + function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + var setZone = opts.setZone, + zone = opts.zone; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + var interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, _extends({}, opts, { + zone: interpretationZone, + specificOffset: specificOffset + })); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", "the input \"" + text + "\" can't be parsed as " + format)); + } + } + + // if you want to output a technical format (e.g. RFC 2822), this helper + // helps handle the details + function toTechFormat(dt, format, allowZ) { + if (allowZ === void 0) { + allowZ = true; + } + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ: allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; + } + function _toISODate(o, extended) { + var longFormat = o.c.year > 9999 || o.c.year < 0; + var c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (extended) { + c += "-"; + c += padStart(o.c.month); + c += "-"; + c += padStart(o.c.day); + } else { + c += padStart(o.c.month); + c += padStart(o.c.day); + } + return c; + } + function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) { + var c = padStart(o.c.hour); + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += ":"; + } + } else { + c += padStart(o.c.minute); + } + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += padStart(o.c.second); + if (o.c.millisecond !== 0 || !suppressMilliseconds) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; + } + + // defaults for unspecified units in the supported calendars + var defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + + // Units in the supported calendars, sorted by bigness + var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + + // standardize case and plurality in units + function normalizeUnit(unit) { + var normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } + } + + // this is a dumbed down version of fromObject() that runs about 60% faster + // but doesn't do any validation, makes a bunch of assumptions about what units + // are present, and so on. + function quickDT(obj, opts) { + var zone = normalizeZone(opts.zone, Settings.defaultZone), + loc = Locale.fromObject(opts), + tsNow = Settings.now(); + var ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (var _i = 0, _orderedUnits = orderedUnits; _i < _orderedUnits.length; _i++) { + var u = _orderedUnits[_i]; + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + var invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + var offsetProvis = zone.offset(tsNow); + var _objToTS = objToTS(obj, offsetProvis, zone); + ts = _objToTS[0]; + o = _objToTS[1]; + } else { + ts = tsNow; + } + return new DateTime({ + ts: ts, + zone: zone, + loc: loc, + o: o + }); + } + function diffRelative(start, end, opts) { + var round = isUndefined(opts.round) ? true : opts.round, + format = function format(c, unit) { + c = roundTo(c, round || opts.calendary ? 0 : 2, true); + var formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = function differ(unit) { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (var _iterator = _createForOfIteratorHelperLoose(opts.units), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + var count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); + } + function lastOpts(argList) { + var opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; + } + + /** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ + var DateTime = /*#__PURE__*/function (_Symbol$for) { + /** + * @access private + */ + function DateTime(config) { + var zone = config.zone || Settings.defaultZone; + var invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + var c = null, + o = null; + if (!invalid) { + var unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + var _ref = [config.old.c, config.old.o]; + c = _ref[0]; + o = _ref[1]; + } else { + var ot = zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + DateTime.now = function now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */; + DateTime.local = function local() { + var _lastOpts = lastOpts(arguments), + opts = _lastOpts[0], + args = _lastOpts[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */; + DateTime.utc = function utc() { + var _lastOpts2 = lastOpts(arguments), + opts = _lastOpts2[0], + args = _lastOpts2[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */; + DateTime.fromJSDate = function fromJSDate(date, options) { + if (options === void 0) { + options = {}; + } + var ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + var zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromMillis = function fromMillis(milliseconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError("fromMillis requires a numerical input, but received a " + typeof milliseconds + " with value " + milliseconds); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromSeconds = function fromSeconds(seconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */; + DateTime.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + obj = obj || {}; + var zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + var loc = Locale.fromObject(opts); + var normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues = usesLocalWeekValues(normalized, loc), + minDaysInFirstWeek = _usesLocalWeekValues.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues.startOfWeek; + var tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + var units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + var foundFirst = false; + for (var _iterator2 = _createForOfIteratorHelperLoose(units), _step2; !(_step2 = _iterator2()).done;) { + var u = _step2.value; + var v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + var higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + var gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + _objToTS2 = objToTS(gregorian, offsetProvis, zoneToUse), + tsFinal = _objToTS2[0], + offsetFinal = _objToTS2[1], + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc: loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", "you can't specify both a weekday of " + normalized.weekday + " and a date of " + inst.toISO()); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */; + DateTime.fromISO = function fromISO(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseISODate = parseISODate(text), + vals = _parseISODate[0], + parsedZone = _parseISODate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */; + DateTime.fromRFC2822 = function fromRFC2822(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseRFC2822Date = parseRFC2822Date(text), + vals = _parseRFC2822Date[0], + parsedZone = _parseRFC2822Date[1]; + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */; + DateTime.fromHTTP = function fromHTTP(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseHTTPDate = parseHTTPDate(text), + vals = _parseHTTPDate[0], + parsedZone = _parseHTTPDate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromFormat = function fromFormat(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + var _opts = opts, + _opts$locale = _opts.locale, + locale = _opts$locale === void 0 ? null : _opts$locale, + _opts$numberingSystem = _opts.numberingSystem, + numberingSystem = _opts$numberingSystem === void 0 ? null : _opts$numberingSystem, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }), + _parseFromTokens = parseFromTokens(localeToUse, text, fmt), + vals = _parseFromTokens[0], + parsedZone = _parseFromTokens[1], + specificOffset = _parseFromTokens[2], + invalid = _parseFromTokens[3]; + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */; + DateTime.fromString = function fromString(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */; + DateTime.fromSQL = function fromSQL(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseSQL = parseSQL(text), + vals = _parseSQL[0], + parsedZone = _parseSQL[1]; + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */; + DateTime.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid: invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + DateTime.isDateTime = function isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */; + DateTime.parseFormatForOpts = function parseFormatForOpts(formatOpts, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(function (t) { + return t ? t.val : null; + }).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */; + DateTime.expandFormat = function expandFormat(fmt, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(function (t) { + return t.val; + }).join(""); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */; + var _proto = DateTime.prototype; + _proto.get = function get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */; + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + _proto.getPossibleOffsets = function getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + var dayMs = 86400000; + var minuteMs = 60000; + var localTS = objToLocalTS(this.c); + var oEarlier = this.zone.offset(localTS - dayMs); + var oLater = this.zone.offset(localTS + dayMs); + var o1 = this.zone.offset(localTS - oEarlier * minuteMs); + var o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + var ts1 = localTS - o1 * minuteMs; + var ts2 = localTS - o2 * minuteMs; + var c1 = tsToObj(ts1, o1); + var c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */; + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + _proto.resolvedLocaleOptions = function resolvedLocaleOptions(opts) { + if (opts === void 0) { + opts = {}; + } + var _Formatter$create$res = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this), + locale = _Formatter$create$res.locale, + numberingSystem = _Formatter$create$res.numberingSystem, + calendar = _Formatter$create$res.calendar; + return { + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */; + _proto.toUTC = function toUTC(offset, opts) { + if (offset === void 0) { + offset = 0; + } + if (opts === void 0) { + opts = {}; + } + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */; + _proto.toLocal = function toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */; + _proto.setZone = function setZone(zone, _temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + _ref2$keepLocalTime = _ref2.keepLocalTime, + keepLocalTime = _ref2$keepLocalTime === void 0 ? false : _ref2$keepLocalTime, + _ref2$keepCalendarTim = _ref2.keepCalendarTime, + keepCalendarTime = _ref2$keepCalendarTim === void 0 ? false : _ref2$keepCalendarTim; + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + var newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + var offsetGuess = zone.offset(this.ts); + var asObj = this.toObject(); + var _objToTS3 = objToTS(asObj, offsetGuess, zone); + newTS = _objToTS3[0]; + } + return clone(this, { + ts: newTS, + zone: zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */; + _proto.reconfigure = function reconfigure(_temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + locale = _ref3.locale, + numberingSystem = _ref3.numberingSystem, + outputCalendar = _ref3.outputCalendar; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: outputCalendar + }); + return clone(this, { + loc: loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */; + _proto.setLocale = function setLocale(locale) { + return this.reconfigure({ + locale: locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues2 = usesLocalWeekValues(normalized, this.loc), + minDaysInFirstWeek = _usesLocalWeekValues2.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues2.startOfWeek; + var settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var mixed; + if (settingWeekStuff) { + mixed = weekToGregorian(_extends({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian(_extends({}, gregorianToOrdinal(this.c), normalized)); + } else { + mixed = _extends({}, this.toObject(), normalized); + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + var _objToTS4 = objToTS(mixed, this.o, this.zone), + ts = _objToTS4[0], + o = _objToTS4[1]; + return clone(this, { + ts: ts, + o: o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */; + _proto.startOf = function startOf(unit, _temp3) { + var _ref4 = _temp3 === void 0 ? {} : _temp3, + _ref4$useLocaleWeeks = _ref4.useLocaleWeeks, + useLocaleWeeks = _ref4$useLocaleWeeks === void 0 ? false : _ref4$useLocaleWeeks; + if (!this.isValid) return this; + var o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + var startOfWeek = this.loc.getStartOfWeek(); + var weekday = this.weekday; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + var q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */; + _proto.endOf = function endOf(unit, opts) { + var _this$plus; + return this.isValid ? this.plus((_this$plus = {}, _this$plus[unit] = 1, _this$plus)).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */; + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */; + _proto.toLocaleParts = function toLocaleParts(opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @return {string} + */; + _proto.toISO = function toISO(_temp4) { + var _ref5 = _temp4 === void 0 ? {} : _temp4, + _ref5$format = _ref5.format, + format = _ref5$format === void 0 ? "extended" : _ref5$format, + _ref5$suppressSeconds = _ref5.suppressSeconds, + suppressSeconds = _ref5$suppressSeconds === void 0 ? false : _ref5$suppressSeconds, + _ref5$suppressMillise = _ref5.suppressMilliseconds, + suppressMilliseconds = _ref5$suppressMillise === void 0 ? false : _ref5$suppressMillise, + _ref5$includeOffset = _ref5.includeOffset, + includeOffset = _ref5$includeOffset === void 0 ? true : _ref5$includeOffset, + _ref5$extendedZone = _ref5.extendedZone, + extendedZone = _ref5$extendedZone === void 0 ? false : _ref5$extendedZone; + if (!this.isValid) { + return null; + } + var ext = format === "extended"; + var c = _toISODate(this, ext); + c += "T"; + c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @return {string} + */; + _proto.toISODate = function toISODate(_temp5) { + var _ref6 = _temp5 === void 0 ? {} : _temp5, + _ref6$format = _ref6.format, + format = _ref6$format === void 0 ? "extended" : _ref6$format; + if (!this.isValid) { + return null; + } + return _toISODate(this, format === "extended"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */; + _proto.toISOWeekDate = function toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @return {string} + */; + _proto.toISOTime = function toISOTime(_temp6) { + var _ref7 = _temp6 === void 0 ? {} : _temp6, + _ref7$suppressMillise = _ref7.suppressMilliseconds, + suppressMilliseconds = _ref7$suppressMillise === void 0 ? false : _ref7$suppressMillise, + _ref7$suppressSeconds = _ref7.suppressSeconds, + suppressSeconds = _ref7$suppressSeconds === void 0 ? false : _ref7$suppressSeconds, + _ref7$includeOffset = _ref7.includeOffset, + includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset, + _ref7$includePrefix = _ref7.includePrefix, + includePrefix = _ref7$includePrefix === void 0 ? false : _ref7$includePrefix, + _ref7$extendedZone = _ref7.extendedZone, + extendedZone = _ref7$extendedZone === void 0 ? false : _ref7$extendedZone, + _ref7$format = _ref7.format, + format = _ref7$format === void 0 ? "extended" : _ref7$format; + if (!this.isValid) { + return null; + } + var c = includePrefix ? "T" : ""; + return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */; + _proto.toRFC2822 = function toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */; + _proto.toHTTP = function toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string} + */; + _proto.toSQLDate = function toSQLDate() { + if (!this.isValid) { + return null; + } + return _toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */; + _proto.toSQLTime = function toSQLTime(_temp7) { + var _ref8 = _temp7 === void 0 ? {} : _temp7, + _ref8$includeOffset = _ref8.includeOffset, + includeOffset = _ref8$includeOffset === void 0 ? true : _ref8$includeOffset, + _ref8$includeZone = _ref8.includeZone, + includeZone = _ref8$includeZone === void 0 ? false : _ref8$includeZone, + _ref8$includeOffsetSp = _ref8.includeOffsetSpace, + includeOffsetSpace = _ref8$includeOffsetSp === void 0 ? true : _ref8$includeOffsetSp; + var fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */; + _proto.toSQL = function toSQL(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) { + return null; + } + return this.toSQLDate() + " " + this.toSQLTime(opts); + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */; + _proto.toString = function toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "DateTime { ts: " + this.toISO() + ", zone: " + this.zone.name + ", locale: " + this.locale + " }"; + } else { + return "DateTime { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */; + _proto.toMillis = function toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds of this DateTime. + * @return {number} + */; + _proto.toSeconds = function toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */; + _proto.toUnixInteger = function toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */; + _proto.toBSON = function toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */; + _proto.toObject = function toObject(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return {}; + var base = _extends({}, this.c); + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */; + _proto.toJSDate = function toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */; + _proto.diff = function diff(otherDateTime, unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + var durOpts = _extends({ + locale: this.locale, + numberingSystem: this.numberingSystem + }, opts); + var units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = _diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */; + _proto.diffNow = function diffNow(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval} + */; + _proto.until = function until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */; + _proto.hasSame = function hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + var inputMs = otherDateTime.valueOf(); + var adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */; + _proto.equals = function equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds down by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */; + _proto.toRelative = function toRelative(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + var base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + var units = ["years", "months", "days", "hours", "minutes", "seconds"]; + var unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), _extends({}, options, { + numeric: "always", + units: units, + unit: unit + })); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */; + _proto.toRelativeCalendar = function toRelativeCalendar(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, _extends({}, options, { + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + })); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */; + DateTime.min = function min() { + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */; + DateTime.max = function max() { + for (var _len2 = arguments.length, dateTimes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + dateTimes[_key2] = arguments[_key2]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */; + DateTime.fromFormatExplain = function fromFormatExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + var _options = options, + _options$locale = _options.locale, + locale = _options$locale === void 0 ? null : _options$locale, + _options$numberingSys = _options.numberingSystem, + numberingSystem = _options$numberingSys === void 0 ? null : _options$numberingSys, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */; + DateTime.fromStringExplain = function fromStringExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + return DateTime.fromFormatExplain(text, fmt, options); + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */; + _createClass(DateTime, [{ + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "outputCalendar", + get: function get() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + }, { + key: "zone", + get: function get() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + }, { + key: "zoneName", + get: function get() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + }, { + key: "year", + get: function get() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + }, { + key: "quarter", + get: function get() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + }, { + key: "month", + get: function get() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + }, { + key: "day", + get: function get() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + }, { + key: "hour", + get: function get() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + }, { + key: "minute", + get: function get() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + }, { + key: "second", + get: function get() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + }, { + key: "millisecond", + get: function get() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + }, { + key: "weekYear", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + }, { + key: "weekNumber", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + }, { + key: "weekday", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + }, { + key: "isWeekend", + get: function get() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + }, { + key: "localWeekday", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + }, { + key: "localWeekNumber", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + }, { + key: "localWeekYear", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + }, { + key: "ordinal", + get: function get() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + }, { + key: "monthShort", + get: function get() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + }, { + key: "monthLong", + get: function get() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + }, { + key: "weekdayShort", + get: function get() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + }, { + key: "weekdayLong", + get: function get() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + }, { + key: "offset", + get: function get() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameShort", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameLong", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + }, { + key: "isOffsetFixed", + get: function get() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + }, { + key: "isInDST", + get: function get() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + }, { + key: "isInLeapYear", + get: function get() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + }, { + key: "daysInMonth", + get: function get() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + }, { + key: "daysInYear", + get: function get() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + }, { + key: "weeksInWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + }, { + key: "weeksInLocalWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + }], [{ + key: "DATE_SHORT", + get: function get() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED", + get: function get() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED_WITH_WEEKDAY", + get: function get() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_FULL", + get: function get() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_HUGE", + get: function get() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_SIMPLE", + get: function get() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SECONDS", + get: function get() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SHORT_OFFSET", + get: function get() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_LONG_OFFSET", + get: function get() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_SIMPLE", + get: function get() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SECONDS", + get: function get() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SHORT_OFFSET", + get: function get() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_LONG_OFFSET", + get: function get() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT", + get: function get() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT_WITH_SECONDS", + get: function get() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED", + get: function get() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_SECONDS", + get: function get() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_WEEKDAY", + get: function get() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL", + get: function get() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL_WITH_SECONDS", + get: function get() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE", + get: function get() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE_WITH_SECONDS", + get: function get() { + return DATETIME_HUGE_WITH_SECONDS; + } + }]); + return DateTime; + }(Symbol.for("nodejs.util.inspect.custom")); + function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError("Unknown datetime argument: " + dateTimeish + ", of type " + typeof dateTimeish); + } + } + + var VERSION = "3.4.4"; + + exports.DateTime = DateTime; + exports.Duration = Duration; + exports.FixedOffsetZone = FixedOffsetZone; + exports.IANAZone = IANAZone; + exports.Info = Info; + exports.Interval = Interval; + exports.InvalidZone = InvalidZone; + exports.Settings = Settings; + exports.SystemZone = SystemZone; + exports.VERSION = VERSION; + exports.Zone = Zone; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +})({}); +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/global/luxon.js.map b/node_modules/luxon/build/global/luxon.js.map new file mode 100644 index 0000000..e50b8ee --- /dev/null +++ b/node_modules/luxon/build/global/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/digits.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.4.4\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","_Error","_inheritsLoose","apply","arguments","_wrapNativeSuper","Error","InvalidDateTimeError","_LuxonError","reason","call","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","prototype","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","_createClass","key","get","name","singleton","SystemZone","_Zone","_ref","locale","parseZoneInfo","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","makeDTF","zone","hour12","era","typeToPos","hackyOffset","dtf","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","_formatted$i","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","resetCache","isValidSpecifier","isValidZone","e","_this","zoneName","valid","isNaN","NaN","_ref2","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","_opts","base","cacheKeyOpts","_objectWithoutPropertiesLoose","_excluded","RelativeTimeFormat","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","_options","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","intl","PolyNumberFormatter","forceSimple","padTo","floor","otherOpts","_excluded2","Object","keys","intlOpts","_extends","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","undefined","z","gmtOffset","offsetZ","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_proto3","count","English","numeric","fallbackWeekSettings","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","_temp","numbering","_parseLocaleString","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","_this2","formatStr","extract","weekdays","_this3","meridiems","_this4","eras","_this5","field","df","dtFormatter","results","matching","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","FixedOffsetZone","instance","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","now","twoDigitCutoffYear","throwOnInvalid","resetCaches","set","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","toString","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","towardZero","factor","pow","rounder","trunc","round","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","normalizeObject","normalizer","normalized","u","hours","sign","RangeError","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","_iterator","_createForOfIteratorHelperLoose","_step","done","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","tokenToField","lildur","mapped","tokens","realTokens","found","collapsed","shiftTo","filter","ianaRegex","combineRegexes","_len","regexes","_key","full","source","RegExp","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","regex","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","clear","conf","values","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","_Object$entries","entries","_Object$entries$_i","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","_parseISODuration","fromISOTime","_parseISOTimeOnly","week","toFormat","fmtOpts","toHuman","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","invalidReason","valueOf","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","_i4","_orderedUnits2","own","ak","negated","_i5","_Object$keys2","eq","v1","v2","_i6","_orderedUnits3","Symbol","for","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","_split","split","startIsValid","endIsValid","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","sofar","final","xor","_Array$prototype","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8","_ref8$locale","_temp9","_ref9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","_differs","_differs$_i","differ","_highOrderDiffs","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","parseDigits","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","digitRegex","append","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","explainFromTokens","disqualifyingUnit","_buildRegex","regexString","_match","rawMatches","parseFromTokens","_explainFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","longFormat","extendedZone","ianaName","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","quickDT","tsNow","offsetProvis","_objToTS","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","_iterator2","_step2","higherOrderInvalid","gregorian","_objToTS2","tsFinal","offsetFinal","_parseISODate","fromRFC2822","_parseRFC2822Date","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","resolvedLocaleOptions","_Formatter$create$res","toLocal","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","newTS","offsetGuess","asObj","_objToTS3","setLocale","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","ceil","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","ext","_ref6$format","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","dateTimeish","VERSION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EAEA;EACA;EACA;EAFA,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/global/luxon.min.js new file mode 100644 index 0000000..231f9d8 --- /dev/null +++ b/node_modules/luxon/build/global/luxon.min.js @@ -0,0 +1 @@ +var luxon=function(e){"use strict";function L(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(q(Error)),Y=function(t){function e(e){return t.call(this,"Invalid DateTime: "+e.toMessage())||this}return o(e,t),e}(t),P=function(t){function e(e){return t.call(this,"Invalid Interval: "+e.toMessage())||this}return o(e,t),e}(t),H=function(t){function e(e){return t.call(this,"Invalid Duration: "+e.toMessage())||this}return o(e,t),e}(t),w=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),J=function(t){function e(e){return t.call(this,"Invalid unit "+e)||this}return o(e,t),e}(t),u=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),n=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return o(t,e),t}(t),t="numeric",r="short",a="long",G={year:t,month:t,day:t},$={year:t,month:r,day:t},B={year:t,month:r,day:t,weekday:r},Q={year:t,month:a,day:t},K={year:t,month:a,day:t,weekday:a},X={hour:t,minute:t},ee={hour:t,minute:t,second:t},te={hour:t,minute:t,second:t,timeZoneName:r},ne={hour:t,minute:t,second:t,timeZoneName:a},re={hour:t,minute:t,hourCycle:"h23"},ie={hour:t,minute:t,second:t,hourCycle:"h23"},oe={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:r},ae={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:a},ue={year:t,month:t,day:t,hour:t,minute:t},se={year:t,month:t,day:t,hour:t,minute:t,second:t},le={year:t,month:r,day:t,hour:t,minute:t},ce={year:t,month:r,day:t,hour:t,minute:t,second:t},fe={year:t,month:r,day:t,weekday:r,hour:t,minute:t},de={year:t,month:a,day:t,hour:t,minute:t,timeZoneName:r},he={year:t,month:a,day:t,hour:t,minute:t,second:t,timeZoneName:r},me={year:t,month:a,day:t,weekday:a,hour:t,minute:t,timeZoneName:a},ye={year:t,month:a,day:t,weekday:a,hour:t,minute:t,second:t,timeZoneName:a},s=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new n},t.formatOffset=function(e,t){throw new n},t.offset=function(e){throw new n},t.equals=function(e){throw new n},i(e,[{key:"type",get:function(){throw new n}},{key:"name",get:function(){throw new n}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new n}},{key:"isValid",get:function(){throw new n}}]),e}(),ve=null,ge=function(e){function t(){return e.apply(this,arguments)||this}o(t,e);var n=t.prototype;return n.offsetName=function(e,t){return gt(e,t.format,t.locale)},n.formatOffset=function(e,t){return bt(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},i(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return ve=null===ve?new t:ve}}]),t}(s),pe={};var ke={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var we={},f=function(n){function r(e){var t=n.call(this)||this;return t.zoneName=e,t.valid=r.isValidZone(e),t}o(r,n),r.create=function(e){return we[e]||(we[e]=new r(e)),we[e]},r.resetCache=function(){we={},pe={}},r.isValidSpecifier=function(e){return this.isValidZone(e)},r.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var e=r.prototype;return e.offsetName=function(e,t){return gt(e,t.format,t.locale,this.name)},e.formatOffset=function(e,t){return bt(this.offset(e),t)},e.offset=function(e){var t,n,r,i,o,a,u,s,e=new Date(e);return isNaN(e)?NaN:(i=this.name,pe[i]||(pe[i]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),a=(i=(i=pe[i]).formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;iyt(i,t,n)?(r=i+1,a=1):r=i,l({weekYear:r,weekNumber:a,weekday:o},St(e))}function Ke(e,t,n){void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,a=e.weekday,n=Be(Je(i,1,t=void 0===t?4:t),n),u=M(i),o=7*o+a-n-7+t,a=(o<1?o+=M(r=i-1):uO.twoDigitCutoffYear?1900+e:2e3+e}function gt(e,t,n,r){void 0===r&&(r=null);var e=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},r=(r&&(i.timeZone=r),l({timeZoneName:t},i)),t=new Intl.DateTimeFormat(n,r).formatToParts(e).find(function(e){return"timezonename"===e.type.toLowerCase()});return t?t.value:null}function pt(e,t){e=parseInt(e,10),Number.isNaN(e)&&(e=0),t=parseInt(t,10)||0;return 60*e+(e<0||Object.is(e,-0)?-t:t)}function kt(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new u("Invalid unit value "+e);return t}function wt(e,t){var n,r,i={};for(n in e)h(e,n)&&null!=(r=e[n])&&(i[t(n)]=kt(r));return i}function bt(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=0<=e?"+":"-";switch(t){case"short":return i+m(n,2)+":"+m(r,2);case"narrow":return i+n+(0e},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&this.s<=e&&this.e>e},t.set=function(e){var e=void 0===e?{}:e,t=e.start,e=e.end;return this.isValid?l.fromDateTimes(t||this.s,e||this.e):this},t.splitAt=function(){var t=this;if(!this.isValid)return[];for(var e=arguments.length,n=new Array(e),r=0;r+this.e?this.e:s;o.push(l.fromDateTimes(a,s)),a=s,u+=1}return o},t.splitBy=function(e){var t=E.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var n=this.s,r=1,i=[];n+this.e?this.e:o;i.push(l.fromDateTimes(n,o)),n=o,r+=1}return i},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s=e.e},t.equals=function(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)},t.intersection=function(e){var t;return this.isValid?(t=(this.s>e.s?this:e).s,(e=(this.ee.e?this:e).e,l.fromDateTimes(t,e)):this},l.merge=function(e){var e=e.sort(function(e,t){return e.s-t.s}).reduce(function(e,t){var n=e[0],e=e[1];return e?e.overlaps(t)||e.abutsStart(t)?[n,e.union(t)]:[n.concat([e]),t]:[n,t]},[[],null]),t=e[0],e=e[1];return e&&t.push(e),t},l.xor=function(e){for(var t,n=null,r=0,i=[],e=e.map(function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]}),o=R((t=Array.prototype).concat.apply(t,e).sort(function(e,t){return e.time-t.time}));!(a=o()).done;)var a=a.value,n=1===(r+="s"===a.type?1:-1)?a.time:(n&&+n!=+a.time&&i.push(l.fromDateTimes(n,a.time)),null);return l.merge(i)},t.difference=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;rthis.valueOf())?this:e,r?e:this,t,n),r?e.negate():e):E.invalid("created by diffing an invalid DateTime")},t.diffNow=function(e,t){return void 0===e&&(e="milliseconds"),void 0===t&&(t={}),this.diff(k.now(),e,t)},t.until=function(e){return this.isValid?Mn.fromDateTimes(this,e):this},t.hasSame=function(e,t,n){var r;return!!this.isValid&&(r=e.valueOf(),(e=this.setZone(e.zone,{keepLocalTime:!0})).startOf(t,n)<=r)&&r<=e.endOf(t,n)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(e){var t,n,r,i;return this.isValid?(t=(e=void 0===e?{}:e).base||k.fromObject({},{zone:this.zone}),n=e.padding?thisthis.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return ft(this.year)}},{key:"daysInMonth",get:function(){return dt(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?M(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?yt(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?yt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return G}},{key:"DATE_MED",get:function(){return $}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return B}},{key:"DATE_FULL",get:function(){return Q}},{key:"DATE_HUGE",get:function(){return K}},{key:"TIME_SIMPLE",get:function(){return X}},{key:"TIME_WITH_SECONDS",get:function(){return ee}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return te}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return ne}},{key:"TIME_24_SIMPLE",get:function(){return re}},{key:"TIME_24_WITH_SECONDS",get:function(){return ie}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return oe}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return ae}},{key:"DATETIME_SHORT",get:function(){return ue}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return se}},{key:"DATETIME_MED",get:function(){return le}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return ce}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return fe}},{key:"DATETIME_FULL",get:function(){return de}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return he}},{key:"DATETIME_HUGE",get:function(){return me}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return ye}}]),k}(Symbol.for("nodejs.util.inspect.custom"));function yr(e){if(W.isDateTime(e))return e;if(e&&e.valueOf&&y(e.valueOf()))return W.fromJSDate(e);if(e&&"object"==typeof e)return W.fromObject(e);throw new u("Unknown datetime argument: "+e+", of type "+typeof e)}return e.DateTime=W,e.Duration=E,e.FixedOffsetZone=d,e.IANAZone=f,e.Info=In,e.Interval=Mn,e.InvalidZone=Le,e.Settings=O,e.SystemZone=ge,e.VERSION="3.4.4",e.Zone=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); \ No newline at end of file diff --git a/node_modules/luxon/build/global/luxon.min.js.map b/node_modules/luxon/build/global/luxon.min.js.map new file mode 100644 index 0000000..62e01cc --- /dev/null +++ b/node_modules/luxon/build/global/luxon.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"build/global/luxon.js","sources":["0"],"names":["luxon","exports","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","arg","key","input","hint","prim","Symbol","toPrimitive","undefined","String","Number","res","call","TypeError","_createClass","Constructor","protoProps","staticProps","prototype","_extends","assign","bind","arguments","source","hasOwnProperty","apply","this","_inheritsLoose","subClass","superClass","create","_setPrototypeOf","constructor","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","p","_construct","Parent","args","Class","Reflect","construct","sham","Proxy","Boolean","valueOf","e","a","push","instance","Function","_wrapNativeSuper","_cache","Map","toString","indexOf","has","get","set","Wrapper","value","_objectWithoutPropertiesLoose","excluded","sourceKeys","keys","_arrayLikeToArray","arr","len","arr2","Array","_createForOfIteratorHelperLoose","allowArrayLike","it","iterator","next","isArray","minLen","n","slice","name","from","test","done","LuxonError","_Error","Error","InvalidDateTimeError","_LuxonError","reason","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","singleton$1","SystemZone","_Zone","_ref","parseZoneInfo","locale","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","typeToPos","era","ianaZoneCache","IANAZone","_this","zoneName","valid","isValidZone","resetCache","isValidSpecifier","zone","adOrBc","dtf","date","fDay","adjustedHour","over","isNaN","NaN","hour12","_ref2","formatToParts","formatted","filled","_formatted$i","pos","isUndefined","parseInt","replace","fMonth","parsed","exec","asTS","objToLocalTS","Math","abs","millisecond","_excluded","_excluded2","intlLFCache","intlDTCache","getCachedDTF","locString","JSON","stringify","intlNumCache","intlRelCache","sysLocaleCache","weekInfoCache","listStuff","loc","englishFn","intlFn","mode","listingMode","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","intlOpts","useGrouping","minimumIntegerDigits","inf","NumberFormat","fixed","padStart","roundTo","PolyDateFormatter","dt","z","originalZone","offsetZ","gmtOffset","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_opts","base","cacheKeyOpts","RelativeTimeFormat","_proto3","count","formatRelativeTime","numeric","narrow","units","years","quarters","months","weeks","days","hours","seconds","lastable","isDay","isInPast","is","singular","fmtValue","lilUnits","fmtUnit","fallbackWeekSettings","firstDay","minimalDays","weekend","Locale","numbering","outputCalendar","weekSettings","specifiedLocale","_parseLocaleString","localeStr","xIndex","uIndex","substring","options","selectedStr","smaller","_options","numberingSystem","calendar","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","includes","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","fromOpts","defaultToEN","Settings","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","validateWeekSettings","defaultWeekSettings","fromObject","_temp","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","_this2","formatStr","f","ms","DateTime","utc","extract","weekdays","_this3","meridiems","_this4","eras","_this5","field","matching","dtFormatter","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","ListFormat","startsWith","getWeekSettings","hasLocaleWeekInfo","data","getWeekInfo","weekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","singleton","FixedOffsetZone","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","defaultZone","lowered","isNumber","throwOnInvalid","now","twoDigitCutoffYear","resetCaches","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekYear","weekNumber","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","localWeekday","localWeekNumber","localWeekYear","hasInvalidGregorianData","validYear","isInteger","validMonth","integerBetween","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","bestBy","by","compare","reduce","best","pair","prop","settings","some","v","thing","bottom","top","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","towardZero","factor","pow","trunc","round","modMonth","x","firstWeekOffset","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","offMin","asNumber","numericValue","normalizeObject","normalizer","u","normalized","sign","RangeError","k","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","stringifyTokens","splits","tokenToString","_iterator","_step","token","literal","val","_macroTokenToFormatOpts","D","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","formatOpts","systemLoc","parseFormat","fmt","current","currentFull","bracketed","c","charAt","macroTokenToFormatOpts","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","quarter","formatDurationFromString","dur","lildur","tokenToField","tokens","realTokens","found","collapsed","shiftTo","filter","mapped","ianaRegex","combineRegexes","_len","regexes","_key","full","RegExp","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","regex","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","extractISOWeekData","extractISOOrdinalData","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","maybeNegate","force","hasNegativePrefix","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","negativeSeconds","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","extractISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","INVALID$2","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits$1","reverseUnits","reverse","clone$1","clear","conf","values","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","conv","rollUp","previousVal","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","fromISOTime","week","toFormat","fmtOpts","toHuman","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","toJSON","invalidReason","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","reconfigure","as","normalize","rescale","newVals","_Object$entries","entries","_Object$entries$_i","shiftToAll","built","accumulated","_i4","_orderedUnits2","ak","lastUnit","own","negated","_i5","_Object$keys2","v1","_i6","_orderedUnits3","v2","for","INVALID$1","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","endIsValid","_split","split","startIsValid","_dur","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","dateTime","isBefore","contains","splitAt","dateTimes","sorted","sort","b","results","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","item","sofar","final","xor","_Array$prototype","currentCount","ends","time","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8$locale","_temp9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","_diff","_highOrderDiffs","lowestOrder","highWater","_differs","_differs$_i","differ","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","digitRegex","append","MISSING_FTP","intUnit","post","deser","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","spaceOrNBSP","fromCharCode","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","simple","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","partTypeStyleToTokenVal","2-digit","short","long","dayperiod","dayPeriod","hour24","dummyDateTimeCache","expandMacroTokens","formatOptsToTokens","explainFromTokens","disqualifyingUnit","matches","_buildRegex","handlers","_match","h","all","matchIndex","rawMatches","Z","specificOffset","q","M","G","y","S","resolvedOpts","df","isSpace","actualType","INVALID","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","toTechFormat","_toISODate","extended","longFormat","_toISOTime","extendedZone","ianaName","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedUnits","orderedWeekUnits","orderedOrdinalUnits","normalizeUnitWithLocalWeeks","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","quickDT","tsNow","_objToTS","diffRelative","calendary","lastOpts","argList","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","offsetProvis","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","defaultValues","useWeekData","objNow","foundFirst","_iterator2","_step2","validWeek","validWeekday","validOrdinal","_objToTS2","_parseISODate","fromRFC2822","_parseRFC2822Date","trim","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","_explainFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","getPossibleOffsets","ts1","ts2","c1","c2","oEarlier","oLater","o1","resolvedLocaleOptions","_Formatter$create$res","toLocal","newTS","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","offsetGuess","setLocale","mixed","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","ceil","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","ext","_ref6$format","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","otherIsLater","durOpts","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","dateTimeish","VERSION"],"mappings":"AAAA,IAAIA,MAAQ,SAAWC,GACrB,aAEA,SAASC,EAAkBC,EAAQC,GACjC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,CAAC,GAAI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C,QAXM,QAYdrnC,EAAQsJ,KAAOA,EAEf5I,OAAOC,eAAeX,EAAS,aAAc,CAAE0E,MAAO,CAAA,CAAK,CAAC,EAErD1E,CAER,EAAE,EAAE"} \ No newline at end of file diff --git a/node_modules/luxon/build/node/luxon.js b/node_modules/luxon/build/node/luxon.js new file mode 100644 index 0000000..457dc95 --- /dev/null +++ b/node_modules/luxon/build/node/luxon.js @@ -0,0 +1,7384 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// these aren't really private, but nor are they really useful to document + +/** + * @private + */ +class LuxonError extends Error {} + +/** + * @private + */ +class InvalidDateTimeError extends LuxonError { + constructor(reason) { + super(`Invalid DateTime: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidIntervalError extends LuxonError { + constructor(reason) { + super(`Invalid Interval: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidDurationError extends LuxonError { + constructor(reason) { + super(`Invalid Duration: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class ConflictingSpecificationError extends LuxonError {} + +/** + * @private + */ +class InvalidUnitError extends LuxonError { + constructor(unit) { + super(`Invalid unit ${unit}`); + } +} + +/** + * @private + */ +class InvalidArgumentError extends LuxonError {} + +/** + * @private + */ +class ZoneIsAbstractError extends LuxonError { + constructor() { + super("Zone is an abstract class"); + } +} + +/** + * @private + */ + +const n = "numeric", + s = "short", + l = "long"; +const DATE_SHORT = { + year: n, + month: n, + day: n +}; +const DATE_MED = { + year: n, + month: s, + day: n +}; +const DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s +}; +const DATE_FULL = { + year: n, + month: l, + day: n +}; +const DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l +}; +const TIME_SIMPLE = { + hour: n, + minute: n +}; +const TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n +}; +const TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +const TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l +}; +const TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" +}; +const TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" +}; +const TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s +}; +const TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l +}; +const DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n +}; +const DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n +}; +const DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n +}; +const DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n +}; +const DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n +}; +const DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s +}; +const DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +const DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l +}; +const DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l +}; + +/** + * @interface + */ +class Zone { + /** + * The type of zone + * @abstract + * @type {string} + */ + get type() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + get name() { + throw new ZoneIsAbstractError(); + } + get ianaName() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + get isUniversal() { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */ + offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */ + get isValid() { + throw new ZoneIsAbstractError(); + } +} + +let singleton$1 = null; + +/** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ +class SystemZone extends Zone { + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + static get instance() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + + /** @override **/ + get type() { + return "system"; + } + + /** @override **/ + get name() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName(ts, { + format, + locale + }) { + return parseZoneInfo(ts, format, locale); + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/ + offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/ + get isValid() { + return true; + } +} + +let dtfCache = {}; +function makeDTF(zone) { + if (!dtfCache[zone]) { + dtfCache[zone] = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zone, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + } + return dtfCache[zone]; +} +const typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 +}; +function hackyOffset(dtf, date) { + const formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; +} +function partsOffset(dtf, date) { + const formatted = dtf.formatToParts(date); + const filled = []; + for (let i = 0; i < formatted.length; i++) { + const { + type, + value + } = formatted[i]; + const pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; +} +let ianaZoneCache = {}; +/** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ +class IANAZone extends Zone { + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + static create(name) { + if (!ianaZoneCache[name]) { + ianaZoneCache[name] = new IANAZone(name); + } + return ianaZoneCache[name]; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCache() { + ianaZoneCache = {}; + dtfCache = {}; + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated This method returns false for some valid IANA names. Use isValidZone instead. + * @return {boolean} + */ + static isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */ + static isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + } + constructor(name) { + super(); + /** @private **/ + this.zoneName = name; + /** @private **/ + this.valid = IANAZone.isValidZone(name); + } + + /** @override **/ + get type() { + return "iana"; + } + + /** @override **/ + get name() { + return this.zoneName; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName(ts, { + format, + locale + }) { + return parseZoneInfo(ts, format, locale, this.name); + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/ + offset(ts) { + const date = new Date(ts); + if (isNaN(date)) return NaN; + const dtf = makeDTF(this.name); + let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date); + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + const adjustedHour = hour === 24 ? 0 : hour; + const asUTC = objToLocalTS({ + year, + month, + day, + hour: adjustedHour, + minute, + second, + millisecond: 0 + }); + let asTS = +date; + const over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** @override **/ + get isValid() { + return this.valid; + } +} + +// todo - remap caching + +let intlLFCache = {}; +function getCachedLF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; +} +let intlDTCache = {}; +function getCachedDTF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlDTCache[key]; + if (!dtf) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache[key] = dtf; + } + return dtf; +} +let intlNumCache = {}; +function getCachedINF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let inf = intlNumCache[key]; + if (!inf) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache[key] = inf; + } + return inf; +} +let intlRelCache = {}; +function getCachedRTF(locString, opts = {}) { + const { + base, + ...cacheKeyOpts + } = opts; // exclude `base` from the options + const key = JSON.stringify([locString, cacheKeyOpts]); + let inf = intlRelCache[key]; + if (!inf) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache[key] = inf; + } + return inf; +} +let sysLocaleCache = null; +function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } +} +let weekInfoCache = {}; +function getCachedWeekInfo(locString) { + let data = weekInfoCache[locString]; + if (!data) { + const locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + weekInfoCache[locString] = data; + } + return data; +} +function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + const xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + const uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + let options; + let selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + const smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + const { + numberingSystem, + calendar + } = options; + return [selectedStr, numberingSystem, calendar]; + } +} +function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += `-ca-${outputCalendar}`; + } + if (numberingSystem) { + localeStr += `-nu-${numberingSystem}`; + } + return localeStr; + } else { + return localeStr; + } +} +function mapMonths(f) { + const ms = []; + for (let i = 1; i <= 12; i++) { + const dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; +} +function mapWeekdays(f) { + const ms = []; + for (let i = 1; i <= 7; i++) { + const dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; +} +function listStuff(loc, length, englishFn, intlFn) { + const mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } +} +function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn"; + } +} + +/** + * @private + */ + +class PolyNumberFormatter { + constructor(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + const { + padTo, + floor, + ...otherOpts + } = opts; + if (!forceSimple || Object.keys(otherOpts).length > 0) { + const intlOpts = { + useGrouping: false, + ...opts + }; + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + format(i) { + if (this.inf) { + const fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + const fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(fixed, this.padTo); + } + } +} + +/** + * @private + */ + +class PolyDateFormatter { + constructor(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + let z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + const gmtOffset = -1 * (dt.offset / 60); + const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + const intlOpts = { + ...this.opts + }; + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(({ + value + }) => value).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + } + formatToParts() { + const parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(part => { + if (part.type === "timeZoneName") { + const offsetName = this.originalZone.offsetName(this.dt.ts, { + locale: this.dt.locale, + format: this.opts.timeZoneName + }); + return { + ...part, + value: offsetName + }; + } else { + return part; + } + }); + } + return parts; + } + resolvedOptions() { + return this.dtf.resolvedOptions(); + } +} + +/** + * @private + */ +class PolyRelFormatter { + constructor(intl, isEnglish, opts) { + this.opts = { + style: "long", + ...opts + }; + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + } + formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + } +} +const fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] +}; + +/** + * @private + */ + +class Locale { + static fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + } + static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) { + const specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human readable strings but annoying for parsing/formatting known formats + const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + } + static resetCache() { + sysLocaleCache = null; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; + } + static fromObject({ + locale, + numberingSystem, + outputCalendar, + weekSettings + } = {}) { + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + } + constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale); + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + get fastNumbers() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + listingMode() { + const isActuallyEn = this.isEnglish(); + const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + } + clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + } + redefaultToEN(alts = {}) { + return this.clone({ + ...alts, + defaultToEN: true + }); + } + redefaultToSystem(alts = {}) { + return this.clone({ + ...alts, + defaultToEN: false + }); + } + months(length, format = false) { + return listStuff(this, length, months, () => { + const intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!this.monthsCache[formatStr][length]) { + this.monthsCache[formatStr][length] = mapMonths(dt => this.extract(dt, intl, "month")); + } + return this.monthsCache[formatStr][length]; + }); + } + weekdays(length, format = false) { + return listStuff(this, length, weekdays, () => { + const intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!this.weekdaysCache[formatStr][length]) { + this.weekdaysCache[formatStr][length] = mapWeekdays(dt => this.extract(dt, intl, "weekday")); + } + return this.weekdaysCache[formatStr][length]; + }); + } + meridiems() { + return listStuff(this, undefined, () => meridiems, () => { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!this.meridiemCache) { + const intl = { + hour: "numeric", + hourCycle: "h12" + }; + this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(dt => this.extract(dt, intl, "dayperiod")); + } + return this.meridiemCache; + }); + } + eras(length) { + return listStuff(this, length, eras, () => { + const intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!this.eraCache[length]) { + this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(dt => this.extract(dt, intl, "era")); + } + return this.eraCache[length]; + }); + } + extract(dt, intlOpts, field) { + const df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(m => m.type.toLowerCase() === field); + return matching ? matching.value : null; + } + numberFormatter(opts = {}) { + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + } + dtFormatter(dt, intlOpts = {}) { + return new PolyDateFormatter(dt, this.intl, intlOpts); + } + relFormatter(opts = {}) { + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + } + listFormatter(opts = {}) { + return getCachedLF(this.intl, opts); + } + isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us"); + } + getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + } + getStartOfWeek() { + return this.getWeekSettings().firstDay; + } + getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + } + getWeekendDays() { + return this.getWeekSettings().weekend; + } + equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + } +} + +let singleton = null; + +/** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ +class FixedOffsetZone extends Zone { + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + static get utcInstance() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + static instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */ + static parseSpecifier(s) { + if (s) { + const r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + } + constructor(offset) { + super(); + /** @private **/ + this.fixed = offset; + } + + /** @override **/ + get type() { + return "fixed"; + } + + /** @override **/ + get name() { + return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`; + } + get ianaName() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`; + } + } + + /** @override **/ + offsetName() { + return this.name; + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.fixed, format); + } + + /** @override **/ + get isUniversal() { + return true; + } + + /** @override **/ + offset() { + return this.fixed; + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** @override **/ + get isValid() { + return true; + } +} + +/** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ +class InvalidZone extends Zone { + constructor(zoneName) { + super(); + /** @private */ + this.zoneName = zoneName; + } + + /** @override **/ + get type() { + return "invalid"; + } + + /** @override **/ + get name() { + return this.zoneName; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName() { + return null; + } + + /** @override **/ + formatOffset() { + return ""; + } + + /** @override **/ + offset() { + return NaN; + } + + /** @override **/ + equals() { + return false; + } + + /** @override **/ + get isValid() { + return false; + } +} + +/** + * @private + */ +function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + const lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } +} + +let now = () => Date.now(), + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + +/** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ +class Settings { + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + static get now() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */ + static set now(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + static set defaultZone(zone) { + defaultZone = zone; + } + + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + static get defaultZone() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultLocale() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultLocale(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultNumberingSystem() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultNumberingSystem(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultOutputCalendar() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultOutputCalendar(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + static get defaultWeekSettings() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */ + static set defaultWeekSettings(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + */ + static get twoDigitCutoffYear() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */ + static set twoDigitCutoffYear(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static get throwOnInvalid() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static set throwOnInvalid(t) { + throwOnInvalid = t; + } + + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + } +} + +class Invalid { + constructor(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + toMessage() { + if (this.explanation) { + return `${this.reason}: ${this.explanation}`; + } else { + return this.reason; + } + } +} + +const nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; +function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`); +} +function dayOfWeek(year, month, day) { + const d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + const js = d.getUTCDay(); + return js === 0 ? 7 : js; +} +function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; +} +function uncomputeOrdinal(year, ordinal) { + const table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(i => i < ordinal), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day + }; +} +function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; +} + +/** + * @private + */ + +function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { + year, + month, + day + } = gregObj, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return { + weekYear, + weekNumber, + weekday, + ...timeObject(gregObj) + }; +} +function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { + weekYear, + weekNumber, + weekday + } = weekData, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + const { + month, + day + } = uncomputeOrdinal(year, ordinal); + return { + year, + month, + day, + ...timeObject(weekData) + }; +} +function gregorianToOrdinal(gregData) { + const { + year, + month, + day + } = gregData; + const ordinal = computeOrdinal(year, month, day); + return { + year, + ordinal, + ...timeObject(gregData) + }; +} +function ordinalToGregorian(ordinalData) { + const { + year, + ordinal + } = ordinalData; + const { + month, + day + } = uncomputeOrdinal(year, ordinal); + return { + year, + month, + day, + ...timeObject(ordinalData) + }; +} + +/** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ +function usesLocalWeekValues(obj, loc) { + const hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + const hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } +} +function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; +} +function hasInvalidOrdinalData(obj) { + const validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; +} +function hasInvalidGregorianData(obj) { + const validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; +} +function hasInvalidTimeData(obj) { + const { + hour, + minute, + second, + millisecond + } = obj; + const validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; +} + +/* + This is just a junk drawer, containing anything used across multiple classes. + Because Luxon is small(ish), this should stay small and we won't worry about splitting + it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area. +*/ + +/** + * @private + */ + +// TYPES + +function isUndefined(o) { + return typeof o === "undefined"; +} +function isNumber(o) { + return typeof o === "number"; +} +function isInteger(o) { + return typeof o === "number" && o % 1 === 0; +} +function isString(o) { + return typeof o === "string"; +} +function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; +} + +// CAPABILITIES + +function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } +} +function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } +} + +// OBJECTS AND ARRAYS + +function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; +} +function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce((best, next) => { + const pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; +} +function pick(obj, keys) { + return keys.reduce((a, k) => { + a[k] = obj[k]; + return a; + }, {}); +} +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} +function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(v => !integerBetween(v, 1, 7))) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } +} + +// NUMBERS AND STRINGS + +function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; +} + +// x % n but takes the sign of n instead of x +function floorMod(x, n) { + return x - n * Math.floor(x / n); +} +function padStart(input, n = 2) { + const isNeg = input < 0; + let padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; +} +function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } +} +function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } +} +function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + const f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } +} +function roundTo(number, digits, towardZero = false) { + const factor = 10 ** digits, + rounder = towardZero ? Math.trunc : Math.round; + return rounder(number * factor) / factor; +} + +// DATE BASICS + +function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} +function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; +} +function daysInMonth(year, month) { + const modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } +} + +// convert a calendar object to a local timestamp (epoch, but with the offset baked in) +function objToLocalTS(obj) { + let d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; +} + +// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js +function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; +} +function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) { + const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; +} +function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; +} + +// PARSING + +function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) { + const date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + const modified = { + timeZoneName: offsetFormat, + ...intlOpts + }; + const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(m => m.type.toLowerCase() === "timezonename"); + return parsed ? parsed.value : null; +} + +// signedOffset('-5', '30') -> -330 +function signedOffset(offHourStr, offMinuteStr) { + let offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + const offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; +} + +// COERCION + +function asNumber(value) { + const numericValue = Number(value); + if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue)) throw new InvalidArgumentError(`Invalid unit value ${value}`); + return numericValue; +} +function normalizeObject(obj, normalizer) { + const normalized = {}; + for (const u in obj) { + if (hasOwnProperty(obj, u)) { + const v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; +} +function formatOffset(offset, format) { + const hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`; + case "narrow": + return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`; + case "techie": + return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`; + default: + throw new RangeError(`Value format ${format} is out of range for property format`); + } +} +function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); +} + +/** + * @private + */ + +const monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; +const monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +const monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; +function months(length) { + switch (length) { + case "narrow": + return [...monthsNarrow]; + case "short": + return [...monthsShort]; + case "long": + return [...monthsLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } +} +const weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; +const weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; +const weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; +function weekdays(length) { + switch (length) { + case "narrow": + return [...weekdaysNarrow]; + case "short": + return [...weekdaysShort]; + case "long": + return [...weekdaysLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } +} +const meridiems = ["AM", "PM"]; +const erasLong = ["Before Christ", "Anno Domini"]; +const erasShort = ["BC", "AD"]; +const erasNarrow = ["B", "A"]; +function eras(length) { + switch (length) { + case "narrow": + return [...erasNarrow]; + case "short": + return [...erasShort]; + case "long": + return [...erasLong]; + default: + return null; + } +} +function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; +} +function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; +} +function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; +} +function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; +} +function formatRelativeTime(unit, count, numeric = "always", narrow = false) { + const units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + const isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : `next ${units[unit][0]}`; + case -1: + return isDay ? "yesterday" : `last ${units[unit][0]}`; + case 0: + return isDay ? "today" : `this ${units[unit][0]}`; + } + } + + const isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`; +} + +function stringifyTokens(splits, tokenToString) { + let s = ""; + for (const token of splits) { + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; +} +const macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS +}; + +/** + * @private + */ + +class Formatter { + static create(locale, opts = {}) { + return new Formatter(locale, opts); + } + static parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + let current = null, + currentFull = "", + bracketed = false; + const splits = []; + for (let i = 0; i < fmt.length; i++) { + const c = fmt.charAt(i); + if (c === "'") { + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + } + static macroTokenToFormatOpts(token) { + return macroTokenToFormatOpts[token]; + } + constructor(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + const df = this.systemLoc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + return df.format(); + } + dtFormatter(dt, opts = {}) { + return this.loc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + } + formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + } + formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + } + formatInterval(interval, opts) { + const df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + } + resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + } + num(n, p = 0) { + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + const opts = { + ...this.opts + }; + if (p > 0) { + opts.padTo = p; + } + return this.loc.numberFormatter(opts).format(n); + } + formatDateTimeFromString(dt, fmt) { + const knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = (opts, extract) => this.loc.extract(dt, opts, extract), + formatOffset = opts => { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = () => knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"), + month = (length, standalone) => knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"), + weekday = (length, standalone) => knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"), + maybeMacro = token => { + const formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = length => knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"), + tokenToString = token => { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return this.num(dt.millisecond, 3); + // seconds + case "s": + return this.num(dt.second); + case "ss": + return this.num(dt.second, 2); + // fractional seconds + case "uu": + return this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return this.num(dt.minute); + case "mm": + return this.num(dt.minute, 2); + // hours + case "h": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return this.num(dt.hour); + case "HH": + return this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return this.num(dt.weekYear, 4); + case "W": + return this.num(dt.weekNumber); + case "WW": + return this.num(dt.weekNumber, 2); + case "n": + return this.num(dt.localWeekNumber); + case "nn": + return this.num(dt.localWeekNumber, 2); + case "ii": + return this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return this.num(dt.localWeekYear, 4); + case "o": + return this.num(dt.ordinal); + case "ooo": + return this.num(dt.ordinal, 3); + case "q": + // like 1 + return this.num(dt.quarter); + case "qq": + // like 01 + return this.num(dt.quarter, 2); + case "X": + return this.num(Math.floor(dt.ts / 1000)); + case "x": + return this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + } + formatDurationFromString(dur, fmt) { + const tokenToField = token => { + switch (token[0]) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + return "hour"; + case "d": + return "day"; + case "w": + return "week"; + case "M": + return "month"; + case "y": + return "year"; + default: + return null; + } + }, + tokenToString = lildur => token => { + const mapped = tokenToField(token); + if (mapped) { + return this.num(lildur.get(mapped), token.length); + } else { + return token; + } + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce((found, { + literal, + val + }) => literal ? found : found.concat(val), []), + collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter(t => t)); + return stringifyTokens(tokens, tokenToString(collapsed)); + } +} + +/* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + +const ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; +function combineRegexes(...regexes) { + const full = regexes.reduce((f, r) => f + r.source, ""); + return RegExp(`^${full}$`); +} +function combineExtractors(...extractors) { + return m => extractors.reduce(([mergedVals, mergedZone, cursor], ex) => { + const [val, zone, next] = ex(m, cursor); + return [{ + ...mergedVals, + ...val + }, zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); +} +function parse(s, ...patterns) { + if (s == null) { + return [null, null]; + } + for (const [regex, extractor] of patterns) { + const m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; +} +function simpleParse(...keys) { + return (match, cursor) => { + const ret = {}; + let i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; +} + +// ISO and SQL parsing +const offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/; +const isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`; +const isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; +const isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`); +const isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`); +const isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; +const isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; +const isoOrdinalRegex = /(\d{4})-?(\d{3})/; +const extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); +const extractISOOrdinalData = simpleParse("year", "ordinal"); +const sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one +const sqlTimeRegex = RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`); +const sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`); +function int(match, pos, fallback) { + const m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); +} +function extractISOYmd(match, cursor) { + const item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; +} +function extractISOTime(match, cursor) { + const item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; +} +function extractISOOffset(match, cursor) { + const local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; +} +function extractIANAZone(match, cursor) { + const zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; +} + +// ISO time parsing + +const isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`); + +// ISO duration parsing + +const isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; +function extractISODuration(match) { + const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match; + const hasNegativePrefix = s[0] === "-"; + const negativeSeconds = secondStr && secondStr[0] === "-"; + const maybeNegate = (num, force = false) => num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; +} + +// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York +// and not just that we're in -240 *right now*. But since I don't think these are used that often +// I'm just going to ignore that +const obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 +}; +function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + const result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; +} + +// RFC 2822/5322 +const rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; +function extractRFC2822(match) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr, obsOffset, milOffset, offHourStr, offMinuteStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + let offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; +} +function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); +} + +// http date + +const rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; +function extractRFC1123Or850(match) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +function extractASCII(match) { + const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +const isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); +const isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); +const isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); +const isoTimeCombinedRegex = combineRegexes(isoTimeRegex); +const extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); +const extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); +const extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); +const extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + +/* + * @private + */ + +function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); +} +function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); +} +function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); +} +function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); +} +const extractISOTimeOnly = combineExtractors(extractISOTime); +function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); +} +const sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); +const sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); +const extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); +function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); +} + +const INVALID$2 = "Invalid Duration"; + +// unit conversion constants +const lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = { + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + }, + ...lowOrderMatrix + }, + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = { + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + }, + ...lowOrderMatrix + }; + +// units ordered by size +const orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; +const reverseUnits = orderedUnits$1.slice(0).reverse(); + +// clone really means "create another instance just like this one, but with these changes" +function clone$1(dur, alts, clear = false) { + // deep merge for vals + const conf = { + values: clear ? alts.values : { + ...dur.values, + ...(alts.values || {}) + }, + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); +} +function durationToMillis(matrix, vals) { + var _vals$milliseconds; + let sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (const unit of reverseUnits.slice(1)) { + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; +} + +// NB: mutates parameters +function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const previousVal = vals[previous] * factor; + const conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + const rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); +} + +// Remove all properties with a value of 0 from an object +function removeZeroes(vals) { + const newVals = {}; + for (const [key, value] of Object.entries(vals)) { + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; +} + +/** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ +class Duration { + /** + * @private + */ + constructor(config) { + const accurate = config.conversionAccuracy === "longterm" || false; + let matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + static fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */ + static fromObject(obj, opts = {}) { + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */ + static fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError(`Unknown duration argument ${durationLike} of type ${typeof durationLike}`); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */ + static fromISO(text, opts) { + const [parsed] = parseISODuration(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */ + static fromISOTime(text, opts) { + const [parsed] = parseISOTimeOnly(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid + }); + } + } + + /** + * @private + */ + static normalizeUnit(unit) { + const normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @return {string} + */ + toFormat(fmt, opts = {}) { + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + const fmtOpts = { + ...opts, + floor: opts.round !== false && opts.floor !== false + }; + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @example + * ```js + * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' + * ``` + */ + toHuman(opts = {}) { + if (!this.isValid) return INVALID$2; + const l = orderedUnits$1.map(unit => { + const val = this.values[unit]; + if (isUndefined(val)) { + return null; + } + return this.loc.numberFormatter({ + style: "unit", + unitDisplay: "long", + ...opts, + unit: unit.slice(0, -1) + }).format(val); + }).filter(n => n); + return this.loc.listFormatter({ + type: "conjunction", + style: opts.listStyle || "narrow", + ...opts + }).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */ + toObject() { + if (!this.isValid) return {}; + return { + ...this.values + }; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */ + toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + let s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */ + toISOTime(opts = {}) { + if (!this.isValid) return null; + const millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = { + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended", + ...opts, + includeOffset: false + }; + const dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */ + toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Duration { values: ${JSON.stringify(this.values)} }`; + } else { + return `Duration { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */ + toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + plus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration), + result = {}; + for (const k of orderedUnits$1) { + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + minus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */ + mapUnits(fn) { + if (!this.isValid) return this; + const result = {}; + for (const k of Object.keys(this.values)) { + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */ + get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */ + set(values) { + if (!this.isValid) return this; + const mixed = { + ...this.values, + ...normalizeObject(values, Duration.normalizeUnit) + }; + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */ + reconfigure({ + locale, + numberingSystem, + conversionAccuracy, + matrix + } = {}) { + const loc = this.loc.clone({ + locale, + numberingSystem + }); + const opts = { + loc, + matrix, + conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */ + as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */ + normalize() { + if (!this.isValid) return this; + const vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */ + rescale() { + if (!this.isValid) return this; + const vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */ + shiftTo(...units) { + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(u => Duration.normalizeUnit(u)); + const built = {}, + accumulated = {}, + vals = this.toObject(); + let lastUnit; + for (const k of orderedUnits$1) { + if (units.indexOf(k) >= 0) { + lastUnit = k; + let own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (const ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + const i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (const key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */ + shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */ + negate() { + if (!this.isValid) return this; + const negated = {}; + for (const k of Object.keys(this.values)) { + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Get the years. + * @type {number} + */ + get years() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + get quarters() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + get months() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + get weeks() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + get days() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + get hours() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + get minutes() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + get seconds() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + get milliseconds() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (const u of orderedUnits$1) { + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + } +} + +const INVALID$1 = "Invalid Interval"; + +// checks if the start is equal to or before the end +function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`); + } else { + return null; + } +} + +/** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ +class Interval { + /** + * @private + */ + constructor(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */ + static fromDateTimes(start, end) { + const builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + const validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static after(start, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static before(end, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */ + static fromISO(text, opts) { + const [s, e] = (text || "").split("/", 2); + if (s && e) { + let start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + let end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + const dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + const dur = Duration.fromISO(s, opts); + if (dur.isValid) { + return Interval.before(end, dur); + } + } + } + return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */ + get start() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval + * @type {DateTime} + */ + get end() { + return this.isValid ? this.e : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + get isValid() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + length(unit = "milliseconds") { + return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */ + count(unit = "milliseconds", opts) { + if (!this.isValid) return NaN; + const start = this.start.startOf(unit, opts); + let end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */ + hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */ + isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */ + set({ + start, + end + } = {}) { + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */ + splitAt(...dateTimes) { + if (!this.isValid) return []; + const sorted = dateTimes.map(friendlyDateTime).filter(d => this.contains(d)).sort((a, b) => a.toMillis() - b.toMillis()), + results = []; + let { + s + } = this, + i = 0; + while (s < this.e) { + const added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */ + splitBy(duration) { + const dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + let { + s + } = this, + idx = 1, + next; + const results = []; + while (s < this.e) { + const added = this.start.plus(dur.mapUnits(x => x * idx)); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */ + divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */ + overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */ + abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */ + abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Return whether this Interval engulfs the start and end of the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */ + intersection(other) { + if (!this.isValid) return this; + const s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */ + union(other) { + if (!this.isValid) return this; + const s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into a equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * @param {Array} intervals + * @return {Array} + */ + static merge(intervals) { + const [found, final] = intervals.sort((a, b) => a.s - b.s).reduce(([sofar, current], item) => { + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]); + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */ + static xor(intervals) { + let start = null, + currentCount = 0; + const results = [], + ends = intervals.map(i => [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]), + flattened = Array.prototype.concat(...ends), + arr = flattened.sort((a, b) => a.time - b.time); + for (const i of arr) { + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */ + difference(...intervals) { + return Interval.xor([this].concat(intervals)).map(i => this.intersection(i)).filter(i => i && !i.isEmpty()); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */ + toString() { + if (!this.isValid) return INVALID$1; + return `[${this.s.toISO()} – ${this.e.toISO()})`; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`; + } else { + return `Interval { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISO(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */ + toISODate() { + if (!this.isValid) return INVALID$1; + return `${this.s.toISODate()}/${this.e.toISODate()}`; + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */ + toFormat(dateFormat, { + separator = " – " + } = {}) { + if (!this.isValid) return INVALID$1; + return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */ + toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */ + mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + } +} + +/** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ +class Info { + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + static hasDST(zone = Settings.defaultZone) { + const proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */ + static isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */ + static normalizeZone(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */ + static getStartOfWeek({ + locale = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */ + static getMinimumDaysInFirstWeek({ + locale = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */ + static getWeekendWeekdays({ + locale = null, + locObj = null + } = {}) { + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */ + static months(length = "long", { + locale = null, + numberingSystem = null, + locObj = null, + outputCalendar = "gregory" + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */ + static monthsFormat(length = "long", { + locale = null, + numberingSystem = null, + locObj = null, + outputCalendar = "gregory" + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */ + static weekdays(length = "long", { + locale = null, + numberingSystem = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */ + static weekdaysFormat(length = "long", { + locale = null, + numberingSystem = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */ + static meridiems({ + locale = null + } = {}) { + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */ + static eras(length = "short", { + locale = null + } = {}) { + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */ + static features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + } +} + +function dayDiff(earlier, later) { + const utcDayStart = dt => dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(), + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); +} +function highOrderDiffs(cursor, later, units) { + const differs = [["years", (a, b) => b.year - a.year], ["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4], ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], ["weeks", (a, b) => { + const days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + const results = {}; + const earlier = cursor; + let lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (const [unit, differ] of differs) { + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; +} +function diff (earlier, later, units, opts) { + let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units); + const remainingMillis = later - cursor; + const lowerOrderUnits = units.filter(u => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + highWater = cursor.plus({ + [lowestOrder]: 1 + }); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + const duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration); + } else { + return duration; + } +} + +const numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" +}; +const numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] +}; +const hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); +function parseDigits(str) { + let value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (const key in numberingSystemsUTF16) { + const [min, max] = numberingSystemsUTF16[key]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } +} +function digitRegex({ + numberingSystem +}, append = "") { + return new RegExp(`${numberingSystems[numberingSystem || "latn"]}${append}`); +} + +const MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; +function intUnit(regex, post = i => i) { + return { + regex, + deser: ([s]) => post(parseDigits(s)) + }; +} +const NBSP = String.fromCharCode(160); +const spaceOrNBSP = `[ ${NBSP}]`; +const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); +function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); +} +function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); +} +function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: ([s]) => strings.findIndex(i => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex + }; + } +} +function offset(regex, groups) { + return { + regex, + deser: ([, h, m]) => signedOffset(h, m), + groups + }; +} +function simple(regex) { + return { + regex, + deser: ([s]) => s + }; +} +function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); +} + +/** + * @param token + * @param {Locale} loc + */ +function unitForToken(token, loc) { + const one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = t => ({ + regex: RegExp(escapeToken(t.val)), + deser: ([s]) => s, + literal: true + }), + unitate = t => { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); + case "ZZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + const unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; +} +const partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } +}; +function tokenForPart(part, formatOpts, resolvedOpts) { + const { + type, + value + } = part; + if (type === "literal") { + const isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + const style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + let actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + let val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val + }; + } + return undefined; +} +function buildRegex(units) { + const re = units.map(u => u.regex).reduce((f, r) => `${f}(${r.source})`, ""); + return [`^${re}$`, units]; +} +function match(input, regex, handlers) { + const matches = input.match(regex); + if (matches) { + const all = {}; + let matchIndex = 1; + for (const i in handlers) { + if (hasOwnProperty(handlers, i)) { + const h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } +} +function dateTimeFromMatches(matches) { + const toField = token => { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + let zone = null; + let specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + const vals = Object.keys(matches).reduce((r, k) => { + const f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; +} +let dummyDateTimeCache = null; +function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; +} +function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + const formatOpts = Formatter.macroTokenToFormatOpts(token.val); + const tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; +} +function expandMacroTokens(tokens, locale) { + return Array.prototype.concat(...tokens.map(t => maybeExpandMacroToken(t, locale))); +} + +/** + * @private + */ + +function explainFromTokens(locale, input, format) { + const tokens = expandMacroTokens(Formatter.parseFormat(format), locale), + units = tokens.map(t => unitForToken(t, locale)), + disqualifyingUnit = units.find(t => t.invalidReason); + if (disqualifyingUnit) { + return { + input, + tokens, + invalidReason: disqualifyingUnit.invalidReason + }; + } else { + const [regexString, handlers] = buildRegex(units), + regex = RegExp(regexString, "i"), + [rawMatches, matches] = match(input, regex, handlers), + [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, undefined]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input, + tokens, + regex, + rawMatches, + matches, + result, + zone, + specificOffset + }; + } +} +function parseFromTokens(locale, input, format) { + const { + result, + zone, + specificOffset, + invalidReason + } = explainFromTokens(locale, input, format); + return [result, zone, specificOffset, invalidReason]; +} +function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + const formatter = Formatter.create(locale, formatOpts); + const df = formatter.dtFormatter(getDummyDateTime()); + const parts = df.formatToParts(); + const resolvedOpts = df.resolvedOptions(); + return parts.map(p => tokenForPart(p, formatOpts, resolvedOpts)); +} + +const INVALID = "Invalid DateTime"; +const MAX_DATE = 8.64e15; +function unsupportedZone(zone) { + return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`); +} + +// we cache week data on the DT object and this intermediates the cache +/** + * @param {DateTime} dt + */ +function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; +} + +/** + * @param {DateTime} dt + */ +function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; +} + +// clone really means, "make a new object with these modifications". all "setters" really use this +// to create a new object while only changing some of the properties +function clone(inst, alts) { + const current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime({ + ...current, + ...alts, + old: current + }); +} + +// find the right offset a given local time. The o input is our guess, which determines which +// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) +function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + let utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + const o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + const o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; +} + +// convert an epoch timestamp into a calendar object with the given offset +function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + const d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; +} + +// convert a calendar object to a epoch timestamp +function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); +} + +// create a new DT instance by adding a duration, adjusting for DSTs +function adjustTime(inst, dur) { + const oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = { + ...inst.c, + year, + month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }, + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + let [ts, o] = fixOffset(localTS, oPre, inst.zone); + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts, + o + }; +} + +// helper useful in turning the results of parsing into real dates +// by handling the zone options +function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + const { + setZone, + zone + } = opts; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + const interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, { + ...opts, + zone: interpretationZone, + specificOffset + }); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", `the input "${text}" can't be parsed as ${format}`)); + } +} + +// if you want to output a technical format (e.g. RFC 2822), this helper +// helps handle the details +function toTechFormat(dt, format, allowZ = true) { + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; +} +function toISODate(o, extended) { + const longFormat = o.c.year > 9999 || o.c.year < 0; + let c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (extended) { + c += "-"; + c += padStart(o.c.month); + c += "-"; + c += padStart(o.c.day); + } else { + c += padStart(o.c.month); + c += padStart(o.c.day); + } + return c; +} +function toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) { + let c = padStart(o.c.hour); + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += ":"; + } + } else { + c += padStart(o.c.minute); + } + if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + c += padStart(o.c.second); + if (o.c.millisecond !== 0 || !suppressMilliseconds) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; +} + +// defaults for unspecified units in the supported calendars +const defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + +// Units in the supported calendars, sorted by bigness +const orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + +// standardize case and plurality in units +function normalizeUnit(unit) { + const normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; +} +function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } +} + +// this is a dumbed down version of fromObject() that runs about 60% faster +// but doesn't do any validation, makes a bunch of assumptions about what units +// are present, and so on. +function quickDT(obj, opts) { + const zone = normalizeZone(opts.zone, Settings.defaultZone), + loc = Locale.fromObject(opts), + tsNow = Settings.now(); + let ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (const u of orderedUnits) { + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + const offsetProvis = zone.offset(tsNow); + [ts, o] = objToTS(obj, offsetProvis, zone); + } else { + ts = tsNow; + } + return new DateTime({ + ts, + zone, + loc, + o + }); +} +function diffRelative(start, end, opts) { + const round = isUndefined(opts.round) ? true : opts.round, + format = (c, unit) => { + c = roundTo(c, round || opts.calendary ? 0 : 2, true); + const formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = unit => { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (const unit of opts.units) { + const count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); +} +function lastOpts(argList) { + let opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; +} + +/** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ +class DateTime { + /** + * @access private + */ + constructor(config) { + const zone = config.zone || Settings.defaultZone; + let invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + let c = null, + o = null; + if (!invalid) { + const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + [c, o] = [config.old.c, config.old.o]; + } else { + const ot = zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + static now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */ + static local() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + return quickDT({ + year, + month, + day, + hour, + minute, + second, + millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */ + static utc() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year, + month, + day, + hour, + minute, + second, + millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */ + static fromJSDate(date, options = {}) { + const ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + const zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromMillis(milliseconds, options = {}) { + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromSeconds(seconds, options = {}) { + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */ + static fromObject(obj, opts = {}) { + obj = obj || {}; + const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + const loc = Locale.fromObject(opts); + const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + const { + minDaysInFirstWeek, + startOfWeek + } = usesLocalWeekValues(normalized, loc); + const tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + let units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + let foundFirst = false; + for (const u of units) { + const v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + const gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */ + static fromISO(text, opts = {}) { + const [vals, parsedZone] = parseISODate(text); + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */ + static fromRFC2822(text, opts = {}) { + const [vals, parsedZone] = parseRFC2822Date(text); + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */ + static fromHTTP(text, opts = {}) { + const [vals, parsedZone] = parseHTTPDate(text); + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromFormat(text, fmt, opts = {}) { + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + const { + locale = null, + numberingSystem = null + } = opts, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }), + [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt); + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */ + static fromString(text, fmt, opts = {}) { + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */ + static fromSQL(text, opts = {}) { + const [vals, parsedZone] = parseSQL(text); + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */ + static parseFormatForOpts(formatOpts, localeOpts = {}) { + const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(t => t ? t.val : null).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */ + static expandFormat(fmt, localeOpts = {}) { + const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(t => t.val).join(""); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */ + get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + get outputCalendar() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + get zone() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + get zoneName() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + get year() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + get quarter() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + get month() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + get day() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + get hour() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + get minute() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + get second() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + get millisecond() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + get weekYear() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + get weekNumber() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + get weekday() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + get isWeekend() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + get localWeekday() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + get localWeekNumber() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + get localWeekYear() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + get ordinal() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + get monthShort() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + get monthLong() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + get weekdayShort() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + get weekdayLong() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + get offset() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameShort() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameLong() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + get isOffsetFixed() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + get isInDST() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + const dayMs = 86400000; + const minuteMs = 60000; + const localTS = objToLocalTS(this.c); + const oEarlier = this.zone.offset(localTS - dayMs); + const oLater = this.zone.offset(localTS + dayMs); + const o1 = this.zone.offset(localTS - oEarlier * minuteMs); + const o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + const ts1 = localTS - o1 * minuteMs; + const ts2 = localTS - o2 * minuteMs; + const c1 = tsToObj(ts1, o1); + const c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */ + get isInLeapYear() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + get daysInMonth() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + get daysInYear() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + get weeksInWeekYear() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + get weeksInLocalWeekYear() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + resolvedLocaleOptions(opts = {}) { + const { + locale, + numberingSystem, + calendar + } = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this); + return { + locale, + numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */ + toUTC(offset = 0, opts = {}) { + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */ + toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */ + setZone(zone, { + keepLocalTime = false, + keepCalendarTime = false + } = {}) { + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + let newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + const offsetGuess = zone.offset(this.ts); + const asObj = this.toObject(); + [newTS] = objToTS(asObj, offsetGuess, zone); + } + return clone(this, { + ts: newTS, + zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */ + reconfigure({ + locale, + numberingSystem, + outputCalendar + } = {}) { + const loc = this.loc.clone({ + locale, + numberingSystem, + outputCalendar + }); + return clone(this, { + loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */ + setLocale(locale) { + return this.reconfigure({ + locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */ + set(values) { + if (!this.isValid) return this; + const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + const { + minDaysInFirstWeek, + startOfWeek + } = usesLocalWeekValues(normalized, this.loc); + const settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + let mixed; + if (settingWeekStuff) { + mixed = weekToGregorian({ + ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), + ...normalized + }, minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian({ + ...gregorianToOrdinal(this.c), + ...normalized + }); + } else { + mixed = { + ...this.toObject(), + ...normalized + }; + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + const [ts, o] = objToTS(mixed, this.o, this.zone); + return clone(this, { + ts, + o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */ + plus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */ + minus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */ + startOf(unit, { + useLocaleWeeks = false + } = {}) { + if (!this.isValid) return this; + const o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + const startOfWeek = this.loc.getStartOfWeek(); + const { + weekday + } = this; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + const q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */ + endOf(unit, opts) { + return this.isValid ? this.plus({ + [unit]: 1 + }).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */ + toFormat(fmt, opts = {}) { + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */ + toLocaleParts(opts = {}) { + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @return {string} + */ + toISO({ + format = "extended", + suppressSeconds = false, + suppressMilliseconds = false, + includeOffset = true, + extendedZone = false + } = {}) { + if (!this.isValid) { + return null; + } + const ext = format === "extended"; + let c = toISODate(this, ext); + c += "T"; + c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @return {string} + */ + toISODate({ + format = "extended" + } = {}) { + if (!this.isValid) { + return null; + } + return toISODate(this, format === "extended"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */ + toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @return {string} + */ + toISOTime({ + suppressMilliseconds = false, + suppressSeconds = false, + includeOffset = true, + includePrefix = false, + extendedZone = false, + format = "extended" + } = {}) { + if (!this.isValid) { + return null; + } + let c = includePrefix ? "T" : ""; + return c + toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */ + toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */ + toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string} + */ + toSQLDate() { + if (!this.isValid) { + return null; + } + return toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */ + toSQLTime({ + includeOffset = true, + includeZone = false, + includeOffsetSpace = true + } = {}) { + let fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */ + toSQL(opts = {}) { + if (!this.isValid) { + return null; + } + return `${this.toSQLDate()} ${this.toSQLTime(opts)}`; + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */ + toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`; + } else { + return `DateTime { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */ + toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds of this DateTime. + * @return {number} + */ + toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */ + toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */ + toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */ + toObject(opts = {}) { + if (!this.isValid) return {}; + const base = { + ...this.c + }; + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */ + toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */ + diff(otherDateTime, unit = "milliseconds", opts = {}) { + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + const durOpts = { + locale: this.locale, + numberingSystem: this.numberingSystem, + ...opts + }; + const units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + diffNow(unit = "milliseconds", opts = {}) { + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval} + */ + until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */ + hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + const inputMs = otherDateTime.valueOf(); + const adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */ + equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds down by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */ + toRelative(options = {}) { + if (!this.isValid) return null; + const base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + let units = ["years", "months", "days", "hours", "minutes", "seconds"]; + let unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), { + ...options, + numeric: "always", + units, + unit + }); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */ + toRelativeCalendar(options = {}) { + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, { + ...options, + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + }); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */ + static min(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, i => i.valueOf(), Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */ + static max(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, i => i.valueOf(), Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */ + static fromFormatExplain(text, fmt, options = {}) { + const { + locale = null, + numberingSystem = null + } = options, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */ + static fromStringExplain(text, fmt, options = {}) { + return DateTime.fromFormatExplain(text, fmt, options); + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */ + static get DATE_SHORT() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED_WITH_WEEKDAY() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + static get DATE_FULL() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + static get DATE_HUGE() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_SIMPLE() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SECONDS() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SHORT_OFFSET() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_LONG_OFFSET() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + static get TIME_24_SIMPLE() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SECONDS() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SHORT_OFFSET() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_LONG_OFFSET() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT_WITH_SECONDS() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_SECONDS() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_WEEKDAY() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL_WITH_SECONDS() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE_WITH_SECONDS() { + return DATETIME_HUGE_WITH_SECONDS; + } +} + +/** + * @private + */ +function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`); + } +} + +const VERSION = "3.4.4"; + +exports.DateTime = DateTime; +exports.Duration = Duration; +exports.FixedOffsetZone = FixedOffsetZone; +exports.IANAZone = IANAZone; +exports.Info = Info; +exports.Interval = Interval; +exports.InvalidZone = InvalidZone; +exports.Settings = Settings; +exports.SystemZone = SystemZone; +exports.VERSION = VERSION; +exports.Zone = Zone; +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/node/luxon.js.map b/node_modules/luxon/build/node/luxon.js.map new file mode 100644 index 0000000..17880be --- /dev/null +++ b/node_modules/luxon/build/node/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/digits.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.4.4\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","Error","InvalidDateTimeError","constructor","reason","toMessage","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","type","name","ianaName","isUniversal","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","isValid","singleton","SystemZone","instance","Intl","DateTimeFormat","resolvedOptions","timeZone","locale","parseZoneInfo","Date","getTimezoneOffset","dtfCache","makeDTF","zone","hour12","era","typeToPos","hackyOffset","dtf","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","resetCache","isValidSpecifier","isValidZone","e","zoneName","valid","isNaN","NaN","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","key","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","base","cacheKeyOpts","RelativeTimeFormat","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","intl","PolyNumberFormatter","forceSimple","padTo","floor","otherOpts","Object","keys","intlOpts","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","undefined","z","gmtOffset","offsetZ","setZone","plus","minutes","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","count","English","numeric","fallbackWeekSettings","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","fastNumbers","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","formatStr","extract","weekdays","meridiems","eras","field","df","dtFormatter","results","matching","find","m","toLowerCase","numberFormatter","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","FixedOffsetZone","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","now","twoDigitCutoffYear","throwOnInvalid","cutoffYear","t","resetCaches","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","prototype","toString","call","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","towardZero","factor","rounder","trunc","round","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","normalizeObject","normalizer","normalized","u","hours","sign","RangeError","monthsLong","monthsShort","monthsNarrow","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","tokenToField","lildur","mapped","get","tokens","realTokens","found","concat","collapsed","shiftTo","filter","ianaRegex","combineRegexes","regexes","full","source","RegExp","combineExtractors","extractors","mergedVals","mergedZone","cursor","ex","parse","patterns","regex","extractor","simpleParse","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","clear","conf","values","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","entries","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","fromISOTime","week","toFormat","fmtOpts","toHuman","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","Symbol","for","invalidReason","valueOf","duration","minus","negate","mapUnits","fn","set","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","own","ak","negated","invalidExplanation","eq","v1","v2","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","split","startIsValid","endIsValid","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","final","sofar","xor","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","separator","mapEndpoints","mapFn","Info","hasDST","proto","isValidIANAZone","locObj","getMinimumDaysInFirstWeek","getWeekendWeekdays","monthsFormat","weekdaysFormat","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","differ","remainingMillis","lowerOrderUnits","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","parseDigits","str","code","charCodeAt","search","min","max","digitRegex","append","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","explainFromTokens","disqualifyingUnit","regexString","rawMatches","parseFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","longFormat","extendedZone","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","quickDT","tsNow","offsetProvis","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","arguments","fromJSDate","zoneToUse","fromSeconds","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","gregorian","tsFinal","offsetFinal","fromRFC2822","fromHTTP","fromFormat","localeToUse","fromString","fromSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","ceil","isWeekend","monthShort","monthLong","weekdayShort","weekdayLong","offsetNameShort","offsetNameLong","isInDST","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","isInLeapYear","weeksInLocalWeekYear","resolvedLocaleOptions","toLocal","keepCalendarTime","newTS","offsetGuess","asObj","setLocale","settingWeekStuff","normalizedUnit","endOf","toLocaleParts","ext","toISOWeekDate","toRFC2822","toHTTP","toSQLDate","toSQLTime","includeZone","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","fromStringExplain","dateTimeish","VERSION"],"mappings":";;;;AAAA;;AAEA;AACA;AACA;AACA,MAAMA,UAAU,SAASC,KAAK,CAAC,EAAA;;AAE/B;AACA;AACA;AACO,MAAMC,oBAAoB,SAASF,UAAU,CAAC;EACnDG,WAAWA,CAACC,MAAM,EAAE;IAClB,KAAK,CAAE,qBAAoBA,MAAM,CAACC,SAAS,EAAG,EAAC,CAAC,CAAA;AAClD,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACO,MAAMC,oBAAoB,SAASN,UAAU,CAAC;EACnDG,WAAWA,CAACC,MAAM,EAAE;IAClB,KAAK,CAAE,qBAAoBA,MAAM,CAACC,SAAS,EAAG,EAAC,CAAC,CAAA;AAClD,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACO,MAAME,oBAAoB,SAASP,UAAU,CAAC;EACnDG,WAAWA,CAACC,MAAM,EAAE;IAClB,KAAK,CAAE,qBAAoBA,MAAM,CAACC,SAAS,EAAG,EAAC,CAAC,CAAA;AAClD,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACO,MAAMG,6BAA6B,SAASR,UAAU,CAAC,EAAA;;AAE9D;AACA;AACA;AACO,MAAMS,gBAAgB,SAAST,UAAU,CAAC;EAC/CG,WAAWA,CAACO,IAAI,EAAE;AAChB,IAAA,KAAK,CAAE,CAAA,aAAA,EAAeA,IAAK,CAAA,CAAC,CAAC,CAAA;AAC/B,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACO,MAAMC,oBAAoB,SAASX,UAAU,CAAC,EAAA;;AAErD;AACA;AACA;AACO,MAAMY,mBAAmB,SAASZ,UAAU,CAAC;AAClDG,EAAAA,WAAWA,GAAG;IACZ,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C5C,EAAA,IAAI31B,QAAQ,CAAC0xB,UAAU,CAACiE,WAAW,CAAC,EAAE;AACpC,IAAA,OAAOA,WAAW,CAAA;AACpB,GAAC,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACzV,OAAO,IAAI1Y,QAAQ,CAACmuB,WAAW,CAACzV,OAAO,EAAE,CAAC,EAAE;AAChF,IAAA,OAAOlgB,QAAQ,CAACowB,UAAU,CAACuF,WAAW,CAAC,CAAA;GACxC,MAAM,IAAIA,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;AACzD,IAAA,OAAO31B,QAAQ,CAACkE,UAAU,CAACyxB,WAAW,CAAC,CAAA;AACzC,GAAC,MAAM;IACL,MAAM,IAAIr/B,oBAAoB,CAC3B,CAAA,2BAAA,EAA6Bq/B,WAAY,CAAY,UAAA,EAAA,OAAOA,WAAY,CAAA,CAC3E,CAAC,CAAA;AACH,GAAA;AACF;;AC12EMC,MAAAA,OAAO,GAAG;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/package.json b/node_modules/luxon/package.json new file mode 100644 index 0000000..aa3f831 --- /dev/null +++ b/node_modules/luxon/package.json @@ -0,0 +1,87 @@ +{ + "name": "luxon", + "version": "3.4.4", + "description": "Immutable date wrapper", + "author": "Isaac Cambron", + "keywords": [ + "date", + "immutable" + ], + "repository": "https://github.com/moment/luxon", + "exports": { + ".": { + "import": "./src/luxon.js", + "require": "./build/node/luxon.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "build": "babel-node tasks/buildAll.js", + "build-node": "babel-node tasks/buildNode.js", + "build-global": "babel-node tasks/buildGlobal.js", + "jest": "jest", + "test": "jest --coverage", + "api-docs": "mkdir -p build && documentation build src/luxon.js -f html -o build/api-docs && sed -i.bak 's/<\\/body>/ +``` + +``` +// "lite" version + +``` + +## Quick Start + +For the full version (800+ MIME types, 1,000+ extensions): + +```javascript +const mime = require('mime'); + +mime.getType('txt'); // ⇨ 'text/plain' +mime.getExtension('text/plain'); // ⇨ 'txt' +``` + +See [Mime API](#mime-api) below for API details. + +## Lite Version + +The "lite" version of this module omits vendor-specific (`*/vnd.*`) and +experimental (`*/x-*`) types. It weighs in at ~2.5KB, compared to 8KB for the +full version. To load the lite version: + +```javascript +const mime = require('mime/lite'); +``` + +## Mime .vs. mime-types .vs. mime-db modules + +For those of you wondering about the difference between these [popular] NPM modules, +here's a brief rundown ... + +[`mime-db`](https://github.com/jshttp/mime-db) is "the source of +truth" for MIME type information. It is not an API. Rather, it is a canonical +dataset of mime type definitions pulled from IANA, Apache, NGINX, and custom mappings +submitted by the Node.js community. + +[`mime-types`](https://github.com/jshttp/mime-types) is a thin +wrapper around mime-db that provides an API drop-in compatible(ish) with `mime @ < v1.3.6` API. + +`mime` is, as of v2, a self-contained module bundled with a pre-optimized version +of the `mime-db` dataset. It provides a simplified API with the following characteristics: + +* Intelligently resolved type conflicts (See [mime-score](https://github.com/broofa/mime-score) for details) +* Method naming consistent with industry best-practices +* Compact footprint. E.g. The minified+compressed sizes of the various modules: + +Module | Size +--- | --- +`mime-db` | 18 KB +`mime-types` | same as mime-db +`mime` | 8 KB +`mime/lite` | 2 KB + +## Mime API + +Both `require('mime')` and `require('mime/lite')` return instances of the MIME +class, documented below. + +Note: Inputs to this API are case-insensitive. Outputs (returned values) will +be lowercase. + +### new Mime(typeMap, ... more maps) + +Most users of this module will not need to create Mime instances directly. +However if you would like to create custom mappings, you may do so as follows +... + +```javascript +// Require Mime class +const Mime = require('mime/Mime'); + +// Define mime type -> extensions map +const typeMap = { + 'text/abc': ['abc', 'alpha', 'bet'], + 'text/def': ['leppard'] +}; + +// Create and use Mime instance +const myMime = new Mime(typeMap); +myMime.getType('abc'); // ⇨ 'text/abc' +myMime.getExtension('text/def'); // ⇨ 'leppard' +``` + +If more than one map argument is provided, each map is `define()`ed (see below), in order. + +### mime.getType(pathOrExtension) + +Get mime type for the given path or extension. E.g. + +```javascript +mime.getType('js'); // ⇨ 'application/javascript' +mime.getType('json'); // ⇨ 'application/json' + +mime.getType('txt'); // ⇨ 'text/plain' +mime.getType('dir/text.txt'); // ⇨ 'text/plain' +mime.getType('dir\\text.txt'); // ⇨ 'text/plain' +mime.getType('.text.txt'); // ⇨ 'text/plain' +mime.getType('.txt'); // ⇨ 'text/plain' +``` + +`null` is returned in cases where an extension is not detected or recognized + +```javascript +mime.getType('foo/txt'); // ⇨ null +mime.getType('bogus_type'); // ⇨ null +``` + +### mime.getExtension(type) +Get extension for the given mime type. Charset options (often included in +Content-Type headers) are ignored. + +```javascript +mime.getExtension('text/plain'); // ⇨ 'txt' +mime.getExtension('application/json'); // ⇨ 'json' +mime.getExtension('text/html; charset=utf8'); // ⇨ 'html' +``` + +### mime.define(typeMap[, force = false]) + +Define [more] type mappings. + +`typeMap` is a map of type -> extensions, as documented in `new Mime`, above. + +By default this method will throw an error if you try to map a type to an +extension that is already assigned to another type. Passing `true` for the +`force` argument will suppress this behavior (overriding any previous mapping). + +```javascript +mime.define({'text/x-abc': ['abc', 'abcd']}); + +mime.getType('abcd'); // ⇨ 'text/x-abc' +mime.getExtension('text/x-abc') // ⇨ 'abc' +``` + +## Command Line + + mime [path_or_extension] + +E.g. + + > mime scripts/jquery.js + application/javascript + +---- +Markdown generated from [src/README_js.md](src/README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/node_modules/mime/cli.js b/node_modules/mime/cli.js new file mode 100755 index 0000000..ab70a49 --- /dev/null +++ b/node_modules/mime/cli.js @@ -0,0 +1,46 @@ +#!/usr/bin/env node + +'use strict'; + +process.title = 'mime'; +let mime = require('.'); +let pkg = require('./package.json'); +let args = process.argv.splice(2); + +if (args.includes('--version') || args.includes('-v') || args.includes('--v')) { + console.log(pkg.version); + process.exit(0); +} else if (args.includes('--name') || args.includes('-n') || args.includes('--n')) { + console.log(pkg.name); + process.exit(0); +} else if (args.includes('--help') || args.includes('-h') || args.includes('--h')) { + console.log(pkg.name + ' - ' + pkg.description + '\n'); + console.log(`Usage: + + mime [flags] [path_or_extension] + + Flags: + --help, -h Show this message + --version, -v Display the version + --name, -n Print the name of the program + + Note: the command will exit after it executes if a command is specified + The path_or_extension is the path to the file or the extension of the file. + + Examples: + mime --help + mime --version + mime --name + mime -v + mime src/log.js + mime new.py + mime foo.sh + `); + process.exit(0); +} + +let file = args[0]; +let type = mime.getType(file); + +process.stdout.write(type + '\n'); + diff --git a/node_modules/mime/index.js b/node_modules/mime/index.js new file mode 100644 index 0000000..fadcf8d --- /dev/null +++ b/node_modules/mime/index.js @@ -0,0 +1,4 @@ +'use strict'; + +let Mime = require('./Mime'); +module.exports = new Mime(require('./types/standard'), require('./types/other')); diff --git a/node_modules/mime/lite.js b/node_modules/mime/lite.js new file mode 100644 index 0000000..835cffb --- /dev/null +++ b/node_modules/mime/lite.js @@ -0,0 +1,4 @@ +'use strict'; + +let Mime = require('./Mime'); +module.exports = new Mime(require('./types/standard')); diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json new file mode 100644 index 0000000..84f5132 --- /dev/null +++ b/node_modules/mime/package.json @@ -0,0 +1,52 @@ +{ + "author": { + "name": "Robert Kieffer", + "url": "http://github.com/broofa", + "email": "robert@broofa.com" + }, + "engines": { + "node": ">=10.0.0" + }, + "bin": { + "mime": "cli.js" + }, + "contributors": [], + "description": "A comprehensive library for mime-type mapping", + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "benchmark": "*", + "chalk": "4.1.2", + "eslint": "8.1.0", + "mime-db": "1.50.0", + "mime-score": "1.2.0", + "mime-types": "2.1.33", + "mocha": "9.1.3", + "runmd": "*", + "standard-version": "9.3.2" + }, + "files": [ + "index.js", + "lite.js", + "Mime.js", + "cli.js", + "/types" + ], + "scripts": { + "prepare": "node src/build.js && runmd --output README.md src/README_js.md", + "release": "standard-version", + "benchmark": "node src/benchmark.js", + "md": "runmd --watch --output README.md src/README_js.md", + "test": "mocha src/test.js" + }, + "keywords": [ + "util", + "mime" + ], + "name": "mime", + "repository": { + "url": "https://github.com/broofa/mime", + "type": "git" + }, + "version": "3.0.0" +} diff --git a/node_modules/mime/types/other.js b/node_modules/mime/types/other.js new file mode 100644 index 0000000..bb6a035 --- /dev/null +++ b/node_modules/mime/types/other.js @@ -0,0 +1 @@ +module.exports = {"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}; \ No newline at end of file diff --git a/node_modules/mime/types/standard.js b/node_modules/mime/types/standard.js new file mode 100644 index 0000000..5ee9937 --- /dev/null +++ b/node_modules/mime/types/standard.js @@ -0,0 +1 @@ +module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}; \ No newline at end of file diff --git a/node_modules/minimatch/LICENSE b/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minimatch/README.md b/node_modules/minimatch/README.md new file mode 100644 index 0000000..33ede1d --- /dev/null +++ b/node_modules/minimatch/README.md @@ -0,0 +1,230 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### allowWindowsEscape + +Windows path separator `\` is by default converted to `/`, which +prohibits the usage of `\` as a escape character. This flag skips that +behavior and allows using the escape character. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..fda45ad --- /dev/null +++ b/node_modules/minimatch/minimatch.js @@ -0,0 +1,947 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = (function () { try { return require('path') } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = 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. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + assertValidPattern(pattern) + + if (!options) options = {} + + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var 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 + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + + this.debug(this.pattern, set) + + // 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 + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// 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 +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + 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) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// 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. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function 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. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') 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 + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // 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. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var 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 +} + +// 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. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: 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. + /* istanbul ignore if */ + if (p === false) return false + + 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. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + 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 /* istanbul ignore 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] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/minimatch/node_modules/brace-expansion/LICENSE b/node_modules/minimatch/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000..de32266 --- /dev/null +++ b/node_modules/minimatch/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +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. diff --git a/node_modules/minimatch/node_modules/brace-expansion/README.md b/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..6b4e0e1 --- /dev/null +++ b/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/node_modules/minimatch/node_modules/brace-expansion/index.js b/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..0478be8 --- /dev/null +++ b/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// 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 ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var 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 expandTop(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.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +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) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var 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]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/minimatch/node_modules/brace-expansion/package.json b/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..a18faa8 --- /dev/null +++ b/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,47 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.11", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json new file mode 100644 index 0000000..566efdf --- /dev/null +++ b/node_modules/minimatch/package.json @@ -0,0 +1,33 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "devDependencies": { + "tap": "^15.1.6" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ] +} diff --git a/node_modules/minimist/.eslintrc b/node_modules/minimist/.eslintrc new file mode 100644 index 0000000..bd1a5e0 --- /dev/null +++ b/node_modules/minimist/.eslintrc @@ -0,0 +1,29 @@ +{ + "root": true, + + "extends": "@ljharb/eslint-config/node/0.4", + + "rules": { + "array-element-newline": 0, + "complexity": 0, + "func-style": [2, "declaration"], + "max-lines-per-function": 0, + "max-nested-callbacks": 1, + "max-statements-per-line": 1, + "max-statements": 0, + "multiline-comment-style": 0, + "no-continue": 1, + "no-param-reassign": 1, + "no-restricted-syntax": 1, + "object-curly-newline": 0, + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "camelcase": 0, + }, + }, + ] +} diff --git a/node_modules/minimist/.github/FUNDING.yml b/node_modules/minimist/.github/FUNDING.yml new file mode 100644 index 0000000..a936622 --- /dev/null +++ b/node_modules/minimist/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/minimist +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/minimist/.nycrc b/node_modules/minimist/.nycrc new file mode 100644 index 0000000..55c3d29 --- /dev/null +++ b/node_modules/minimist/.nycrc @@ -0,0 +1,14 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "example", + "test" + ] +} diff --git a/node_modules/minimist/CHANGELOG.md b/node_modules/minimist/CHANGELOG.md new file mode 100644 index 0000000..c9a1e15 --- /dev/null +++ b/node_modules/minimist/CHANGELOG.md @@ -0,0 +1,298 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.2.8](https://github.com/minimistjs/minimist/compare/v1.2.7...v1.2.8) - 2023-02-09 + +### Merged + +- [Fix] Fix long option followed by single dash [`#17`](https://github.com/minimistjs/minimist/pull/17) +- [Tests] Remove duplicate test [`#12`](https://github.com/minimistjs/minimist/pull/12) +- [Fix] opt.string works with multiple aliases [`#10`](https://github.com/minimistjs/minimist/pull/10) + +### Fixed + +- [Fix] Fix long option followed by single dash (#17) [`#15`](https://github.com/minimistjs/minimist/issues/15) +- [Tests] Remove duplicate test (#12) [`#8`](https://github.com/minimistjs/minimist/issues/8) +- [Fix] Fix long option followed by single dash [`#15`](https://github.com/minimistjs/minimist/issues/15) +- [Fix] opt.string works with multiple aliases (#10) [`#9`](https://github.com/minimistjs/minimist/issues/9) +- [Fix] Fix handling of short option with non-trivial equals [`#5`](https://github.com/minimistjs/minimist/issues/5) +- [Tests] Remove duplicate test [`#8`](https://github.com/minimistjs/minimist/issues/8) +- [Fix] opt.string works with multiple aliases [`#9`](https://github.com/minimistjs/minimist/issues/9) + +### Commits + +- Merge tag 'v0.2.3' [`a026794`](https://github.com/minimistjs/minimist/commit/a0267947c7870fc5847cf2d437fbe33f392767da) +- [eslint] fix indentation and whitespace [`5368ca4`](https://github.com/minimistjs/minimist/commit/5368ca4147e974138a54cc0dc4cea8f756546b70) +- [eslint] fix indentation and whitespace [`e5f5067`](https://github.com/minimistjs/minimist/commit/e5f5067259ceeaf0b098d14bec910f87e58708c7) +- [eslint] more cleanup [`62fde7d`](https://github.com/minimistjs/minimist/commit/62fde7d935f83417fb046741531a9e2346a36976) +- [eslint] more cleanup [`36ac5d0`](https://github.com/minimistjs/minimist/commit/36ac5d0d95e4947d074e5737d94814034ca335d1) +- [meta] add `auto-changelog` [`73923d2`](https://github.com/minimistjs/minimist/commit/73923d223553fca08b1ba77e3fbc2a492862ae4c) +- [actions] add reusable workflows [`d80727d`](https://github.com/minimistjs/minimist/commit/d80727df77bfa9e631044d7f16368d8f09242c91) +- [eslint] add eslint; rules to enable later are warnings [`48bc06a`](https://github.com/minimistjs/minimist/commit/48bc06a1b41f00e9cdf183db34f7a51ba70e98d4) +- [eslint] fix indentation [`34b0f1c`](https://github.com/minimistjs/minimist/commit/34b0f1ccaa45183c3c4f06a91f9b405180a6f982) +- [readme] rename and add badges [`5df0fe4`](https://github.com/minimistjs/minimist/commit/5df0fe49211bd09a3636f8686a7cb3012c3e98f0) +- [Dev Deps] switch from `covert` to `nyc` [`a48b128`](https://github.com/minimistjs/minimist/commit/a48b128fdb8d427dfb20a15273f83e38d97bef07) +- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`f0fb958`](https://github.com/minimistjs/minimist/commit/f0fb958e9a1fe980cdffc436a211b0bda58f621b) +- [meta] create FUNDING.yml; add `funding` in package.json [`3639e0c`](https://github.com/minimistjs/minimist/commit/3639e0c819359a366387e425ab6eabf4c78d3caa) +- [meta] use `npmignore` to autogenerate an npmignore file [`be2e038`](https://github.com/minimistjs/minimist/commit/be2e038c342d8333b32f0fde67a0026b79c8150e) +- Only apps should have lockfiles [`282b570`](https://github.com/minimistjs/minimist/commit/282b570e7489d01b03f2d6d3dabf79cd3e5f84cf) +- isConstructorOrProto adapted from PR [`ef9153f`](https://github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11) +- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`098873c`](https://github.com/minimistjs/minimist/commit/098873c213cdb7c92e55ae1ef5aa1af3a8192a79) +- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`3124ed3`](https://github.com/minimistjs/minimist/commit/3124ed3e46306301ebb3c834874ce0241555c2c4) +- [meta] add `safe-publish-latest` [`4b927de`](https://github.com/minimistjs/minimist/commit/4b927de696d561c636b4f43bf49d4597cb36d6d6) +- [Tests] add `aud` in `posttest` [`b32d9bd`](https://github.com/minimistjs/minimist/commit/b32d9bd0ab340f4e9f8c3a97ff2a4424f25fab8c) +- [meta] update repo URLs [`f9fdfc0`](https://github.com/minimistjs/minimist/commit/f9fdfc032c54884d9a9996a390c63cd0719bbe1a) +- [actions] Avoid 0.6 tests due to build failures [`ba92fe6`](https://github.com/minimistjs/minimist/commit/ba92fe6ebbdc0431cca9a2ea8f27beb492f5e4ec) +- [Dev Deps] update `tape` [`950eaa7`](https://github.com/minimistjs/minimist/commit/950eaa74f112e04d23e9c606c67472c46739b473) +- [Dev Deps] add missing `npmignore` dev dep [`3226afa`](https://github.com/minimistjs/minimist/commit/3226afaf09e9d127ca369742437fe6e88f752d6b) +- Merge tag 'v0.2.2' [`980d7ac`](https://github.com/minimistjs/minimist/commit/980d7ac61a0b4bd552711251ac107d506b23e41f) + +## [v1.2.7](https://github.com/minimistjs/minimist/compare/v1.2.6...v1.2.7) - 2022-10-10 + +### Commits + +- [meta] add `auto-changelog` [`0ebf4eb`](https://github.com/minimistjs/minimist/commit/0ebf4ebcd5f7787a5524d31a849ef41316b83c3c) +- [actions] add reusable workflows [`e115b63`](https://github.com/minimistjs/minimist/commit/e115b63fa9d3909f33b00a2db647ff79068388de) +- [eslint] add eslint; rules to enable later are warnings [`f58745b`](https://github.com/minimistjs/minimist/commit/f58745b9bb84348e1be72af7dbba5840c7c13013) +- [Dev Deps] switch from `covert` to `nyc` [`ab03356`](https://github.com/minimistjs/minimist/commit/ab033567b9c8b31117cb026dc7f1e592ce455c65) +- [readme] rename and add badges [`236f4a0`](https://github.com/minimistjs/minimist/commit/236f4a07e4ebe5ee44f1496ec6974991ab293ffd) +- [meta] create FUNDING.yml; add `funding` in package.json [`783a49b`](https://github.com/minimistjs/minimist/commit/783a49bfd47e8335d3098a8cac75662cf71eb32a) +- [meta] use `npmignore` to autogenerate an npmignore file [`f81ece6`](https://github.com/minimistjs/minimist/commit/f81ece6aaec2fa14e69ff4f1e0407a8c4e2635a2) +- Only apps should have lockfiles [`56cad44`](https://github.com/minimistjs/minimist/commit/56cad44c7f879b9bb5ec18fcc349308024a89bfc) +- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`49c5f9f`](https://github.com/minimistjs/minimist/commit/49c5f9fb7e6a92db9eb340cc679de92fb3aacded) +- [Tests] add `aud` in `posttest` [`228ae93`](https://github.com/minimistjs/minimist/commit/228ae938f3cd9db9dfd8bd7458b076a7b2aef280) +- [meta] add `safe-publish-latest` [`01fc23f`](https://github.com/minimistjs/minimist/commit/01fc23f5104f85c75059972e01dd33796ab529ff) +- [meta] update repo URLs [`6b164c7`](https://github.com/minimistjs/minimist/commit/6b164c7d68e0b6bf32f894699effdfb7c63041dd) + +## [v1.2.6](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.6) - 2022-03-21 + +### Commits + +- test from prototype pollution PR [`bc8ecee`](https://github.com/minimistjs/minimist/commit/bc8ecee43875261f4f17eb20b1243d3ed15e70eb) +- isConstructorOrProto adapted from PR [`c2b9819`](https://github.com/minimistjs/minimist/commit/c2b981977fa834b223b408cfb860f933c9811e4d) +- security notice for additional prototype pollution issue [`ef88b93`](https://github.com/minimistjs/minimist/commit/ef88b9325f77b5ee643ccfc97e2ebda577e4c4e2) + +## [v1.2.5](https://github.com/minimistjs/minimist/compare/v1.2.4...v1.2.5) - 2020-03-12 + +## [v1.2.4](https://github.com/minimistjs/minimist/compare/v1.2.3...v1.2.4) - 2020-03-11 + +### Commits + +- security notice [`4cf1354`](https://github.com/minimistjs/minimist/commit/4cf1354839cb972e38496d35e12f806eea92c11f) +- additional test for constructor prototype pollution [`1043d21`](https://github.com/minimistjs/minimist/commit/1043d212c3caaf871966e710f52cfdf02f9eea4b) + +## [v1.2.3](https://github.com/minimistjs/minimist/compare/v1.2.2...v1.2.3) - 2020-03-10 + +### Commits + +- more failing proto pollution tests [`13c01a5`](https://github.com/minimistjs/minimist/commit/13c01a5327736903704984b7f65616b8476850cc) +- even more aggressive checks for protocol pollution [`38a4d1c`](https://github.com/minimistjs/minimist/commit/38a4d1caead72ef99e824bb420a2528eec03d9ab) + +## [v1.2.2](https://github.com/minimistjs/minimist/compare/v1.2.1...v1.2.2) - 2020-03-10 + +### Commits + +- failing test for protocol pollution [`0efed03`](https://github.com/minimistjs/minimist/commit/0efed0340ec8433638758f7ca0c77cb20a0bfbab) +- cleanup [`67d3722`](https://github.com/minimistjs/minimist/commit/67d3722413448d00a62963d2d30c34656a92d7e2) +- console.dir -> console.log [`47acf72`](https://github.com/minimistjs/minimist/commit/47acf72c715a630bf9ea013867f47f1dd69dfc54) +- don't assign onto __proto__ [`63e7ed0`](https://github.com/minimistjs/minimist/commit/63e7ed05aa4b1889ec2f3b196426db4500cbda94) + +## [v1.2.1](https://github.com/minimistjs/minimist/compare/v1.2.0...v1.2.1) - 2020-03-10 + +### Merged + +- move the `opts['--']` example back where it belongs [`#63`](https://github.com/minimistjs/minimist/pull/63) + +### Commits + +- add test [`6be5dae`](https://github.com/minimistjs/minimist/commit/6be5dae35a32a987bcf4137fcd6c19c5200ee909) +- fix bad boolean regexp [`ac3fc79`](https://github.com/minimistjs/minimist/commit/ac3fc796e63b95128fdbdf67ea7fad71bd59aa76) + +## [v1.2.0](https://github.com/minimistjs/minimist/compare/v1.1.3...v1.2.0) - 2015-08-24 + +### Commits + +- failing -k=v short test [`63416b8`](https://github.com/minimistjs/minimist/commit/63416b8cd1d0d70e4714564cce465a36e4dd26d7) +- kv short fix [`6bbe145`](https://github.com/minimistjs/minimist/commit/6bbe14529166245e86424f220a2321442fe88dc3) +- failing kv short test [`f72ab7f`](https://github.com/minimistjs/minimist/commit/f72ab7f4572adc52902c9b6873cc969192f01b10) +- fixed kv test [`f5a48c3`](https://github.com/minimistjs/minimist/commit/f5a48c3e50e40ca54f00c8e84de4b4d6e9897fa8) +- enforce space between arg key and value [`86b321a`](https://github.com/minimistjs/minimist/commit/86b321affe648a8e016c095a4f0efa9d9074f502) + +## [v1.1.3](https://github.com/minimistjs/minimist/compare/v1.1.2...v1.1.3) - 2015-08-06 + +### Commits + +- add failing test - boolean alias array [`0fa3c5b`](https://github.com/minimistjs/minimist/commit/0fa3c5b3dd98551ddecf5392831b4c21211743fc) +- fix boolean values with multiple aliases [`9c0a6e7`](https://github.com/minimistjs/minimist/commit/9c0a6e7de25a273b11bbf9a7464f0bd833779795) + +## [v1.1.2](https://github.com/minimistjs/minimist/compare/v1.1.1...v1.1.2) - 2015-07-22 + +### Commits + +- Convert boolean arguments to boolean values [`8f3dc27`](https://github.com/minimistjs/minimist/commit/8f3dc27cf833f1d54671b6d0bcb55c2fe19672a9) +- use non-ancient npm, node 0.12 and iojs [`61ed1d0`](https://github.com/minimistjs/minimist/commit/61ed1d034b9ec7282764ce76f3992b1a0b4906ae) +- an older npm for 0.8 [`25cf778`](https://github.com/minimistjs/minimist/commit/25cf778b1220e7838a526832ad6972f75244054f) + +## [v1.1.1](https://github.com/minimistjs/minimist/compare/v1.1.0...v1.1.1) - 2015-03-10 + +### Commits + +- check that they type of a value is a boolean, not just that it is currently set to a boolean [`6863198`](https://github.com/minimistjs/minimist/commit/6863198e36139830ff1f20ffdceaddd93f2c1db9) +- upgrade tape, fix type issues from old tape version [`806712d`](https://github.com/minimistjs/minimist/commit/806712df91604ed02b8e39aa372b84aea659ee34) +- test for setting a boolean to a null default [`8c444fe`](https://github.com/minimistjs/minimist/commit/8c444fe89384ded7d441c120915ea60620b01dd3) +- if the previous value was a boolean, without an default (or with an alias) don't make an array either [`e5f419a`](https://github.com/minimistjs/minimist/commit/e5f419a3b5b3bc3f9e5ac71b7040621af70ed2dd) + +## [v1.1.0](https://github.com/minimistjs/minimist/compare/v1.0.0...v1.1.0) - 2014-08-10 + +### Commits + +- add support for handling "unknown" options not registered with the parser. [`6f3cc5d`](https://github.com/minimistjs/minimist/commit/6f3cc5d4e84524932a6ef2ce3592acc67cdd4383) +- reformat package.json [`02ed371`](https://github.com/minimistjs/minimist/commit/02ed37115194d3697ff358e8e25e5e66bab1d9f8) +- coverage script [`e5531ba`](https://github.com/minimistjs/minimist/commit/e5531ba0479da3b8138d3d8cac545d84ccb1c8df) +- extra fn to get 100% coverage again [`a6972da`](https://github.com/minimistjs/minimist/commit/a6972da89e56bf77642f8ec05a13b6558db93498) + +## [v1.0.0](https://github.com/minimistjs/minimist/compare/v0.2.3...v1.0.0) - 2014-08-10 + +### Commits + +- added stopEarly option [`471c7e4`](https://github.com/minimistjs/minimist/commit/471c7e4a7e910fc7ad8f9df850a186daf32c64e9) +- fix list [`fef6ae7`](https://github.com/minimistjs/minimist/commit/fef6ae79c38b9dc1c49569abb7cd04eb965eac5e) + +## [v0.2.3](https://github.com/minimistjs/minimist/compare/v0.2.2...v0.2.3) - 2023-02-09 + +### Merged + +- [Fix] Fix long option followed by single dash [`#17`](https://github.com/minimistjs/minimist/pull/17) +- [Tests] Remove duplicate test [`#12`](https://github.com/minimistjs/minimist/pull/12) +- [Fix] opt.string works with multiple aliases [`#10`](https://github.com/minimistjs/minimist/pull/10) + +### Fixed + +- [Fix] Fix long option followed by single dash (#17) [`#15`](https://github.com/minimistjs/minimist/issues/15) +- [Tests] Remove duplicate test (#12) [`#8`](https://github.com/minimistjs/minimist/issues/8) +- [Fix] opt.string works with multiple aliases (#10) [`#9`](https://github.com/minimistjs/minimist/issues/9) + +### Commits + +- [eslint] fix indentation and whitespace [`e5f5067`](https://github.com/minimistjs/minimist/commit/e5f5067259ceeaf0b098d14bec910f87e58708c7) +- [eslint] more cleanup [`36ac5d0`](https://github.com/minimistjs/minimist/commit/36ac5d0d95e4947d074e5737d94814034ca335d1) +- [eslint] fix indentation [`34b0f1c`](https://github.com/minimistjs/minimist/commit/34b0f1ccaa45183c3c4f06a91f9b405180a6f982) +- isConstructorOrProto adapted from PR [`ef9153f`](https://github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11) +- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`098873c`](https://github.com/minimistjs/minimist/commit/098873c213cdb7c92e55ae1ef5aa1af3a8192a79) +- [Dev Deps] add missing `npmignore` dev dep [`3226afa`](https://github.com/minimistjs/minimist/commit/3226afaf09e9d127ca369742437fe6e88f752d6b) + +## [v0.2.2](https://github.com/minimistjs/minimist/compare/v0.2.1...v0.2.2) - 2022-10-10 + +### Commits + +- [meta] add `auto-changelog` [`73923d2`](https://github.com/minimistjs/minimist/commit/73923d223553fca08b1ba77e3fbc2a492862ae4c) +- [actions] add reusable workflows [`d80727d`](https://github.com/minimistjs/minimist/commit/d80727df77bfa9e631044d7f16368d8f09242c91) +- [eslint] add eslint; rules to enable later are warnings [`48bc06a`](https://github.com/minimistjs/minimist/commit/48bc06a1b41f00e9cdf183db34f7a51ba70e98d4) +- [readme] rename and add badges [`5df0fe4`](https://github.com/minimistjs/minimist/commit/5df0fe49211bd09a3636f8686a7cb3012c3e98f0) +- [Dev Deps] switch from `covert` to `nyc` [`a48b128`](https://github.com/minimistjs/minimist/commit/a48b128fdb8d427dfb20a15273f83e38d97bef07) +- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`f0fb958`](https://github.com/minimistjs/minimist/commit/f0fb958e9a1fe980cdffc436a211b0bda58f621b) +- [meta] create FUNDING.yml; add `funding` in package.json [`3639e0c`](https://github.com/minimistjs/minimist/commit/3639e0c819359a366387e425ab6eabf4c78d3caa) +- [meta] use `npmignore` to autogenerate an npmignore file [`be2e038`](https://github.com/minimistjs/minimist/commit/be2e038c342d8333b32f0fde67a0026b79c8150e) +- Only apps should have lockfiles [`282b570`](https://github.com/minimistjs/minimist/commit/282b570e7489d01b03f2d6d3dabf79cd3e5f84cf) +- [meta] add `safe-publish-latest` [`4b927de`](https://github.com/minimistjs/minimist/commit/4b927de696d561c636b4f43bf49d4597cb36d6d6) +- [Tests] add `aud` in `posttest` [`b32d9bd`](https://github.com/minimistjs/minimist/commit/b32d9bd0ab340f4e9f8c3a97ff2a4424f25fab8c) +- [meta] update repo URLs [`f9fdfc0`](https://github.com/minimistjs/minimist/commit/f9fdfc032c54884d9a9996a390c63cd0719bbe1a) + +## [v0.2.1](https://github.com/minimistjs/minimist/compare/v0.2.0...v0.2.1) - 2020-03-12 + +## [v0.2.0](https://github.com/minimistjs/minimist/compare/v0.1.0...v0.2.0) - 2014-06-19 + +### Commits + +- support all-boolean mode [`450a97f`](https://github.com/minimistjs/minimist/commit/450a97f6e2bc85c7a4a13185c19a818d9a5ebe69) + +## [v0.1.0](https://github.com/minimistjs/minimist/compare/v0.0.10...v0.1.0) - 2014-05-12 + +### Commits + +- Provide a mechanism to segregate -- arguments [`ce4a1e6`](https://github.com/minimistjs/minimist/commit/ce4a1e63a7e8d5ab88d2a3768adefa6af98a445a) +- documented argv['--'] [`14db0e6`](https://github.com/minimistjs/minimist/commit/14db0e6dbc6d2b9e472adaa54dad7004b364634f) +- Adding a test-case for notFlags segregation [`715c1e3`](https://github.com/minimistjs/minimist/commit/715c1e3714be223f998f6c537af6b505f0236c16) + +## [v0.0.10](https://github.com/minimistjs/minimist/compare/v0.0.9...v0.0.10) - 2014-05-11 + +### Commits + +- dedicated boolean test [`46e448f`](https://github.com/minimistjs/minimist/commit/46e448f9f513cfeb2bcc8b688b9b47ba1e515c2b) +- dedicated num test [`9bf2d36`](https://github.com/minimistjs/minimist/commit/9bf2d36f1d3b8795be90b8f7de0a937f098aa394) +- aliased values treated as strings [`1ab743b`](https://github.com/minimistjs/minimist/commit/1ab743bad4484d69f1259bed42f9531de01119de) +- cover the case of already numbers, at 100% coverage [`b2bb044`](https://github.com/minimistjs/minimist/commit/b2bb04436599d77a2ce029e8e555e25b3aa55d13) +- another test for higher coverage [`3662624`](https://github.com/minimistjs/minimist/commit/3662624be976d5489d486a856849c048d13be903) + +## [v0.0.9](https://github.com/minimistjs/minimist/compare/v0.0.8...v0.0.9) - 2014-05-08 + +### Commits + +- Eliminate `longest` fn. [`824f642`](https://github.com/minimistjs/minimist/commit/824f642038d1b02ede68b6261d1d65163390929a) + +## [v0.0.8](https://github.com/minimistjs/minimist/compare/v0.0.7...v0.0.8) - 2014-02-20 + +### Commits + +- return '' if flag is string and empty [`fa63ed4`](https://github.com/minimistjs/minimist/commit/fa63ed4651a4ef4eefddce34188e0d98d745a263) +- handle joined single letters [`66c248f`](https://github.com/minimistjs/minimist/commit/66c248f0241d4d421d193b022e9e365f11178534) + +## [v0.0.7](https://github.com/minimistjs/minimist/compare/v0.0.6...v0.0.7) - 2014-02-08 + +### Commits + +- another swap of .test for .match [`d1da408`](https://github.com/minimistjs/minimist/commit/d1da40819acbe846d89a5c02721211e3c1260dde) + +## [v0.0.6](https://github.com/minimistjs/minimist/compare/v0.0.5...v0.0.6) - 2014-02-08 + +### Commits + +- use .test() instead of .match() to not crash on non-string values in the arguments array [`7e0d1ad`](https://github.com/minimistjs/minimist/commit/7e0d1add8c9e5b9b20a4d3d0f9a94d824c578da1) + +## [v0.0.5](https://github.com/minimistjs/minimist/compare/v0.0.4...v0.0.5) - 2013-09-18 + +### Commits + +- Improve '--' handling. [`b11822c`](https://github.com/minimistjs/minimist/commit/b11822c09cc9d2460f30384d12afc0b953c037a4) + +## [v0.0.4](https://github.com/minimistjs/minimist/compare/v0.0.3...v0.0.4) - 2013-09-17 + +## [v0.0.3](https://github.com/minimistjs/minimist/compare/v0.0.2...v0.0.3) - 2013-09-12 + +### Commits + +- failing test for single dash preceeding a double dash [`b465514`](https://github.com/minimistjs/minimist/commit/b465514b82c9ae28972d714facd951deb2ad762b) +- fix for the dot test [`6a095f1`](https://github.com/minimistjs/minimist/commit/6a095f1d364c8fab2d6753d2291a0649315d297a) + +## [v0.0.2](https://github.com/minimistjs/minimist/compare/v0.0.1...v0.0.2) - 2013-08-28 + +### Commits + +- allow dotted aliases & defaults [`321c33e`](https://github.com/minimistjs/minimist/commit/321c33e755485faaeb44eeb1c05d33b2e0a5a7c4) +- use a better version of ff [`e40f611`](https://github.com/minimistjs/minimist/commit/e40f61114cf7be6f7947f7b3eed345853a67dbbb) + +## [v0.0.1](https://github.com/minimistjs/minimist/compare/v0.0.0...v0.0.1) - 2013-06-25 + +### Commits + +- remove trailing commas [`6ff0fa0`](https://github.com/minimistjs/minimist/commit/6ff0fa055064f15dbe06d50b89d5173a6796e1db) + +## v0.0.0 - 2013-06-25 + +### Commits + +- half of the parse test ported [`3079326`](https://github.com/minimistjs/minimist/commit/307932601325087de6cf94188eb798ffc4f3088a) +- stripped down code and a passing test from optimist [`7cced88`](https://github.com/minimistjs/minimist/commit/7cced88d82e399d1a03ed23eb667f04d3f320d10) +- ported parse tests completely over [`9448754`](https://github.com/minimistjs/minimist/commit/944875452e0820df6830b1408c26a0f7d3e1db04) +- docs, package.json [`a5bf46a`](https://github.com/minimistjs/minimist/commit/a5bf46ac9bb3bd114a9c340276c62c1091e538d5) +- move more short tests into short.js [`503edb5`](https://github.com/minimistjs/minimist/commit/503edb5c41d89c0d40831ee517154fc13b0f18b9) +- default bool test was wrong, not the code [`1b9f5db`](https://github.com/minimistjs/minimist/commit/1b9f5db4741b49962846081b68518de824992097) +- passing long tests ripped out of parse.js [`7972c4a`](https://github.com/minimistjs/minimist/commit/7972c4aff1f4803079e1668006658e2a761a0428) +- badges [`84c0370`](https://github.com/minimistjs/minimist/commit/84c037063664d42878aace715fe6572ce01b6f3b) +- all the tests now ported, some failures [`64239ed`](https://github.com/minimistjs/minimist/commit/64239edfe92c711c4eb0da254fcdfad2a5fdb605) +- failing short test [`f8a5341`](https://github.com/minimistjs/minimist/commit/f8a534112dd1138d2fad722def56a848480c446f) +- fixed the numeric test [`6b034f3`](https://github.com/minimistjs/minimist/commit/6b034f37c79342c60083ed97fd222e16928aac51) diff --git a/node_modules/minimist/LICENSE b/node_modules/minimist/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/node_modules/minimist/README.md b/node_modules/minimist/README.md new file mode 100644 index 0000000..74da323 --- /dev/null +++ b/node_modules/minimist/README.md @@ -0,0 +1,121 @@ +# minimist [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.log(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ + _: ['foo', 'bar', 'baz'], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' +} +``` + +# security + +Previous versions had a prototype pollution bug that could cause privilege +escalation in some circumstances when handling untrusted user input. + +Please use version 1.2.6 or later: + +* https://security.snyk.io/vuln/SNYK-JS-MINIMIST-2429795 (version <=1.2.5) +* https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 (version <=1.2.3) + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a boolean, string or array of strings to always treat as +booleans. if `true` will treat all double hyphenated arguments without equal signs +as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values +* `opts.stopEarly` - when true, populate `argv._` with everything after the +first non-option +* `opts['--']` - when true, populate `argv._` with everything before the `--` +and `argv['--']` with everything after the `--`. Here's an example: + + ``` + > require('./')('one two three -- four five --six'.split(' '), { '--': true }) + { + _: ['one', 'two', 'three'], + '--': ['four', 'five', '--six'] + } + ``` + + Note that with `opts['--']` set, parsing for arguments still stops after the + `--`. + +* `opts.unknown` - a function which is invoked with a command line parameter not +defined in the `opts` configuration object. If the function returns `false`, the +unknown option is not added to `argv`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT + +[package-url]: https://npmjs.org/package/minimist +[npm-version-svg]: https://versionbadg.es/minimistjs/minimist.svg +[npm-badge-png]: https://nodei.co/npm/minimist.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/minimist.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/minimist.svg +[downloads-url]: https://npm-stat.com/charts.html?package=minimist +[codecov-image]: https://codecov.io/gh/minimistjs/minimist/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/minimistjs/minimist/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/minimistjs/minimist +[actions-url]: https://github.com/minimistjs/minimist/actions diff --git a/node_modules/minimist/example/parse.js b/node_modules/minimist/example/parse.js new file mode 100644 index 0000000..9d90ffb --- /dev/null +++ b/node_modules/minimist/example/parse.js @@ -0,0 +1,4 @@ +'use strict'; + +var argv = require('../')(process.argv.slice(2)); +console.log(argv); diff --git a/node_modules/minimist/index.js b/node_modules/minimist/index.js new file mode 100644 index 0000000..f020f39 --- /dev/null +++ b/node_modules/minimist/index.js @@ -0,0 +1,263 @@ +'use strict'; + +function hasKey(obj, keys) { + var o = obj; + keys.slice(0, -1).forEach(function (key) { + o = o[key] || {}; + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function isNumber(x) { + if (typeof x === 'number') { return true; } + if ((/^0x[0-9a-f]+$/i).test(x)) { return true; } + return (/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/).test(x); +} + +function isConstructorOrProto(obj, key) { + return (key === 'constructor' && typeof obj[key] === 'function') || key === '__proto__'; +} + +module.exports = function (args, opts) { + if (!opts) { opts = {}; } + + var flags = { + bools: {}, + strings: {}, + unknownFn: null, + }; + + if (typeof opts.unknown === 'function') { + flags.unknownFn = opts.unknown; + } + + if (typeof opts.boolean === 'boolean' && opts.boolean) { + flags.allBools = true; + } else { + [].concat(opts.boolean).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + + function aliasIsBoolean(key) { + return aliases[key].some(function (x) { + return flags.bools[x]; + }); + } + + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + [].concat(aliases[key]).forEach(function (k) { + flags.strings[k] = true; + }); + } + }); + + var defaults = opts.default || {}; + + var argv = { _: [] }; + + function argDefined(key, arg) { + return (flags.allBools && (/^--[^=]+$/).test(arg)) + || flags.strings[key] + || flags.bools[key] + || aliases[key]; + } + + function setKey(obj, keys, value) { + var o = obj; + for (var i = 0; i < keys.length - 1; i++) { + var key = keys[i]; + if (isConstructorOrProto(o, key)) { return; } + if (o[key] === undefined) { o[key] = {}; } + if ( + o[key] === Object.prototype + || o[key] === Number.prototype + || o[key] === String.prototype + ) { + o[key] = {}; + } + if (o[key] === Array.prototype) { o[key] = []; } + o = o[key]; + } + + var lastKey = keys[keys.length - 1]; + if (isConstructorOrProto(o, lastKey)) { return; } + if ( + o === Object.prototype + || o === Number.prototype + || o === String.prototype + ) { + o = {}; + } + if (o === Array.prototype) { o = []; } + if (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === 'boolean') { + o[lastKey] = value; + } else if (Array.isArray(o[lastKey])) { + o[lastKey].push(value); + } else { + o[lastKey] = [o[lastKey], value]; + } + } + + function setArg(key, val, arg) { + if (arg && flags.unknownFn && !argDefined(key, arg)) { + if (flags.unknownFn(arg) === false) { return; } + } + + var value = !flags.strings[key] && isNumber(val) + ? Number(val) + : val; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--') + 1); + args = args.slice(0, args.indexOf('--')); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var key; + var next; + + if ((/^--.+=/).test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== 'false'; + } + setArg(key, value, arg); + } else if ((/^--no-.+/).test(arg)) { + key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } else if ((/^--.+/).test(arg)) { + key = arg.match(/^--(.+)/)[1]; + next = args[i + 1]; + if ( + next !== undefined + && !(/^(-|--)[^-]/).test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !aliasIsBoolean(key) : true) + ) { + setArg(key, next, arg); + i += 1; + } else if ((/^(true|false)$/).test(next)) { + setArg(key, next === 'true', arg); + i += 1; + } else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } else if ((/^-[^-]+/).test(arg)) { + var letters = arg.slice(1, -1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + + if (next === '-') { + setArg(letters[j], next, arg); + continue; + } + + if ((/[A-Za-z]/).test(letters[j]) && next[0] === '=') { + setArg(letters[j], next.slice(1), arg); + broken = true; + break; + } + + if ( + (/[A-Za-z]/).test(letters[j]) + && (/-?\d+(\.\d*)?(e-?\d+)?$/).test(next) + ) { + setArg(letters[j], next, arg); + broken = true; + break; + } + + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], arg.slice(j + 2), arg); + broken = true; + break; + } else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); + } + } + + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if ( + args[i + 1] + && !(/^(-|--)[^-]/).test(args[i + 1]) + && !flags.bools[key] + && (aliases[key] ? !aliasIsBoolean(key) : true) + ) { + setArg(key, args[i + 1], arg); + i += 1; + } else if (args[i + 1] && (/^(true|false)$/).test(args[i + 1])) { + setArg(key, args[i + 1] === 'true', arg); + i += 1; + } else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + } else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg)); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + + Object.keys(defaults).forEach(function (k) { + if (!hasKey(argv, k.split('.'))) { + setKey(argv, k.split('.'), defaults[k]); + + (aliases[k] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[k]); + }); + } + }); + + if (opts['--']) { + argv['--'] = notFlags.slice(); + } else { + notFlags.forEach(function (k) { + argv._.push(k); + }); + } + + return argv; +}; diff --git a/node_modules/minimist/package.json b/node_modules/minimist/package.json new file mode 100644 index 0000000..c10a334 --- /dev/null +++ b/node_modules/minimist/package.json @@ -0,0 +1,75 @@ +{ + "name": "minimist", + "version": "1.2.8", + "description": "parse argument options", + "main": "index.js", + "devDependencies": { + "@ljharb/eslint-config": "^21.0.1", + "aud": "^2.0.2", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.6.3" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "lint": "eslint --ext=js,mjs .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/minimistjs/minimist.git" + }, + "homepage": "https://github.com/minimistjs/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/minimist/test/all_bool.js b/node_modules/minimist/test/all_bool.js new file mode 100644 index 0000000..befa0c9 --- /dev/null +++ b/node_modules/minimist/test/all_bool.js @@ -0,0 +1,34 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('flag boolean true (default all --args to boolean)', function (t) { + var argv = parse(['moo', '--honk', 'cow'], { + boolean: true, + }); + + t.deepEqual(argv, { + honk: true, + _: ['moo', 'cow'], + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); + +test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { + var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { + boolean: true, + }); + + t.deepEqual(argv, { + honk: true, + tacos: 'good', + p: 55, + _: ['moo', 'cow'], + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); diff --git a/node_modules/minimist/test/bool.js b/node_modules/minimist/test/bool.js new file mode 100644 index 0000000..e58d47e --- /dev/null +++ b/node_modules/minimist/test/bool.js @@ -0,0 +1,177 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false }, + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'], + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse(['-x', '-z', 'one', 'two', 'three'], { + boolean: ['x', 'y', 'z'], + }); + + t.deepEqual(argv, { + x: true, + y: false, + z: true, + _: ['one', 'two', 'three'], + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); +test('boolean and alias with chainable api', function (t) { + var aliased = ['-h', 'derp']; + var regular = ['--herp', 'derp']; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' }, + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' }, + }); + var expected = { + herp: true, + h: true, + _: ['derp'], + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = ['-h', 'derp']; + var regular = ['--herp', 'derp']; + var opts = { + alias: { h: 'herp' }, + boolean: 'herp', + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + _: ['derp'], + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias array with options hash', function (t) { + var aliased = ['-h', 'derp']; + var regular = ['--herp', 'derp']; + var alt = ['--harp', 'derp']; + var opts = { + alias: { h: ['herp', 'harp'] }, + boolean: 'h', + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var altPropertyArgv = parse(alt, opts); + var expected = { + harp: true, + herp: true, + h: true, + _: ['derp'], + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.same(altPropertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = ['-h', 'true']; + var regular = ['--herp', 'true']; + var opts = { + alias: { h: 'herp' }, + boolean: 'h', + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + _: [], + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function (t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool', + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool', + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); + +test('boolean --boool=true', function (t) { + var parsed = parse(['--boool=true'], { + default: { + boool: false, + }, + boolean: ['boool'], + }); + + t.same(parsed.boool, true); + t.end(); +}); + +test('boolean --boool=false', function (t) { + var parsed = parse(['--boool=false'], { + default: { + boool: true, + }, + boolean: ['boool'], + }); + + t.same(parsed.boool, false); + t.end(); +}); + +test('boolean using something similar to true', function (t) { + var opts = { boolean: 'h' }; + var result = parse(['-h', 'true.txt'], opts); + var expected = { + h: true, + _: ['true.txt'], + }; + + t.same(result, expected); + t.end(); +}); diff --git a/node_modules/minimist/test/dash.js b/node_modules/minimist/test/dash.js new file mode 100644 index 0000000..7078817 --- /dev/null +++ b/node_modules/minimist/test/dash.js @@ -0,0 +1,43 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(6); + t.deepEqual(parse(['-n', '-']), { n: '-', _: [] }); + t.deepEqual(parse(['--nnn', '-']), { nnn: '-', _: [] }); + t.deepEqual(parse(['-']), { _: ['-'] }); + t.deepEqual(parse(['-f-']), { f: '-', _: [] }); + t.deepEqual( + parse(['-b', '-'], { boolean: 'b' }), + { b: true, _: ['-'] } + ); + t.deepEqual( + parse(['-s', '-'], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(2); + t.deepEqual(parse(['-a', '--', 'b']), { a: true, _: ['b'] }); + t.deepEqual(parse(['--a', '--', 'b']), { a: true, _: ['b'] }); +}); + +test('move arguments after the -- into their own `--` array', function (t) { + t.plan(1); + t.deepEqual( + parse(['--name', 'John', 'before', '--', 'after'], { '--': true }), + { name: 'John', _: ['before'], '--': ['after'] } + ); +}); + +test('--- option value', function (t) { + // A multi-dash value is largely an edge case, but check the behaviour is as expected, + // and in particular the same for short option and long option (as made consistent in Jan 2023). + t.plan(2); + t.deepEqual(parse(['-n', '---']), { n: '---', _: [] }); + t.deepEqual(parse(['--nnn', '---']), { nnn: '---', _: [] }); +}); + diff --git a/node_modules/minimist/test/default_bool.js b/node_modules/minimist/test/default_bool.js new file mode 100644 index 0000000..4e9f625 --- /dev/null +++ b/node_modules/minimist/test/default_bool.js @@ -0,0 +1,37 @@ +'use strict'; + +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true }, + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false }, + }); + t.equal(argv.somefalse, false); + t.end(); +}); + +test('boolean default to null', function (t) { + var argv = parse([], { + boolean: 'maybe', + default: { maybe: null }, + }); + t.equal(argv.maybe, null); + + var argvLong = parse(['--maybe'], { + boolean: 'maybe', + default: { maybe: null }, + }); + t.equal(argvLong.maybe, true); + t.end(); +}); diff --git a/node_modules/minimist/test/dotted.js b/node_modules/minimist/test/dotted.js new file mode 100644 index 0000000..126ff03 --- /dev/null +++ b/node_modules/minimist/test/dotted.js @@ -0,0 +1,24 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], { default: { 'a.b': 11 }, alias: { 'a.b': 'aa.bb' } }); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', { default: { 'a.b': 11 }, alias: { 'a.b': 'aa.bb' } }); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); + +test('dotted default with no alias', function (t) { + var argv = parse('', { default: { 'a.b': 11 } }); + t.equal(argv.a.b, 11); + t.end(); +}); diff --git a/node_modules/minimist/test/kv_short.js b/node_modules/minimist/test/kv_short.js new file mode 100644 index 0000000..6d1b53a --- /dev/null +++ b/node_modules/minimist/test/kv_short.js @@ -0,0 +1,32 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('short -k=v', function (t) { + t.plan(1); + + var argv = parse(['-b=123']); + t.deepEqual(argv, { b: 123, _: [] }); +}); + +test('multi short -k=v', function (t) { + t.plan(1); + + var argv = parse(['-a=whatever', '-b=robots']); + t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); +}); + +test('short with embedded equals -k=a=b', function (t) { + t.plan(1); + + var argv = parse(['-k=a=b']); + t.deepEqual(argv, { k: 'a=b', _: [] }); +}); + +test('short with later equals like -ab=c', function (t) { + t.plan(1); + + var argv = parse(['-ab=c']); + t.deepEqual(argv, { a: true, b: 'c', _: [] }); +}); diff --git a/node_modules/minimist/test/long.js b/node_modules/minimist/test/long.js new file mode 100644 index 0000000..9fef51f --- /dev/null +++ b/node_modules/minimist/test/long.js @@ -0,0 +1,33 @@ +'use strict'; + +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse(['--bool']), + { bool: true, _: [] }, + 'long boolean' + ); + t.deepEqual( + parse(['--pow', 'xixxle']), + { pow: 'xixxle', _: [] }, + 'long capture sp' + ); + t.deepEqual( + parse(['--pow=xixxle']), + { pow: 'xixxle', _: [] }, + 'long capture eq' + ); + t.deepEqual( + parse(['--host', 'localhost', '--port', '555']), + { host: 'localhost', port: 555, _: [] }, + 'long captures sp' + ); + t.deepEqual( + parse(['--host=localhost', '--port=555']), + { host: 'localhost', port: 555, _: [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/node_modules/minimist/test/num.js b/node_modules/minimist/test/num.js new file mode 100644 index 0000000..074393e --- /dev/null +++ b/node_modules/minimist/test/num.js @@ -0,0 +1,38 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789', + ]); + t.deepEqual(argv, { + x: 1234, + y: 5.67, + z: 1e7, + w: '10f', + hex: 0xdeadbeef, + _: [789], + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('already a number', function (t) { + var argv = parse(['-x', 1234, 789]); + t.deepEqual(argv, { x: 1234, _: [789] }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); diff --git a/node_modules/minimist/test/parse.js b/node_modules/minimist/test/parse.js new file mode 100644 index 0000000..65d9d90 --- /dev/null +++ b/node_modules/minimist/test/parse.js @@ -0,0 +1,209 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse(['--no-moo']), + { moo: false, _: [] }, + 'no' + ); + t.deepEqual( + parse(['-v', 'a', '-v', 'b', '-v', 'c']), + { v: ['a', 'b', 'c'], _: [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek', + ]), + { + c: true, + a: true, + t: true, + s: 'woo', + h: 'awesome', + b: true, + bool: true, + key: 'value', + multi: ['quux', 'baz'], + meep: false, + name: 'meowmers', + _: ['bare', '--not-a-flag', 'eek'], + } + ); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse(['-t', 'moo'], { boolean: 't' }); + t.deepEqual(argv, { t: true, _: ['moo'] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: ['t', 'verbose'], + default: { verbose: true }, + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'], + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('newlines in params', function (t) { + var args = parse(['-s', 'X\nX']); + t.deepEqual(args, { _: [], s: 'X\nX' }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse(['--s=X\nX']); + t.deepEqual(args, { _: [], s: 'X\nX' }); + t.end(); +}); + +test('strings', function (t) { + var s = parse(['-s', '0001234'], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse(['-x', '56'], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([' ', ' '], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function (t) { + var s = parse(['-s'], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse(['--str'], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse(['-art'], { + string: ['a', 't'], + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + +test('string and alias', function (t) { + var x = parse(['--str', '000123'], { + string: 's', + alias: { s: 'str' }, + }); + + t.equal(x.str, '000123'); + t.equal(typeof x.str, 'string'); + t.equal(x.s, '000123'); + t.equal(typeof x.s, 'string'); + + var y = parse(['-s', '000123'], { + string: 'str', + alias: { str: 's' }, + }); + + t.equal(y.str, '000123'); + t.equal(typeof y.str, 'string'); + t.equal(y.s, '000123'); + t.equal(typeof y.s, 'string'); + + var z = parse(['-s123'], { + alias: { str: ['s', 'S'] }, + string: ['str'], + }); + + t.deepEqual( + z, + { _: [], s: '123', S: '123', str: '123' }, + 'opt.string works with multiple aliases' + ); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse(['-I/foo/bar/baz']), + { I: '/foo/bar/baz', _: [] } + ); + t.same( + parse(['-xyz/foo/bar/baz']), + { x: true, y: true, z: '/foo/bar/baz', _: [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse(['-f', '11', '--zoom', '55'], { + alias: { z: 'zoom' }, + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse(['-f', '11', '--zoom', '55'], { + alias: { z: ['zm', 'zoom'] }, + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop', + ]); + + t.same(argv.foo, { + bar: 3, + baz: 4, + quux: { + quibble: 5, + o_O: true, + }, + }); + t.same(argv.beep, { boop: true }); + t.end(); +}); diff --git a/node_modules/minimist/test/parse_modified.js b/node_modules/minimist/test/parse_modified.js new file mode 100644 index 0000000..32965d1 --- /dev/null +++ b/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,11 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions', function (t) { + t.plan(1); + + var argv = parse(['-b', '123'], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: [123] }); +}); diff --git a/node_modules/minimist/test/proto.js b/node_modules/minimist/test/proto.js new file mode 100644 index 0000000..6e629dd --- /dev/null +++ b/node_modules/minimist/test/proto.js @@ -0,0 +1,64 @@ +'use strict'; + +/* eslint no-proto: 0 */ + +var parse = require('../'); +var test = require('tape'); + +test('proto pollution', function (t) { + var argv = parse(['--__proto__.x', '123']); + t.equal({}.x, undefined); + t.equal(argv.__proto__.x, undefined); + t.equal(argv.x, undefined); + t.end(); +}); + +test('proto pollution (array)', function (t) { + var argv = parse(['--x', '4', '--x', '5', '--x.__proto__.z', '789']); + t.equal({}.z, undefined); + t.deepEqual(argv.x, [4, 5]); + t.equal(argv.x.z, undefined); + t.equal(argv.x.__proto__.z, undefined); + t.end(); +}); + +test('proto pollution (number)', function (t) { + var argv = parse(['--x', '5', '--x.__proto__.z', '100']); + t.equal({}.z, undefined); + t.equal((4).z, undefined); + t.equal(argv.x, 5); + t.equal(argv.x.z, undefined); + t.end(); +}); + +test('proto pollution (string)', function (t) { + var argv = parse(['--x', 'abc', '--x.__proto__.z', 'def']); + t.equal({}.z, undefined); + t.equal('...'.z, undefined); + t.equal(argv.x, 'abc'); + t.equal(argv.x.z, undefined); + t.end(); +}); + +test('proto pollution (constructor)', function (t) { + var argv = parse(['--constructor.prototype.y', '123']); + t.equal({}.y, undefined); + t.equal(argv.y, undefined); + t.end(); +}); + +test('proto pollution (constructor function)', function (t) { + var argv = parse(['--_.concat.constructor.prototype.y', '123']); + function fnToBeTested() {} + t.equal(fnToBeTested.y, undefined); + t.equal(argv.y, undefined); + t.end(); +}); + +// powered by snyk - https://github.com/backstage/backstage/issues/10343 +test('proto pollution (constructor function) snyk', function (t) { + var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' ')); + t.equal(function () {}.foo, undefined); + t.equal(argv.y, undefined); + t.end(); +}); diff --git a/node_modules/minimist/test/short.js b/node_modules/minimist/test/short.js new file mode 100644 index 0000000..4a7b843 --- /dev/null +++ b/node_modules/minimist/test/short.js @@ -0,0 +1,69 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse(['-n123']), { n: 123, _: [] }); + t.deepEqual( + parse(['-123', '456']), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse(['-b']), + { b: true, _: [] }, + 'short boolean' + ); + t.deepEqual( + parse(['foo', 'bar', 'baz']), + { _: ['foo', 'bar', 'baz'] }, + 'bare' + ); + t.deepEqual( + parse(['-cats']), + { c: true, a: true, t: true, s: true, _: [] }, + 'group' + ); + t.deepEqual( + parse(['-cats', 'meow']), + { c: true, a: true, t: true, s: 'meow', _: [] }, + 'short group next' + ); + t.deepEqual( + parse(['-h', 'localhost']), + { h: 'localhost', _: [] }, + 'short capture' + ); + t.deepEqual( + parse(['-h', 'localhost', '-p', '555']), + { h: 'localhost', p: 555, _: [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse(['-h', 'localhost', '-fp', '555', 'script.js']), + { + f: true, p: 555, h: 'localhost', + _: ['script.js'], + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse(['-h', 'localhost', '-fp', '555', 'script.js']), + { + f: true, p: 555, h: 'localhost', + _: ['script.js'], + } + ); + t.end(); +}); diff --git a/node_modules/minimist/test/stop_early.js b/node_modules/minimist/test/stop_early.js new file mode 100644 index 0000000..52a6a91 --- /dev/null +++ b/node_modules/minimist/test/stop_early.js @@ -0,0 +1,17 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('stops parsing on the first non-option when stopEarly is set', function (t) { + var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { + stopEarly: true, + }); + + t.deepEqual(argv, { + aaa: 'bbb', + _: ['ccc', '--ddd'], + }); + + t.end(); +}); diff --git a/node_modules/minimist/test/unknown.js b/node_modules/minimist/test/unknown.js new file mode 100644 index 0000000..4f2e0ca --- /dev/null +++ b/node_modules/minimist/test/unknown.js @@ -0,0 +1,104 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('boolean and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = ['-h', 'true', '--derp', 'true']; + var regular = ['--herp', 'true', '-d', 'true']; + var opts = { + alias: { h: 'herp' }, + boolean: 'h', + unknown: unknownFn, + }; + parse(aliased, opts); + parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('flag boolean true any double hyphen argument is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { + boolean: true, + unknown: unknownFn, + }); + t.same(unknown, ['--tacos=good', 'cow', '-p']); + t.same(argv, { + honk: true, + _: [], + }); + t.end(); +}); + +test('string and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = ['-h', 'hello', '--derp', 'goodbye']; + var regular = ['--herp', 'hello', '-d', 'moon']; + var opts = { + alias: { h: 'herp' }, + string: 'h', + unknown: unknownFn, + }; + parse(aliased, opts); + parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('default and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = ['-h', 'hello']; + var regular = ['--herp', 'hello']; + var opts = { + default: { h: 'bar' }, + alias: { h: 'herp' }, + unknown: unknownFn, + }; + parse(aliased, opts); + parse(regular, opts); + + t.same(unknown, []); + t.end(); + unknownFn(); // exercise fn for 100% coverage +}); + +test('value following -- is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = ['--bad', '--', 'good', 'arg']; + var opts = { + '--': true, + unknown: unknownFn, + }; + var argv = parse(aliased, opts); + + t.same(unknown, ['--bad']); + t.same(argv, { + '--': ['good', 'arg'], + _: [], + }); + t.end(); +}); diff --git a/node_modules/minimist/test/whitespace.js b/node_modules/minimist/test/whitespace.js new file mode 100644 index 0000000..4fdaf1d --- /dev/null +++ b/node_modules/minimist/test/whitespace.js @@ -0,0 +1,10 @@ +'use strict'; + +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace', function (t) { + t.plan(1); + var x = parse(['-x', '\t']).x; + t.equal(x, '\t'); +}); diff --git a/node_modules/minipass/LICENSE b/node_modules/minipass/LICENSE new file mode 100644 index 0000000..97f8e32 --- /dev/null +++ b/node_modules/minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2017-2023 npm, Inc., Isaac Z. Schlueter, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minipass/README.md b/node_modules/minipass/README.md new file mode 100644 index 0000000..1126330 --- /dev/null +++ b/node_modules/minipass/README.md @@ -0,0 +1,825 @@ +# minipass + +A _very_ minimal implementation of a [PassThrough +stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) + +[It's very +fast](https://docs.google.com/spreadsheets/d/1K_HR5oh3r80b8WVMWCPPjfuWXUgfkmhlX7FGI6JJ8tY/edit?usp=sharing) +for objects, strings, and buffers. + +Supports `pipe()`ing (including multi-`pipe()` and backpressure +transmission), buffering data until either a `data` event handler +or `pipe()` is added (so you don't lose the first chunk), and +most other cases where PassThrough is a good idea. + +There is a `read()` method, but it's much more efficient to +consume data from this stream via `'data'` events or by calling +`pipe()` into some other stream. Calling `read()` requires the +buffer to be flattened in some cases, which requires copying +memory. + +If you set `objectMode: true` in the options, then whatever is +written will be emitted. Otherwise, it'll do a minimal amount of +Buffer copying to ensure proper Streams semantics when `read(n)` +is called. + +`objectMode` can only be set at instantiation. Attempting to +write something other than a String or Buffer without having set +`objectMode` in the options will throw an error. + +This is not a `through` or `through2` stream. It doesn't +transform the data, it just passes it right through. If you want +to transform the data, extend the class, and override the +`write()` method. Once you're done transforming the data however +you want, call `super.write()` with the transform output. + +For some examples of streams that extend Minipass in various +ways, check out: + +- [minizlib](http://npm.im/minizlib) +- [fs-minipass](http://npm.im/fs-minipass) +- [tar](http://npm.im/tar) +- [minipass-collect](http://npm.im/minipass-collect) +- [minipass-flush](http://npm.im/minipass-flush) +- [minipass-pipeline](http://npm.im/minipass-pipeline) +- [tap](http://npm.im/tap) +- [tap-parser](http://npm.im/tap-parser) +- [treport](http://npm.im/treport) +- [minipass-fetch](http://npm.im/minipass-fetch) +- [pacote](http://npm.im/pacote) +- [make-fetch-happen](http://npm.im/make-fetch-happen) +- [cacache](http://npm.im/cacache) +- [ssri](http://npm.im/ssri) +- [npm-registry-fetch](http://npm.im/npm-registry-fetch) +- [minipass-json-stream](http://npm.im/minipass-json-stream) +- [minipass-sized](http://npm.im/minipass-sized) + +## Usage in TypeScript + +The `Minipass` class takes three type template definitions: + +- `RType` the type being read, which defaults to `Buffer`. If + `RType` is `string`, then the constructor _must_ get an options + object specifying either an `encoding` or `objectMode: true`. + If it's anything other than `string` or `Buffer`, then it + _must_ get an options object specifying `objectMode: true`. +- `WType` the type being written. If `RType` is `Buffer` or + `string`, then this defaults to `ContiguousData` (Buffer, + string, ArrayBuffer, or ArrayBufferView). Otherwise, it + defaults to `RType`. +- `Events` type mapping event names to the arguments emitted + with that event, which extends `Minipass.Events`. + +To declare types for custom events in subclasses, extend the +third parameter with your own event signatures. For example: + +```js +import { Minipass } from 'minipass' + +// a NDJSON stream that emits 'jsonError' when it can't stringify +export interface Events extends Minipass.Events { + jsonError: [e: Error] +} + +export class NDJSONStream extends Minipass { + constructor() { + super({ objectMode: true }) + } + + // data is type `any` because that's WType + write(data, encoding, cb) { + try { + const json = JSON.stringify(data) + return super.write(json + '\n', encoding, cb) + } catch (er) { + if (!er instanceof Error) { + er = Object.assign(new Error('json stringify failed'), { + cause: er, + }) + } + // trying to emit with something OTHER than an error will + // fail, because we declared the event arguments type. + this.emit('jsonError', er) + } + } +} + +const s = new NDJSONStream() +s.on('jsonError', e => { + // here, TS knows that e is an Error +}) +``` + +Emitting/handling events that aren't declared in this way is +fine, but the arguments will be typed as `unknown`. + +## Differences from Node.js Streams + +There are several things that make Minipass streams different +from (and in some ways superior to) Node.js core streams. + +Please read these caveats if you are familiar with node-core +streams and intend to use Minipass streams in your programs. + +You can avoid most of these differences entirely (for a very +small performance penalty) by setting `{async: true}` in the +constructor options. + +### Timing + +Minipass streams are designed to support synchronous use-cases. +Thus, data is emitted as soon as it is available, always. It is +buffered until read, but no longer. Another way to look at it is +that Minipass streams are exactly as synchronous as the logic +that writes into them. + +This can be surprising if your code relies on +`PassThrough.write()` always providing data on the next tick +rather than the current one, or being able to call `resume()` and +not have the entire buffer disappear immediately. + +However, without this synchronicity guarantee, there would be no +way for Minipass to achieve the speeds it does, or support the +synchronous use cases that it does. Simply put, waiting takes +time. + +This non-deferring approach makes Minipass streams much easier to +reason about, especially in the context of Promises and other +flow-control mechanisms. + +Example: + +```js +// hybrid module, either works +import { Minipass } from 'minipass' +// or: +const { Minipass } = require('minipass') + +const stream = new Minipass() +stream.on('data', () => console.log('data event')) +console.log('before write') +stream.write('hello') +console.log('after write') +// output: +// before write +// data event +// after write +``` + +### Exception: Async Opt-In + +If you wish to have a Minipass stream with behavior that more +closely mimics Node.js core streams, you can set the stream in +async mode either by setting `async: true` in the constructor +options, or by setting `stream.async = true` later on. + +```js +// hybrid module, either works +import { Minipass } from 'minipass' +// or: +const { Minipass } = require('minipass') + +const asyncStream = new Minipass({ async: true }) +asyncStream.on('data', () => console.log('data event')) +console.log('before write') +asyncStream.write('hello') +console.log('after write') +// output: +// before write +// after write +// data event <-- this is deferred until the next tick +``` + +Switching _out_ of async mode is unsafe, as it could cause data +corruption, and so is not enabled. Example: + +```js +import { Minipass } from 'minipass' +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist! +stream.write('world') +console.log('after writes') +// hypothetical output would be: +// before writes +// world +// after writes +// hello +// NOT GOOD! +``` + +To avoid this problem, once set into async mode, any attempt to +make the stream sync again will be ignored. + +```js +const { Minipass } = require('minipass') +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +stream.async = false // <-- no-op, stream already async +stream.write('world') +console.log('after writes') +// actual output: +// before writes +// after writes +// hello +// world +``` + +### No High/Low Water Marks + +Node.js core streams will optimistically fill up a buffer, +returning `true` on all writes until the limit is hit, even if +the data has nowhere to go. Then, they will not attempt to draw +more data in until the buffer size dips below a minimum value. + +Minipass streams are much simpler. The `write()` method will +return `true` if the data has somewhere to go (which is to say, +given the timing guarantees, that the data is already there by +the time `write()` returns). + +If the data has nowhere to go, then `write()` returns false, and +the data sits in a buffer, to be drained out immediately as soon +as anyone consumes it. + +Since nothing is ever buffered unnecessarily, there is much less +copying data, and less bookkeeping about buffer capacity levels. + +### Hazards of Buffering (or: Why Minipass Is So Fast) + +Since data written to a Minipass stream is immediately written +all the way through the pipeline, and `write()` always returns +true/false based on whether the data was fully flushed, +backpressure is communicated immediately to the upstream caller. +This minimizes buffering. + +Consider this case: + +```js +const { PassThrough } = require('stream') +const p1 = new PassThrough({ highWaterMark: 1024 }) +const p2 = new PassThrough({ highWaterMark: 1024 }) +const p3 = new PassThrough({ highWaterMark: 1024 }) +const p4 = new PassThrough({ highWaterMark: 1024 }) + +p1.pipe(p2).pipe(p3).pipe(p4) +p4.on('data', () => console.log('made it through')) + +// this returns false and buffers, then writes to p2 on next tick (1) +// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) +// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) +// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' +// on next tick (4) +// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and +// 'drain' on next tick (5) +// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) +// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next +// tick (7) + +p1.write(Buffer.alloc(2048)) // returns false +``` + +Along the way, the data was buffered and deferred at each stage, +and multiple event deferrals happened, for an unblocked pipeline +where it was perfectly safe to write all the way through! + +Furthermore, setting a `highWaterMark` of `1024` might lead +someone reading the code to think an advisory maximum of 1KiB is +being set for the pipeline. However, the actual advisory +buffering level is the _sum_ of `highWaterMark` values, since +each one has its own bucket. + +Consider the Minipass case: + +```js +const m1 = new Minipass() +const m2 = new Minipass() +const m3 = new Minipass() +const m4 = new Minipass() + +m1.pipe(m2).pipe(m3).pipe(m4) +m4.on('data', () => console.log('made it through')) + +// m1 is flowing, so it writes the data to m2 immediately +// m2 is flowing, so it writes the data to m3 immediately +// m3 is flowing, so it writes the data to m4 immediately +// m4 is flowing, so it fires the 'data' event immediately, returns true +// m4's write returned true, so m3 is still flowing, returns true +// m3's write returned true, so m2 is still flowing, returns true +// m2's write returned true, so m1 is still flowing, returns true +// No event deferrals or buffering along the way! + +m1.write(Buffer.alloc(2048)) // returns true +``` + +It is extremely unlikely that you _don't_ want to buffer any data +written, or _ever_ buffer data that can be flushed all the way +through. Neither node-core streams nor Minipass ever fail to +buffer written data, but node-core streams do a lot of +unnecessary buffering and pausing. + +As always, the faster implementation is the one that does less +stuff and waits less time to do it. + +### Immediately emit `end` for empty streams (when not paused) + +If a stream is not paused, and `end()` is called before writing +any data into it, then it will emit `end` immediately. + +If you have logic that occurs on the `end` event which you don't +want to potentially happen immediately (for example, closing file +descriptors, moving on to the next entry in an archive parse +stream, etc.) then be sure to call `stream.pause()` on creation, +and then `stream.resume()` once you are ready to respond to the +`end` event. + +However, this is _usually_ not a problem because: + +### Emit `end` When Asked + +One hazard of immediately emitting `'end'` is that you may not +yet have had a chance to add a listener. In order to avoid this +hazard, Minipass streams safely re-emit the `'end'` event if a +new listener is added after `'end'` has been emitted. + +Ie, if you do `stream.on('end', someFunction)`, and the stream +has already emitted `end`, then it will call the handler right +away. (You can think of this somewhat like attaching a new +`.then(fn)` to a previously-resolved Promise.) + +To prevent calling handlers multiple times who would not expect +multiple ends to occur, all listeners are removed from the +`'end'` event whenever it is emitted. + +### Emit `error` When Asked + +The most recent error object passed to the `'error'` event is +stored on the stream. If a new `'error'` event handler is added, +and an error was previously emitted, then the event handler will +be called immediately (or on `process.nextTick` in the case of +async streams). + +This makes it much more difficult to end up trying to interact +with a broken stream, if the error handler is added after an +error was previously emitted. + +### Impact of "immediate flow" on Tee-streams + +A "tee stream" is a stream piping to multiple destinations: + +```js +const tee = new Minipass() +t.pipe(dest1) +t.pipe(dest2) +t.write('foo') // goes to both destinations +``` + +Since Minipass streams _immediately_ process any pending data +through the pipeline when a new pipe destination is added, this +can have surprising effects, especially when a stream comes in +from some other function and may or may not have data in its +buffer. + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone +src.pipe(dest2) // gets nothing! +``` + +One solution is to create a dedicated tee-stream junction that +pipes to both locations, and then pipe to _that_ instead. + +```js +// Safe example: tee to both places +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.pipe(dest1) +tee.pipe(dest2) +src.pipe(tee) // tee gets 'foo', pipes to both locations +``` + +The same caveat applies to `on('data')` event listeners. The +first one added will _immediately_ receive all of the data, +leaving nothing for the second: + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.on('data', handler1) // receives 'foo' right away +src.on('data', handler2) // nothing to see here! +``` + +Using a dedicated tee-stream can be used in this case as well: + +```js +// Safe example: tee to both data handlers +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.on('data', handler1) +tee.on('data', handler2) +src.pipe(tee) +``` + +All of the hazards in this section are avoided by setting `{ +async: true }` in the Minipass constructor, or by setting +`stream.async = true` afterwards. Note that this does add some +overhead, so should only be done in cases where you are willing +to lose a bit of performance in order to avoid having to refactor +program logic. + +## USAGE + +It's a stream! Use it like a stream and it'll most likely do what +you want. + +```js +import { Minipass } from 'minipass' +const mp = new Minipass(options) // options is optional +mp.write('foo') +mp.pipe(someOtherStream) +mp.end('bar') +``` + +### OPTIONS + +- `encoding` How would you like the data coming _out_ of the + stream to be encoded? Accepts any values that can be passed to + `Buffer.toString()`. +- `objectMode` Emit data exactly as it comes in. This will be + flipped on by default if you write() something other than a + string or Buffer at any point. Setting `objectMode: true` will + prevent setting any encoding value. +- `async` Defaults to `false`. Set to `true` to defer data + emission until next tick. This reduces performance slightly, + but makes Minipass streams use timing behavior closer to Node + core streams. See [Timing](#timing) for more details. +- `signal` An `AbortSignal` that will cause the stream to unhook + itself from everything and become as inert as possible. Note + that providing a `signal` parameter will make `'error'` events + no longer throw if they are unhandled, but they will still be + emitted to handlers if any are attached. + +### API + +Implements the user-facing portions of Node.js's `Readable` and +`Writable` streams. + +### Methods + +- `write(chunk, [encoding], [callback])` - Put data in. (Note + that, in the base Minipass class, the same data will come out.) + Returns `false` if the stream will buffer the next write, or + true if it's still in "flowing" mode. +- `end([chunk, [encoding]], [callback])` - Signal that you have + no more data to write. This will queue an `end` event to be + fired when all the data has been consumed. +- `pause()` - No more data for a while, please. This also + prevents `end` from being emitted for empty streams until the + stream is resumed. +- `resume()` - Resume the stream. If there's data in the buffer, + it is all discarded. Any buffered events are immediately + emitted. +- `pipe(dest)` - Send all output to the stream provided. When + data is emitted, it is immediately written to any and all pipe + destinations. (Or written on next tick in `async` mode.) +- `unpipe(dest)` - Stop piping to the destination stream. This is + immediate, meaning that any asynchronously queued data will + _not_ make it to the destination when running in `async` mode. + - `options.end` - Boolean, end the destination stream when the + source stream ends. Default `true`. + - `options.proxyErrors` - Boolean, proxy `error` events from + the source stream to the destination stream. Note that errors + are _not_ proxied after the pipeline terminates, either due + to the source emitting `'end'` or manually unpiping with + `src.unpipe(dest)`. Default `false`. +- `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are + EventEmitters. Some events are given special treatment, + however. (See below under "events".) +- `promise()` - Returns a Promise that resolves when the stream + emits `end`, or rejects if the stream emits `error`. +- `collect()` - Return a Promise that resolves on `end` with an + array containing each chunk of data that was emitted, or + rejects if the stream emits `error`. Note that this consumes + the stream data. +- `concat()` - Same as `collect()`, but concatenates the data + into a single Buffer object. Will reject the returned promise + if the stream is in objectMode, or if it goes into objectMode + by the end of the data. +- `read(n)` - Consume `n` bytes of data out of the buffer. If `n` + is not provided, then consume all of it. If `n` bytes are not + available, then it returns null. **Note** consuming streams in + this way is less efficient, and can lead to unnecessary Buffer + copying. +- `destroy([er])` - Destroy the stream. If an error is provided, + then an `'error'` event is emitted. If the stream has a + `close()` method, and has not emitted a `'close'` event yet, + then `stream.close()` will be called. Any Promises returned by + `.promise()`, `.collect()` or `.concat()` will be rejected. + After being destroyed, writing to the stream will emit an + error. No more data will be emitted if the stream is destroyed, + even if it was previously buffered. + +### Properties + +- `bufferLength` Read-only. Total number of bytes buffered, or in + the case of objectMode, the total number of objects. +- `encoding` Read-only. The encoding that has been set. +- `flowing` Read-only. Boolean indicating whether a chunk written + to the stream will be immediately emitted. +- `emittedEnd` Read-only. Boolean indicating whether the end-ish + events (ie, `end`, `prefinish`, `finish`) have been emitted. + Note that listening on any end-ish event will immediateyl + re-emit it if it has already been emitted. +- `writable` Whether the stream is writable. Default `true`. Set + to `false` when `end()` +- `readable` Whether the stream is readable. Default `true`. +- `pipes` An array of Pipe objects referencing streams that this + stream is piping into. +- `destroyed` A getter that indicates whether the stream was + destroyed. +- `paused` True if the stream has been explicitly paused, + otherwise false. +- `objectMode` Indicates whether the stream is in `objectMode`. +- `aborted` Readonly property set when the `AbortSignal` + dispatches an `abort` event. + +### Events + +- `data` Emitted when there's data to read. Argument is the data + to read. This is never emitted while not flowing. If a listener + is attached, that will resume the stream. +- `end` Emitted when there's no more data to read. This will be + emitted immediately for empty streams when `end()` is called. + If a listener is attached, and `end` was already emitted, then + it will be emitted again. All listeners are removed when `end` + is emitted. +- `prefinish` An end-ish event that follows the same logic as + `end` and is emitted in the same conditions where `end` is + emitted. Emitted after `'end'`. +- `finish` An end-ish event that follows the same logic as `end` + and is emitted in the same conditions where `end` is emitted. + Emitted after `'prefinish'`. +- `close` An indication that an underlying resource has been + released. Minipass does not emit this event, but will defer it + until after `end` has been emitted, since it throws off some + stream libraries otherwise. +- `drain` Emitted when the internal buffer empties, and it is + again suitable to `write()` into the stream. +- `readable` Emitted when data is buffered and ready to be read + by a consumer. +- `resume` Emitted when stream changes state from buffering to + flowing mode. (Ie, when `resume` is called, `pipe` is called, + or a `data` event listener is added.) + +### Static Methods + +- `Minipass.isStream(stream)` Returns `true` if the argument is a + stream, and false otherwise. To be considered a stream, the + object must be either an instance of Minipass, or an + EventEmitter that has either a `pipe()` method, or both + `write()` and `end()` methods. (Pretty much any stream in + node-land will return `true` for this.) + +## EXAMPLES + +Here are some examples of things you can do with Minipass +streams. + +### simple "are you done yet" promise + +```js +mp.promise().then( + () => { + // stream is finished + }, + er => { + // stream emitted an error + } +) +``` + +### collecting + +```js +mp.collect().then(all => { + // all is an array of all the data emitted + // encoding is supported in this case, so + // so the result will be a collection of strings if + // an encoding is specified, or buffers/objects if not. + // + // In an async function, you may do + // const data = await stream.collect() +}) +``` + +### collecting into a single blob + +This is a bit slower because it concatenates the data into one +chunk for you, but if you're going to do it yourself anyway, it's +convenient this way: + +```js +mp.concat().then(onebigchunk => { + // onebigchunk is a string if the stream + // had an encoding set, or a buffer otherwise. +}) +``` + +### iteration + +You can iterate over streams synchronously or asynchronously in +platforms that support it. + +Synchronous iteration will end when the currently available data +is consumed, even if the `end` event has not been reached. In +string and buffer mode, the data is concatenated, so unless +multiple writes are occurring in the same tick as the `read()`, +sync iteration loops will generally only have a single iteration. + +To consume chunks in this way exactly as they have been written, +with no flattening, create the stream with the `{ objectMode: +true }` option. + +```js +const mp = new Minipass({ objectMode: true }) +mp.write('a') +mp.write('b') +for (let letter of mp) { + console.log(letter) // a, b +} +mp.write('c') +mp.write('d') +for (let letter of mp) { + console.log(letter) // c, d +} +mp.write('e') +mp.end() +for (let letter of mp) { + console.log(letter) // e +} +for (let letter of mp) { + console.log(letter) // nothing +} +``` + +Asynchronous iteration will continue until the end event is reached, +consuming all of the data. + +```js +const mp = new Minipass({ encoding: 'utf8' }) + +// some source of some data +let i = 5 +const inter = setInterval(() => { + if (i-- > 0) mp.write(Buffer.from('foo\n', 'utf8')) + else { + mp.end() + clearInterval(inter) + } +}, 100) + +// consume the data with asynchronous iteration +async function consume() { + for await (let chunk of mp) { + console.log(chunk) + } + return 'ok' +} + +consume().then(res => console.log(res)) +// logs `foo\n` 5 times, and then `ok` +``` + +### subclass that `console.log()`s everything written into it + +```js +class Logger extends Minipass { + write(chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end(chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } +} + +someSource.pipe(new Logger()).pipe(someDest) +``` + +### same thing, but using an inline anonymous class + +```js +// js classes are fun +someSource + .pipe( + new (class extends Minipass { + emit(ev, ...data) { + // let's also log events, because debugging some weird thing + console.log('EMIT', ev) + return super.emit(ev, ...data) + } + write(chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end(chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } + })() + ) + .pipe(someDest) +``` + +### subclass that defers 'end' for some reason + +```js +class SlowEnd extends Minipass { + emit(ev, ...args) { + if (ev === 'end') { + console.log('going to end, hold on a sec') + setTimeout(() => { + console.log('ok, ready to end now') + super.emit('end', ...args) + }, 100) + return true + } else { + return super.emit(ev, ...args) + } + } +} +``` + +### transform that creates newline-delimited JSON + +```js +class NDJSONEncode extends Minipass { + write(obj, cb) { + try { + // JSON.stringify can throw, emit an error on that + return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) + } catch (er) { + this.emit('error', er) + } + } + end(obj, cb) { + if (typeof obj === 'function') { + cb = obj + obj = undefined + } + if (obj !== undefined) { + this.write(obj) + } + return super.end(cb) + } +} +``` + +### transform that parses newline-delimited JSON + +```js +class NDJSONDecode extends Minipass { + constructor(options) { + // always be in object mode, as far as Minipass is concerned + super({ objectMode: true }) + this._jsonBuffer = '' + } + write(chunk, encoding, cb) { + if ( + typeof chunk === 'string' && + typeof encoding === 'string' && + encoding !== 'utf8' + ) { + chunk = Buffer.from(chunk, encoding).toString() + } else if (Buffer.isBuffer(chunk)) { + chunk = chunk.toString() + } + if (typeof encoding === 'function') { + cb = encoding + } + const jsonData = (this._jsonBuffer + chunk).split('\n') + this._jsonBuffer = jsonData.pop() + for (let i = 0; i < jsonData.length; i++) { + try { + // JSON.parse can throw, emit an error on that + super.write(JSON.parse(jsonData[i])) + } catch (er) { + this.emit('error', er) + continue + } + } + if (cb) cb() + } +} +``` diff --git a/node_modules/minipass/dist/commonjs/index.d.ts b/node_modules/minipass/dist/commonjs/index.d.ts new file mode 100644 index 0000000..031e61a --- /dev/null +++ b/node_modules/minipass/dist/commonjs/index.d.ts @@ -0,0 +1,549 @@ +/// +/// +/// +/// +import { EventEmitter } from 'node:events'; +import { StringDecoder } from 'node:string_decoder'; +/** + * Same as StringDecoder, but exposing the `lastNeed` flag on the type + */ +type SD = StringDecoder & { + lastNeed: boolean; +}; +export type { SD, Pipe, PipeProxyErrors }; +/** + * Return true if the argument is a Minipass stream, Node stream, or something + * else that Minipass can interact with. + */ +export declare const isStream: (s: any) => s is NodeJS.WriteStream | NodeJS.ReadStream | Minipass | (NodeJS.ReadStream & { + fd: number; +}) | (EventEmitter & { + pause(): any; + resume(): any; + pipe(...destArgs: any[]): any; +}) | (NodeJS.WriteStream & { + fd: number; +}) | (EventEmitter & { + end(): any; + write(chunk: any, ...args: any[]): any; +}); +/** + * Return true if the argument is a valid {@link Minipass.Readable} + */ +export declare const isReadable: (s: any) => s is Minipass.Readable; +/** + * Return true if the argument is a valid {@link Minipass.Writable} + */ +export declare const isWritable: (s: any) => s is Minipass.Readable; +declare const EOF: unique symbol; +declare const MAYBE_EMIT_END: unique symbol; +declare const EMITTED_END: unique symbol; +declare const EMITTING_END: unique symbol; +declare const EMITTED_ERROR: unique symbol; +declare const CLOSED: unique symbol; +declare const READ: unique symbol; +declare const FLUSH: unique symbol; +declare const FLUSHCHUNK: unique symbol; +declare const ENCODING: unique symbol; +declare const DECODER: unique symbol; +declare const FLOWING: unique symbol; +declare const PAUSED: unique symbol; +declare const RESUME: unique symbol; +declare const BUFFER: unique symbol; +declare const PIPES: unique symbol; +declare const BUFFERLENGTH: unique symbol; +declare const BUFFERPUSH: unique symbol; +declare const BUFFERSHIFT: unique symbol; +declare const OBJECTMODE: unique symbol; +declare const DESTROYED: unique symbol; +declare const ERROR: unique symbol; +declare const EMITDATA: unique symbol; +declare const EMITEND: unique symbol; +declare const EMITEND2: unique symbol; +declare const ASYNC: unique symbol; +declare const ABORT: unique symbol; +declare const ABORTED: unique symbol; +declare const SIGNAL: unique symbol; +declare const DATALISTENERS: unique symbol; +declare const DISCARDED: unique symbol; +/** + * Options that may be passed to stream.pipe() + */ +export interface PipeOptions { + /** + * end the destination stream when the source stream ends + */ + end?: boolean; + /** + * proxy errors from the source stream to the destination stream + */ + proxyErrors?: boolean; +} +/** + * Internal class representing a pipe to a destination stream. + * + * @internal + */ +declare class Pipe { + src: Minipass; + dest: Minipass; + opts: PipeOptions; + ondrain: () => any; + constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions); + unpipe(): void; + proxyErrors(_er: any): void; + end(): void; +} +/** + * Internal class representing a pipe to a destination stream where + * errors are proxied. + * + * @internal + */ +declare class PipeProxyErrors extends Pipe { + unpipe(): void; + constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions); +} +export declare namespace Minipass { + /** + * Encoding used to create a stream that outputs strings rather than + * Buffer objects. + */ + export type Encoding = BufferEncoding | 'buffer' | null; + /** + * Any stream that Minipass can pipe into + */ + export type Writable = Minipass | NodeJS.WriteStream | (NodeJS.WriteStream & { + fd: number; + }) | (EventEmitter & { + end(): any; + write(chunk: any, ...args: any[]): any; + }); + /** + * Any stream that can be read from + */ + export type Readable = Minipass | NodeJS.ReadStream | (NodeJS.ReadStream & { + fd: number; + }) | (EventEmitter & { + pause(): any; + resume(): any; + pipe(...destArgs: any[]): any; + }); + /** + * Utility type that can be iterated sync or async + */ + export type DualIterable = Iterable & AsyncIterable; + type EventArguments = Record; + /** + * The listing of events that a Minipass class can emit. + * Extend this when extending the Minipass class, and pass as + * the third template argument. The key is the name of the event, + * and the value is the argument list. + * + * Any undeclared events will still be allowed, but the handler will get + * arguments as `unknown[]`. + */ + export interface Events extends EventArguments { + readable: []; + data: [chunk: RType]; + error: [er: unknown]; + abort: [reason: unknown]; + drain: []; + resume: []; + end: []; + finish: []; + prefinish: []; + close: []; + [DESTROYED]: [er?: unknown]; + [ERROR]: [er: unknown]; + } + /** + * String or buffer-like data that can be joined and sliced + */ + export type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string; + export type BufferOrString = Buffer | string; + /** + * Options passed to the Minipass constructor. + */ + export type SharedOptions = { + /** + * Defer all data emission and other events until the end of the + * current tick, similar to Node core streams + */ + async?: boolean; + /** + * A signal which will abort the stream + */ + signal?: AbortSignal; + /** + * Output string encoding. Set to `null` or `'buffer'` (or omit) to + * emit Buffer objects rather than strings. + * + * Conflicts with `objectMode` + */ + encoding?: BufferEncoding | null | 'buffer'; + /** + * Output data exactly as it was written, supporting non-buffer/string + * data (such as arbitrary objects, falsey values, etc.) + * + * Conflicts with `encoding` + */ + objectMode?: boolean; + }; + /** + * Options for a string encoded output + */ + export type EncodingOptions = SharedOptions & { + encoding: BufferEncoding; + objectMode?: false; + }; + /** + * Options for contiguous data buffer output + */ + export type BufferOptions = SharedOptions & { + encoding?: null | 'buffer'; + objectMode?: false; + }; + /** + * Options for objectMode arbitrary output + */ + export type ObjectModeOptions = SharedOptions & { + objectMode: true; + encoding?: null; + }; + /** + * Utility type to determine allowed options based on read type + */ + export type Options = ObjectModeOptions | (T extends string ? EncodingOptions : T extends Buffer ? BufferOptions : SharedOptions); + export {}; +} +/** + * 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} + */ +export declare class Minipass = Minipass.Events> extends EventEmitter implements Minipass.DualIterable { + [FLOWING]: boolean; + [PAUSED]: boolean; + [PIPES]: Pipe[]; + [BUFFER]: RType[]; + [OBJECTMODE]: boolean; + [ENCODING]: BufferEncoding | null; + [ASYNC]: boolean; + [DECODER]: SD | null; + [EOF]: boolean; + [EMITTED_END]: boolean; + [EMITTING_END]: boolean; + [CLOSED]: boolean; + [EMITTED_ERROR]: unknown; + [BUFFERLENGTH]: number; + [DESTROYED]: boolean; + [SIGNAL]?: AbortSignal; + [ABORTED]: boolean; + [DATALISTENERS]: number; + [DISCARDED]: boolean; + /** + * true if the stream can be written + */ + writable: boolean; + /** + * true if the stream can be read + */ + readable: boolean; + /** + * 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: [Minipass.ObjectModeOptions] | (RType extends Buffer ? [] | [Minipass.Options] : [Minipass.Options])); + /** + * 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(): number; + /** + * The `BufferEncoding` currently in use, or `null` + */ + get encoding(): BufferEncoding | null; + /** + * @deprecated - This is a read only property + */ + set encoding(_enc: BufferEncoding | null); + /** + * @deprecated - Encoding may only be set at instantiation time + */ + setEncoding(_enc: Minipass.Encoding): void; + /** + * True if this is an objectMode stream + */ + get objectMode(): boolean; + /** + * @deprecated - This is a read-only property + */ + set objectMode(_om: boolean); + /** + * true if this is an async stream + */ + get ['async'](): boolean; + /** + * 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: boolean); + [ABORT](): void; + /** + * True if the stream has been aborted. + */ + get aborted(): boolean; + /** + * No-op setter. Stream aborted status is set via the AbortSignal provided + * in the constructor options. + */ + set aborted(_: boolean); + /** + * Write data into the stream + * + * If the chunk written is a string, and encoding is not specified, then + * `utf8` will be assumed. If the stream encoding matches the encoding of + * a written string, and the state of the string decoder allows it, then + * the string will be passed through to either the output or the internal + * buffer without any processing. Otherwise, it will be turned into a + * Buffer object for processing into the desired encoding. + * + * If provided, `cb` function is called immediately before return for + * sync streams, or on next tick for async streams, because for this + * base class, a chunk is considered "processed" once it is accepted + * and either emitted or buffered. That is, the callback does not indicate + * that the chunk has been eventually emitted, though of course child + * classes can override this function to do whatever processing is required + * and call `super.write(...)` only once processing is completed. + */ + write(chunk: WType, cb?: () => void): boolean; + write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean; + /** + * 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?: number | null): RType | null; + [READ](n: number | null, chunk: RType): RType; + /** + * End the stream, optionally providing a final write. + * + * See {@link Minipass#write} for argument descriptions + */ + end(cb?: () => void): this; + end(chunk: WType, cb?: () => void): this; + end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this; + [RESUME](): void; + /** + * 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(): void; + /** + * Pause the stream + */ + pause(): void; + /** + * true if the stream has been forcibly destroyed + */ + get destroyed(): boolean; + /** + * true if the stream is currently in a flowing state, meaning that + * any writes will be immediately emitted. + */ + get flowing(): boolean; + /** + * true if the stream is currently in a paused state + */ + get paused(): boolean; + [BUFFERPUSH](chunk: RType): void; + [BUFFERSHIFT](): RType; + [FLUSH](noDrain?: boolean): void; + [FLUSHCHUNK](chunk: RType): boolean; + /** + * Pipe all data emitted by this stream into the destination provided. + * + * Triggers the flow of data. + */ + pipe(dest: W, opts?: PipeOptions): W; + /** + * 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: W): void; + /** + * Alias for {@link Minipass#on} + */ + addListener(ev: Event, handler: (...args: Events[Event]) => any): this; + /** + * 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: Event, handler: (...args: Events[Event]) => any): this; + /** + * Alias for {@link Minipass#off} + */ + removeListener(ev: Event, handler: (...args: Events[Event]) => any): this; + /** + * 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: Event, handler: (...args: Events[Event]) => any): this; + /** + * 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?: Event): this; + /** + * true if the 'end' event has been emitted + */ + get emittedEnd(): boolean; + [MAYBE_EMIT_END](): void; + /** + * 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: Event, ...args: Events[Event]): boolean; + [EMITDATA](data: RType): boolean; + [EMITEND](): boolean; + [EMITEND2](): boolean; + /** + * Return a Promise that resolves to an array of all emitted data once + * the stream ends. + */ + collect(): Promise; + /** + * Return a Promise that resolves to the concatenation of all emitted data + * once the stream ends. + * + * Not allowed on objectMode streams. + */ + concat(): Promise; + /** + * Return a void Promise that resolves once the stream ends. + */ + promise(): Promise; + /** + * Asynchronous `for await of` iteration. + * + * This will continue emitting all chunks until the stream terminates. + */ + [Symbol.asyncIterator](): AsyncGenerator; + /** + * Synchronous `for of` iteration. + * + * The iteration will terminate when the internal buffer runs out, even + * if the stream has not yet terminated. + */ + [Symbol.iterator](): Generator; + /** + * 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?: unknown): this; + /** + * Alias for {@link isStream} + * + * Former export location, maintained for backwards compatibility. + * + * @deprecated + */ + static get isStream(): (s: any) => s is NodeJS.WriteStream | NodeJS.ReadStream | Minipass | (NodeJS.ReadStream & { + fd: number; + }) | (EventEmitter & { + pause(): any; + resume(): any; + pipe(...destArgs: any[]): any; + }) | (NodeJS.WriteStream & { + fd: number; + }) | (EventEmitter & { + end(): any; + write(chunk: any, ...args: any[]): any; + }); +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/minipass/dist/commonjs/index.d.ts.map b/node_modules/minipass/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..cac7e00 --- /dev/null +++ b/node_modules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E,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAiB1D;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC;IAY9B;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B;;;;OAIG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;IA6D3D;;;;;OAKG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;IAkCjD;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,CAAC,EAAE,OAAO;IA0BpB;;;;;;OAMG;IACH,MAAM,KAAK,QAAQ;;;;;;;;;;;OAElB;CACF"} \ No newline at end of file diff --git a/node_modules/minipass/dist/commonjs/index.js b/node_modules/minipass/dist/commonjs/index.js new file mode 100644 index 0000000..068c095 --- /dev/null +++ b/node_modules/minipass/dist/commonjs/index.js @@ -0,0 +1,1028 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Minipass = exports.isWritable = exports.isReadable = exports.isStream = void 0; +const proc = typeof process === 'object' && process + ? process + : { + stdout: null, + stderr: null, + }; +const node_events_1 = require("node:events"); +const node_stream_1 = __importDefault(require("node:stream")); +const node_string_decoder_1 = require("node:string_decoder"); +/** + * 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 node_stream_1.default || + (0, exports.isReadable)(s) || + (0, exports.isWritable)(s)); +exports.isStream = isStream; +/** + * Return true if the argument is a valid {@link Minipass.Readable} + */ +const isReadable = (s) => !!s && + typeof s === 'object' && + s instanceof node_events_1.EventEmitter && + typeof s.pipe === 'function' && + // node core Writable streams have a pipe() method, but it throws + s.pipe !== node_stream_1.default.Writable.prototype.pipe; +exports.isReadable = isReadable; +/** + * Return true if the argument is a valid {@link Minipass.Writable} + */ +const isWritable = (s) => !!s && + typeof s === 'object' && + s instanceof node_events_1.EventEmitter && + typeof s.write === 'function' && + typeof s.end === 'function'; +exports.isWritable = isWritable; +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 node_events_1.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 node_string_decoder_1.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 exports.isStream; + } +} +exports.Minipass = Minipass; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/minipass/dist/commonjs/index.js.map b/node_modules/minipass/dist/commonjs/index.js.map new file mode 100644 index 0000000..9f3ef4b --- /dev/null +++ b/node_modules/minipass/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO;IACpC,CAAC,CAAC,OAAO;IACT,CAAC,CAAC;QACE,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACb,CAAA;AACP,6CAA0C;AAC1C,8DAAgC;AAChC,6DAAmD;AASnD;;;GAGG;AACI,MAAM,QAAQ,GAAG,CACtB,CAAM,EACsC,EAAE,CAC9C,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,CAAC,YAAY,QAAQ;QACpB,CAAC,YAAY,qBAAM;QACnB,IAAA,kBAAU,EAAC,CAAC,CAAC;QACb,IAAA,kBAAU,EAAC,CAAC,CAAC,CAAC,CAAA;AARL,QAAA,QAAQ,YAQH;AAElB;;GAEG;AACI,MAAM,UAAU,GAAG,CAAC,CAAM,EAA0B,EAAE,CAC3D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,YAAY,0BAAY;IACzB,OAAQ,CAAuB,CAAC,IAAI,KAAK,UAAU;IACnD,iEAAiE;IAChE,CAAuB,CAAC,IAAI,KAAK,qBAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAA;AANrD,QAAA,UAAU,cAM2C;AAElE;;GAEG;AACI,MAA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AC,IAAI,CAAC,MAAM,CAAC;YAAE,EAAE,CAAC,KAAK,EAAE,CAAA;QAE/D,IAAI,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAC9B,qDAAqD;;YAChD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAEzB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;OAMG;IACH,MAAM,KAAK,QAAQ;QACjB,OAAO,gBAAQ,CAAA;IACjB,CAAC;CACF;AAn/BD,4BAm/BC","sourcesContent":["const proc =\n typeof process === 'object' && process\n ? process\n : {\n stdout: null,\n stderr: null,\n }\nimport { EventEmitter } from 'node:events'\nimport Stream from 'node:stream'\nimport { StringDecoder } from 'node:string_decoder'\n\n/**\n * Same as StringDecoder, but exposing the `lastNeed` flag on the type\n */\ntype SD = StringDecoder & { lastNeed: boolean }\n\nexport type { SD, Pipe, PipeProxyErrors }\n\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nexport const isStream = (\n s: any\n): s is Minipass.Readable | Minipass.Writable =>\n !!s &&\n typeof s === 'object' &&\n (s instanceof Minipass ||\n s instanceof Stream ||\n isReadable(s) ||\n isWritable(s))\n\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nexport const isReadable = (s: any): s is Minipass.Readable =>\n !!s &&\n typeof s === 'object' &&\n s instanceof EventEmitter &&\n typeof (s as Minipass.Readable).pipe === 'function' &&\n // node core Writable streams have a pipe() method, but it throws\n (s as Minipass.Readable).pipe !== Stream.Writable.prototype.pipe\n\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nexport const isWritable = (s: any): s is Minipass.Readable =>\n !!s &&\n typeof s === 'object' &&\n s instanceof EventEmitter &&\n typeof (s as Minipass.Writable).write === 'function' &&\n typeof (s as Minipass.Writable).end === 'function'\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\nconst DATALISTENERS = Symbol('dataListeners')\nconst DISCARDED = Symbol('discarded')\n\nconst defer = (fn: (...a: any[]) => any) => Promise.resolve().then(fn)\nconst nodefer = (fn: (...a: any[]) => any) => fn()\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\ntype EndishEvent = 'end' | 'finish' | 'prefinish'\nconst isEndish = (ev: any): ev is EndishEvent =>\n ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBufferLike = (b: any): b is ArrayBufferLike =>\n b instanceof ArrayBuffer ||\n (!!b &&\n typeof b === 'object' &&\n b.constructor &&\n b.constructor.name === 'ArrayBuffer' &&\n b.byteLength >= 0)\n\nconst isArrayBufferView = (b: any): b is ArrayBufferView =>\n !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\n/**\n * Options that may be passed to stream.pipe()\n */\nexport interface PipeOptions {\n /**\n * end the destination stream when the source stream ends\n */\n end?: boolean\n /**\n * proxy errors from the source stream to the destination stream\n */\n proxyErrors?: boolean\n}\n\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n src: Minipass\n dest: Minipass\n opts: PipeOptions\n ondrain: () => any\n constructor(\n src: Minipass,\n dest: Minipass.Writable,\n opts: PipeOptions\n ) {\n this.src = src\n this.dest = dest as Minipass\n this.opts = opts\n this.ondrain = () => src[RESUME]()\n this.dest.on('drain', this.ondrain)\n }\n unpipe() {\n this.dest.removeListener('drain', this.ondrain)\n }\n // only here for the prototype\n /* c8 ignore start */\n proxyErrors(_er: any) {}\n /* c8 ignore stop */\n end() {\n this.unpipe()\n if (this.opts.end) this.dest.end()\n }\n}\n\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n unpipe() {\n this.src.removeListener('error', this.proxyErrors)\n super.unpipe()\n }\n constructor(\n src: Minipass,\n dest: Minipass.Writable,\n opts: PipeOptions\n ) {\n super(src, dest, opts)\n this.proxyErrors = er => dest.emit('error', er)\n src.on('error', this.proxyErrors)\n }\n}\n\nexport namespace Minipass {\n /**\n * Encoding used to create a stream that outputs strings rather than\n * Buffer objects.\n */\n export type Encoding = BufferEncoding | 'buffer' | null\n\n /**\n * Any stream that Minipass can pipe into\n */\n export type Writable =\n | Minipass\n | NodeJS.WriteStream\n | (NodeJS.WriteStream & { fd: number })\n | (EventEmitter & {\n end(): any\n write(chunk: any, ...args: any[]): any\n })\n\n /**\n * Any stream that can be read from\n */\n export type Readable =\n | Minipass\n | NodeJS.ReadStream\n | (NodeJS.ReadStream & { fd: number })\n | (EventEmitter & {\n pause(): any\n resume(): any\n pipe(...destArgs: any[]): any\n })\n\n /**\n * Utility type that can be iterated sync or async\n */\n export type DualIterable = Iterable & AsyncIterable\n\n type EventArguments = Record\n\n /**\n * The listing of events that a Minipass class can emit.\n * Extend this when extending the Minipass class, and pass as\n * the third template argument. The key is the name of the event,\n * and the value is the argument list.\n *\n * Any undeclared events will still be allowed, but the handler will get\n * arguments as `unknown[]`.\n */\n export interface Events\n extends EventArguments {\n readable: []\n data: [chunk: RType]\n error: [er: unknown]\n abort: [reason: unknown]\n drain: []\n resume: []\n end: []\n finish: []\n prefinish: []\n close: []\n [DESTROYED]: [er?: unknown]\n [ERROR]: [er: unknown]\n }\n\n /**\n * String or buffer-like data that can be joined and sliced\n */\n export type ContiguousData =\n | Buffer\n | ArrayBufferLike\n | ArrayBufferView\n | string\n export type BufferOrString = Buffer | string\n\n /**\n * Options passed to the Minipass constructor.\n */\n export type SharedOptions = {\n /**\n * Defer all data emission and other events until the end of the\n * current tick, similar to Node core streams\n */\n async?: boolean\n /**\n * A signal which will abort the stream\n */\n signal?: AbortSignal\n /**\n * Output string encoding. Set to `null` or `'buffer'` (or omit) to\n * emit Buffer objects rather than strings.\n *\n * Conflicts with `objectMode`\n */\n encoding?: BufferEncoding | null | 'buffer'\n /**\n * Output data exactly as it was written, supporting non-buffer/string\n * data (such as arbitrary objects, falsey values, etc.)\n *\n * Conflicts with `encoding`\n */\n objectMode?: boolean\n }\n\n /**\n * Options for a string encoded output\n */\n export type EncodingOptions = SharedOptions & {\n encoding: BufferEncoding\n objectMode?: false\n }\n\n /**\n * Options for contiguous data buffer output\n */\n export type BufferOptions = SharedOptions & {\n encoding?: null | 'buffer'\n objectMode?: false\n }\n\n /**\n * Options for objectMode arbitrary output\n */\n export type ObjectModeOptions = SharedOptions & {\n objectMode: true\n encoding?: null\n }\n\n /**\n * Utility type to determine allowed options based on read type\n */\n export type Options =\n | ObjectModeOptions\n | (T extends string\n ? EncodingOptions\n : T extends Buffer\n ? BufferOptions\n : SharedOptions)\n}\n\nconst isObjectModeOptions = (\n o: Minipass.SharedOptions\n): o is Minipass.ObjectModeOptions => !!o.objectMode\n\nconst isEncodingOptions = (\n o: Minipass.SharedOptions\n): o is Minipass.EncodingOptions =>\n !o.objectMode && !!o.encoding && o.encoding !== 'buffer'\n\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nexport class Minipass<\n RType extends unknown = Buffer,\n WType extends unknown = RType extends Minipass.BufferOrString\n ? Minipass.ContiguousData\n : RType,\n Events extends Minipass.Events = Minipass.Events\n >\n extends EventEmitter\n implements Minipass.DualIterable\n{\n [FLOWING]: boolean = false;\n [PAUSED]: boolean = false;\n [PIPES]: Pipe[] = [];\n [BUFFER]: RType[] = [];\n [OBJECTMODE]: boolean;\n [ENCODING]: BufferEncoding | null;\n [ASYNC]: boolean;\n [DECODER]: SD | null;\n [EOF]: boolean = false;\n [EMITTED_END]: boolean = false;\n [EMITTING_END]: boolean = false;\n [CLOSED]: boolean = false;\n [EMITTED_ERROR]: unknown = null;\n [BUFFERLENGTH]: number = 0;\n [DESTROYED]: boolean = false;\n [SIGNAL]?: AbortSignal;\n [ABORTED]: boolean = false;\n [DATALISTENERS]: number = 0;\n [DISCARDED]: boolean = false\n\n /**\n * true if the stream can be written\n */\n writable: boolean = true\n /**\n * true if the stream can be read\n */\n readable: boolean = true\n\n /**\n * If `RType` is Buffer, then options do not need to be provided.\n * Otherwise, an options object must be provided to specify either\n * {@link Minipass.SharedOptions.objectMode} or\n * {@link Minipass.SharedOptions.encoding}, as appropriate.\n */\n constructor(\n ...args:\n | [Minipass.ObjectModeOptions]\n | (RType extends Buffer\n ? [] | [Minipass.Options]\n : [Minipass.Options])\n ) {\n const options: Minipass.Options = (args[0] ||\n {}) as Minipass.Options\n super()\n if (options.objectMode && typeof options.encoding === 'string') {\n throw new TypeError(\n 'Encoding and objectMode may not be used together'\n )\n }\n if (isObjectModeOptions(options)) {\n this[OBJECTMODE] = true\n this[ENCODING] = null\n } else if (isEncodingOptions(options)) {\n this[ENCODING] = options.encoding\n this[OBJECTMODE] = false\n } else {\n this[OBJECTMODE] = false\n this[ENCODING] = null\n }\n this[ASYNC] = !!options.async\n this[DECODER] = this[ENCODING]\n ? (new StringDecoder(this[ENCODING]) as SD)\n : null\n\n //@ts-ignore - private option for debugging and testing\n if (options && options.debugExposeBuffer === true) {\n Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n }\n //@ts-ignore - private option for debugging and testing\n if (options && options.debugExposePipes === true) {\n Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n }\n\n const { signal } = options\n if (signal) {\n this[SIGNAL] = signal\n if (signal.aborted) {\n this[ABORT]()\n } else {\n signal.addEventListener('abort', () => this[ABORT]())\n }\n }\n }\n\n /**\n * The amount of data stored in the buffer waiting to be read.\n *\n * For Buffer strings, this will be the total byte length.\n * For string encoding streams, this will be the string character length,\n * according to JavaScript's `string.length` logic.\n * For objectMode streams, this is a count of the items waiting to be\n * emitted.\n */\n get bufferLength() {\n return this[BUFFERLENGTH]\n }\n\n /**\n * The `BufferEncoding` currently in use, or `null`\n */\n get encoding() {\n return this[ENCODING]\n }\n\n /**\n * @deprecated - This is a read only property\n */\n set encoding(_enc) {\n throw new Error('Encoding must be set at instantiation time')\n }\n\n /**\n * @deprecated - Encoding may only be set at instantiation time\n */\n setEncoding(_enc: Minipass.Encoding) {\n throw new Error('Encoding must be set at instantiation time')\n }\n\n /**\n * True if this is an objectMode stream\n */\n get objectMode() {\n return this[OBJECTMODE]\n }\n\n /**\n * @deprecated - This is a read-only property\n */\n set objectMode(_om) {\n throw new Error('objectMode must be set at instantiation time')\n }\n\n /**\n * true if this is an async stream\n */\n get ['async'](): boolean {\n return this[ASYNC]\n }\n /**\n * Set to true to make this stream async.\n *\n * Once set, it cannot be unset, as this would potentially cause incorrect\n * behavior. Ie, a sync stream can be made async, but an async stream\n * cannot be safely made sync.\n */\n set ['async'](a: boolean) {\n this[ASYNC] = this[ASYNC] || !!a\n }\n\n // drop everything and get out of the flow completely\n [ABORT]() {\n this[ABORTED] = true\n this.emit('abort', this[SIGNAL]?.reason)\n this.destroy(this[SIGNAL]?.reason)\n }\n\n /**\n * True if the stream has been aborted.\n */\n get aborted() {\n return this[ABORTED]\n }\n /**\n * No-op setter. Stream aborted status is set via the AbortSignal provided\n * in the constructor options.\n */\n set aborted(_) {}\n\n /**\n * Write data into the stream\n *\n * If the chunk written is a string, and encoding is not specified, then\n * `utf8` will be assumed. If the stream encoding matches the encoding of\n * a written string, and the state of the string decoder allows it, then\n * the string will be passed through to either the output or the internal\n * buffer without any processing. Otherwise, it will be turned into a\n * Buffer object for processing into the desired encoding.\n *\n * If provided, `cb` function is called immediately before return for\n * sync streams, or on next tick for async streams, because for this\n * base class, a chunk is considered \"processed\" once it is accepted\n * and either emitted or buffered. That is, the callback does not indicate\n * that the chunk has been eventually emitted, though of course child\n * classes can override this function to do whatever processing is required\n * and call `super.write(...)` only once processing is completed.\n */\n write(chunk: WType, cb?: () => void): boolean\n write(\n chunk: WType,\n encoding?: Minipass.Encoding,\n cb?: () => void\n ): boolean\n write(\n chunk: WType,\n encoding?: Minipass.Encoding | (() => void),\n cb?: () => void\n ): boolean {\n if (this[ABORTED]) return false\n if (this[EOF]) throw new Error('write after end')\n\n if (this[DESTROYED]) {\n this.emit(\n 'error',\n Object.assign(\n new Error('Cannot call write after a stream was destroyed'),\n { code: 'ERR_STREAM_DESTROYED' }\n )\n )\n return true\n }\n\n if (typeof encoding === 'function') {\n cb = encoding\n encoding = 'utf8'\n }\n\n if (!encoding) encoding = 'utf8'\n\n const fn = this[ASYNC] ? defer : nodefer\n\n // convert array buffers and typed array views into buffers\n // at some point in the future, we may want to do the opposite!\n // leave strings and buffers as-is\n // anything is only allowed if in object mode, so throw\n if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n if (isArrayBufferView(chunk)) {\n //@ts-ignore - sinful unsafe type changing\n chunk = Buffer.from(\n chunk.buffer,\n chunk.byteOffset,\n chunk.byteLength\n )\n } else if (isArrayBufferLike(chunk)) {\n //@ts-ignore - sinful unsafe type changing\n chunk = Buffer.from(chunk)\n } else if (typeof chunk !== 'string') {\n throw new Error(\n 'Non-contiguous data written to non-objectMode stream'\n )\n }\n }\n\n // handle object mode up front, since it's simpler\n // this yields better performance, fewer checks later.\n if (this[OBJECTMODE]) {\n // maybe impossible?\n /* c8 ignore start */\n if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n /* c8 ignore stop */\n\n if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n else this[BUFFERPUSH](chunk as unknown as RType)\n\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n if (cb) fn(cb)\n\n return this[FLOWING]\n }\n\n // at this point the chunk is a buffer or string\n // don't buffer it up or send it to the decoder\n if (!(chunk as Minipass.BufferOrString).length) {\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n if (cb) fn(cb)\n return this[FLOWING]\n }\n\n // fast-path writing strings of same encoding to a stream with\n // an empty buffer, skipping the buffer/decoder dance\n if (\n typeof chunk === 'string' &&\n // unless it is a string already ready for us to use\n !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)\n ) {\n //@ts-ignore - sinful unsafe type change\n chunk = Buffer.from(chunk, encoding)\n }\n\n if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n //@ts-ignore - sinful unsafe type change\n chunk = this[DECODER].write(chunk)\n }\n\n // Note: flushing CAN potentially switch us into not-flowing mode\n if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n else this[BUFFERPUSH](chunk as unknown as RType)\n\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n if (cb) fn(cb)\n\n return this[FLOWING]\n }\n\n /**\n * Low-level explicit read method.\n *\n * In objectMode, the argument is ignored, and one item is returned if\n * available.\n *\n * `n` is the number of bytes (or in the case of encoding streams,\n * characters) to consume. If `n` is not provided, then the entire buffer\n * is returned, or `null` is returned if no data is available.\n *\n * If `n` is greater that the amount of data in the internal buffer,\n * then `null` is returned.\n */\n read(n?: number | null): RType | null {\n if (this[DESTROYED]) return null\n this[DISCARDED] = false\n\n if (\n this[BUFFERLENGTH] === 0 ||\n n === 0 ||\n (n && n > this[BUFFERLENGTH])\n ) {\n this[MAYBE_EMIT_END]()\n return null\n }\n\n if (this[OBJECTMODE]) n = null\n\n if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n // not object mode, so if we have an encoding, then RType is string\n // otherwise, must be Buffer\n this[BUFFER] = [\n (this[ENCODING]\n ? this[BUFFER].join('')\n : Buffer.concat(\n this[BUFFER] as Buffer[],\n this[BUFFERLENGTH]\n )) as RType,\n ]\n }\n\n const ret = this[READ](n || null, this[BUFFER][0] as RType)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [READ](n: number | null, chunk: RType) {\n if (this[OBJECTMODE]) this[BUFFERSHIFT]()\n else {\n const c = chunk as Minipass.BufferOrString\n if (n === c.length || n === null) this[BUFFERSHIFT]()\n else if (typeof c === 'string') {\n this[BUFFER][0] = c.slice(n) as RType\n chunk = c.slice(0, n) as RType\n this[BUFFERLENGTH] -= n\n } else {\n this[BUFFER][0] = c.subarray(n) as RType\n chunk = c.subarray(0, n) as RType\n this[BUFFERLENGTH] -= n\n }\n }\n\n this.emit('data', chunk)\n\n if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n return chunk\n }\n\n /**\n * End the stream, optionally providing a final write.\n *\n * See {@link Minipass#write} for argument descriptions\n */\n end(cb?: () => void): this\n end(chunk: WType, cb?: () => void): this\n end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this\n end(\n chunk?: WType | (() => void),\n encoding?: Minipass.Encoding | (() => void),\n cb?: () => void\n ): this {\n if (typeof chunk === 'function') {\n cb = chunk as () => void\n chunk = undefined\n }\n if (typeof encoding === 'function') {\n cb = encoding\n encoding = 'utf8'\n }\n if (chunk !== undefined) this.write(chunk, encoding)\n if (cb) this.once('end', cb)\n this[EOF] = true\n this.writable = false\n\n // if we haven't written anything, then go ahead and emit,\n // even if we're not reading.\n // we'll re-emit if a new 'end' listener is added anyway.\n // This makes MP more suitable to write-only use cases.\n if (this[FLOWING] || !this[PAUSED]) this[MAYBE_EMIT_END]()\n return this\n }\n\n // don't let the internal resume be overwritten\n [RESUME]() {\n if (this[DESTROYED]) return\n\n if (!this[DATALISTENERS] && !this[PIPES].length) {\n this[DISCARDED] = true\n }\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this[BUFFER].length) this[FLUSH]()\n else if (this[EOF]) this[MAYBE_EMIT_END]()\n else this.emit('drain')\n }\n\n /**\n * Resume the stream if it is currently in a paused state\n *\n * If called when there are no pipe destinations or `data` event listeners,\n * this will place the stream in a \"discarded\" state, where all data will\n * be thrown away. The discarded state is removed if a pipe destination or\n * data handler is added, if pause() is called, or if any synchronous or\n * asynchronous iteration is started.\n */\n resume() {\n return this[RESUME]()\n }\n\n /**\n * Pause the stream\n */\n pause() {\n this[FLOWING] = false\n this[PAUSED] = true\n this[DISCARDED] = false\n }\n\n /**\n * true if the stream has been forcibly destroyed\n */\n get destroyed() {\n return this[DESTROYED]\n }\n\n /**\n * true if the stream is currently in a flowing state, meaning that\n * any writes will be immediately emitted.\n */\n get flowing() {\n return this[FLOWING]\n }\n\n /**\n * true if the stream is currently in a paused state\n */\n get paused() {\n return this[PAUSED]\n }\n\n [BUFFERPUSH](chunk: RType) {\n if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n else this[BUFFERLENGTH] += (chunk as Minipass.BufferOrString).length\n this[BUFFER].push(chunk)\n }\n\n [BUFFERSHIFT](): RType {\n if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n else\n this[BUFFERLENGTH] -= (\n this[BUFFER][0] as Minipass.BufferOrString\n ).length\n return this[BUFFER].shift() as RType\n }\n\n [FLUSH](noDrain: boolean = false) {\n do {} while (\n this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n this[BUFFER].length\n )\n\n if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n }\n\n [FLUSHCHUNK](chunk: RType) {\n this.emit('data', chunk)\n return this[FLOWING]\n }\n\n /**\n * Pipe all data emitted by this stream into the destination provided.\n *\n * Triggers the flow of data.\n */\n pipe(dest: W, opts?: PipeOptions): W {\n if (this[DESTROYED]) return dest\n this[DISCARDED] = false\n\n const ended = this[EMITTED_END]\n opts = opts || {}\n if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n else opts.end = opts.end !== false\n opts.proxyErrors = !!opts.proxyErrors\n\n // piping an ended stream ends immediately\n if (ended) {\n if (opts.end) dest.end()\n } else {\n // \"as\" here just ignores the WType, which pipes don't care about,\n // since they're only consuming from us, and writing to the dest\n this[PIPES].push(\n !opts.proxyErrors\n ? new Pipe(this as Minipass, dest, opts)\n : new PipeProxyErrors(this as Minipass, dest, opts)\n )\n if (this[ASYNC]) defer(() => this[RESUME]())\n else this[RESUME]()\n }\n\n return dest\n }\n\n /**\n * Fully unhook a piped destination stream.\n *\n * If the destination stream was the only consumer of this stream (ie,\n * there are no other piped destinations or `'data'` event listeners)\n * then the flow of data will stop until there is another consumer or\n * {@link Minipass#resume} is explicitly called.\n */\n unpipe(dest: W) {\n const p = this[PIPES].find(p => p.dest === dest)\n if (p) {\n if (this[PIPES].length === 1) {\n if (this[FLOWING] && this[DATALISTENERS] === 0) {\n this[FLOWING] = false\n }\n this[PIPES] = []\n } else this[PIPES].splice(this[PIPES].indexOf(p), 1)\n p.unpipe()\n }\n }\n\n /**\n * Alias for {@link Minipass#on}\n */\n addListener(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ): this {\n return this.on(ev, handler)\n }\n\n /**\n * Mostly identical to `EventEmitter.on`, with the following\n * behavior differences to prevent data loss and unnecessary hangs:\n *\n * - Adding a 'data' event handler will trigger the flow of data\n *\n * - Adding a 'readable' event handler when there is data waiting to be read\n * will cause 'readable' to be emitted immediately.\n *\n * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n * already passed will cause the event to be emitted immediately and all\n * handlers removed.\n *\n * - Adding an 'error' event handler after an error has been emitted will\n * cause the event to be re-emitted immediately with the error previously\n * raised.\n */\n on(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ): this {\n const ret = super.on(\n ev as string | symbol,\n handler as (...a: any[]) => any\n )\n if (ev === 'data') {\n this[DISCARDED] = false\n this[DATALISTENERS]++\n if (!this[PIPES].length && !this[FLOWING]) {\n this[RESUME]()\n }\n } else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n super.emit('readable')\n } else if (isEndish(ev) && this[EMITTED_END]) {\n super.emit(ev)\n this.removeAllListeners(ev)\n } else if (ev === 'error' && this[EMITTED_ERROR]) {\n const h = handler as (...a: Events['error']) => any\n if (this[ASYNC]) defer(() => h.call(this, this[EMITTED_ERROR]))\n else h.call(this, this[EMITTED_ERROR])\n }\n return ret\n }\n\n /**\n * Alias for {@link Minipass#off}\n */\n removeListener(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ) {\n return this.off(ev, handler)\n }\n\n /**\n * Mostly identical to `EventEmitter.off`\n *\n * If a 'data' event handler is removed, and it was the last consumer\n * (ie, there are no pipe destinations or other 'data' event listeners),\n * then the flow of data will stop until there is another consumer or\n * {@link Minipass#resume} is explicitly called.\n */\n off(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ) {\n const ret = super.off(\n ev as string | symbol,\n handler as (...a: any[]) => any\n )\n // if we previously had listeners, and now we don't, and we don't\n // have any pipes, then stop the flow, unless it's been explicitly\n // put in a discarded flowing state via stream.resume().\n if (ev === 'data') {\n this[DATALISTENERS] = this.listeners('data').length\n if (\n this[DATALISTENERS] === 0 &&\n !this[DISCARDED] &&\n !this[PIPES].length\n ) {\n this[FLOWING] = false\n }\n }\n return ret\n }\n\n /**\n * Mostly identical to `EventEmitter.removeAllListeners`\n *\n * If all 'data' event handlers are removed, and they were the last consumer\n * (ie, there are no pipe destinations), then the flow of data will stop\n * until there is another consumer or {@link Minipass#resume} is explicitly\n * called.\n */\n removeAllListeners(ev?: Event) {\n const ret = super.removeAllListeners(ev as string | symbol | undefined)\n if (ev === 'data' || ev === undefined) {\n this[DATALISTENERS] = 0\n if (!this[DISCARDED] && !this[PIPES].length) {\n this[FLOWING] = false\n }\n }\n return ret\n }\n\n /**\n * true if the 'end' event has been emitted\n */\n get emittedEnd() {\n return this[EMITTED_END]\n }\n\n [MAYBE_EMIT_END]() {\n if (\n !this[EMITTING_END] &&\n !this[EMITTED_END] &&\n !this[DESTROYED] &&\n this[BUFFER].length === 0 &&\n this[EOF]\n ) {\n this[EMITTING_END] = true\n this.emit('end')\n this.emit('prefinish')\n this.emit('finish')\n if (this[CLOSED]) this.emit('close')\n this[EMITTING_END] = false\n }\n }\n\n /**\n * Mostly identical to `EventEmitter.emit`, with the following\n * behavior differences to prevent data loss and unnecessary hangs:\n *\n * If the stream has been destroyed, and the event is something other\n * than 'close' or 'error', then `false` is returned and no handlers\n * are called.\n *\n * If the event is 'end', and has already been emitted, then the event\n * is ignored. If the stream is in a paused or non-flowing state, then\n * the event will be deferred until data flow resumes. If the stream is\n * async, then handlers will be called on the next tick rather than\n * immediately.\n *\n * If the event is 'close', and 'end' has not yet been emitted, then\n * the event will be deferred until after 'end' is emitted.\n *\n * If the event is 'error', and an AbortSignal was provided for the stream,\n * and there are no listeners, then the event is ignored, matching the\n * behavior of node core streams in the presense of an AbortSignal.\n *\n * If the event is 'finish' or 'prefinish', then all listeners will be\n * removed after emitting the event, to prevent double-firing.\n */\n emit(\n ev: Event,\n ...args: Events[Event]\n ): boolean {\n const data = args[0]\n // error and close are only events allowed after calling destroy()\n if (\n ev !== 'error' &&\n ev !== 'close' &&\n ev !== DESTROYED &&\n this[DESTROYED]\n ) {\n return false\n } else if (ev === 'data') {\n return !this[OBJECTMODE] && !data\n ? false\n : this[ASYNC]\n ? (defer(() => this[EMITDATA](data as RType)), true)\n : this[EMITDATA](data as RType)\n } else if (ev === 'end') {\n return this[EMITEND]()\n } else if (ev === 'close') {\n this[CLOSED] = true\n // don't emit close before 'end' and 'finish'\n if (!this[EMITTED_END] && !this[DESTROYED]) return false\n const ret = super.emit('close')\n this.removeAllListeners('close')\n return ret\n } else if (ev === 'error') {\n this[EMITTED_ERROR] = data\n super.emit(ERROR, data)\n const ret =\n !this[SIGNAL] || this.listeners('error').length\n ? super.emit('error', data)\n : false\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'resume') {\n const ret = super.emit('resume')\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'finish' || ev === 'prefinish') {\n const ret = super.emit(ev)\n this.removeAllListeners(ev)\n return ret\n }\n\n // Some other unknown event\n const ret = super.emit(ev as string, ...args)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITDATA](data: RType) {\n for (const p of this[PIPES]) {\n if (p.dest.write(data as RType) === false) this.pause()\n }\n const ret = this[DISCARDED] ? false : super.emit('data', data)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITEND]() {\n if (this[EMITTED_END]) return false\n\n this[EMITTED_END] = true\n this.readable = false\n return this[ASYNC]\n ? (defer(() => this[EMITEND2]()), true)\n : this[EMITEND2]()\n }\n\n [EMITEND2]() {\n if (this[DECODER]) {\n const data = this[DECODER].end()\n if (data) {\n for (const p of this[PIPES]) {\n p.dest.write(data as RType)\n }\n if (!this[DISCARDED]) super.emit('data', data)\n }\n }\n\n for (const p of this[PIPES]) {\n p.end()\n }\n const ret = super.emit('end')\n this.removeAllListeners('end')\n return ret\n }\n\n /**\n * Return a Promise that resolves to an array of all emitted data once\n * the stream ends.\n */\n async collect(): Promise {\n const buf: RType[] & { dataLength: number } = Object.assign([], {\n dataLength: 0,\n })\n if (!this[OBJECTMODE]) buf.dataLength = 0\n // set the promise first, in case an error is raised\n // by triggering the flow here.\n const p = this.promise()\n this.on('data', c => {\n buf.push(c)\n if (!this[OBJECTMODE])\n buf.dataLength += (c as Minipass.BufferOrString).length\n })\n await p\n return buf\n }\n\n /**\n * Return a Promise that resolves to the concatenation of all emitted data\n * once the stream ends.\n *\n * Not allowed on objectMode streams.\n */\n async concat(): Promise {\n if (this[OBJECTMODE]) {\n throw new Error('cannot concat in objectMode')\n }\n const buf = await this.collect()\n return (\n this[ENCODING]\n ? buf.join('')\n : Buffer.concat(buf as Buffer[], buf.dataLength)\n ) as RType\n }\n\n /**\n * Return a void Promise that resolves once the stream ends.\n */\n async promise(): Promise {\n return new Promise((resolve, reject) => {\n this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n this.on('error', er => reject(er))\n this.on('end', () => resolve())\n })\n }\n\n /**\n * Asynchronous `for await of` iteration.\n *\n * This will continue emitting all chunks until the stream terminates.\n */\n [Symbol.asyncIterator](): AsyncGenerator {\n // set this up front, in case the consumer doesn't call next()\n // right away.\n this[DISCARDED] = false\n let stopped = false\n const stop = async (): Promise> => {\n this.pause()\n stopped = true\n return { value: undefined, done: true }\n }\n const next = (): Promise> => {\n if (stopped) return stop()\n const res = this.read()\n if (res !== null) return Promise.resolve({ done: false, value: res })\n\n if (this[EOF]) return stop()\n\n let resolve!: (res: IteratorResult) => void\n let reject!: (er: unknown) => void\n const onerr = (er: unknown) => {\n this.off('data', ondata)\n this.off('end', onend)\n this.off(DESTROYED, ondestroy)\n stop()\n reject(er)\n }\n const ondata = (value: RType) => {\n this.off('error', onerr)\n this.off('end', onend)\n this.off(DESTROYED, ondestroy)\n this.pause()\n resolve({ value, done: !!this[EOF] })\n }\n const onend = () => {\n this.off('error', onerr)\n this.off('data', ondata)\n this.off(DESTROYED, ondestroy)\n stop()\n resolve({ done: true, value: undefined })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise>((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return {\n next,\n throw: stop,\n return: stop,\n [Symbol.asyncIterator]() {\n return this\n },\n }\n }\n\n /**\n * Synchronous `for of` iteration.\n *\n * The iteration will terminate when the internal buffer runs out, even\n * if the stream has not yet terminated.\n */\n [Symbol.iterator](): Generator {\n // set this up front, in case the consumer doesn't call next()\n // right away.\n this[DISCARDED] = false\n let stopped = false\n const stop = (): IteratorReturnResult => {\n this.pause()\n this.off(ERROR, stop)\n this.off(DESTROYED, stop)\n this.off('end', stop)\n stopped = true\n return { done: true, value: undefined }\n }\n\n const next = (): IteratorResult => {\n if (stopped) return stop()\n const value = this.read()\n return value === null ? stop() : { done: false, value }\n }\n\n this.once('end', stop)\n this.once(ERROR, stop)\n this.once(DESTROYED, stop)\n\n return {\n next,\n throw: stop,\n return: stop,\n [Symbol.iterator]() {\n return this\n },\n }\n }\n\n /**\n * Destroy a stream, preventing it from being used for any further purpose.\n *\n * If the stream has a `close()` method, then it will be called on\n * destruction.\n *\n * After destruction, any attempt to write data, read data, or emit most\n * events will be ignored.\n *\n * If an error argument is provided, then it will be emitted in an\n * 'error' event.\n */\n destroy(er?: unknown) {\n if (this[DESTROYED]) {\n if (er) this.emit('error', er)\n else this.emit(DESTROYED)\n return this\n }\n\n this[DESTROYED] = true\n this[DISCARDED] = true\n\n // throw away all buffered data, it's never coming out\n this[BUFFER].length = 0\n this[BUFFERLENGTH] = 0\n\n const wc = this as Minipass & {\n close?: () => void\n }\n if (typeof wc.close === 'function' && !this[CLOSED]) wc.close()\n\n if (er) this.emit('error', er)\n // if no error to emit, still reject pending promises\n else this.emit(DESTROYED)\n\n return this\n }\n\n /**\n * Alias for {@link isStream}\n *\n * Former export location, maintained for backwards compatibility.\n *\n * @deprecated\n */\n static get isStream() {\n return isStream\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/minipass/dist/commonjs/package.json b/node_modules/minipass/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/minipass/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/minipass/dist/esm/index.d.ts b/node_modules/minipass/dist/esm/index.d.ts new file mode 100644 index 0000000..6dbfbcf --- /dev/null +++ b/node_modules/minipass/dist/esm/index.d.ts @@ -0,0 +1,549 @@ +/// +/// +/// +/// +import { EventEmitter } from 'node:events'; +import { StringDecoder } from 'node:string_decoder'; +/** + * Same as StringDecoder, but exposing the `lastNeed` flag on the type + */ +type SD = StringDecoder & { + lastNeed: boolean; +}; +export type { SD, Pipe, PipeProxyErrors }; +/** + * Return true if the argument is a Minipass stream, Node stream, or something + * else that Minipass can interact with. + */ +export declare const isStream: (s: any) => s is NodeJS.WriteStream | NodeJS.ReadStream | Minipass | (NodeJS.ReadStream & { + fd: number; +}) | (EventEmitter & { + pause(): any; + resume(): any; + pipe(...destArgs: any[]): any; +}) | (NodeJS.WriteStream & { + fd: number; +}) | (EventEmitter & { + end(): any; + write(chunk: any, ...args: any[]): any; +}); +/** + * Return true if the argument is a valid {@link Minipass.Readable} + */ +export declare const isReadable: (s: any) => s is Minipass.Readable; +/** + * Return true if the argument is a valid {@link Minipass.Writable} + */ +export declare const isWritable: (s: any) => s is Minipass.Readable; +declare const EOF: unique symbol; +declare const MAYBE_EMIT_END: unique symbol; +declare const EMITTED_END: unique symbol; +declare const EMITTING_END: unique symbol; +declare const EMITTED_ERROR: unique symbol; +declare const CLOSED: unique symbol; +declare const READ: unique symbol; +declare const FLUSH: unique symbol; +declare const FLUSHCHUNK: unique symbol; +declare const ENCODING: unique symbol; +declare const DECODER: unique symbol; +declare const FLOWING: unique symbol; +declare const PAUSED: unique symbol; +declare const RESUME: unique symbol; +declare const BUFFER: unique symbol; +declare const PIPES: unique symbol; +declare const BUFFERLENGTH: unique symbol; +declare const BUFFERPUSH: unique symbol; +declare const BUFFERSHIFT: unique symbol; +declare const OBJECTMODE: unique symbol; +declare const DESTROYED: unique symbol; +declare const ERROR: unique symbol; +declare const EMITDATA: unique symbol; +declare const EMITEND: unique symbol; +declare const EMITEND2: unique symbol; +declare const ASYNC: unique symbol; +declare const ABORT: unique symbol; +declare const ABORTED: unique symbol; +declare const SIGNAL: unique symbol; +declare const DATALISTENERS: unique symbol; +declare const DISCARDED: unique symbol; +/** + * Options that may be passed to stream.pipe() + */ +export interface PipeOptions { + /** + * end the destination stream when the source stream ends + */ + end?: boolean; + /** + * proxy errors from the source stream to the destination stream + */ + proxyErrors?: boolean; +} +/** + * Internal class representing a pipe to a destination stream. + * + * @internal + */ +declare class Pipe { + src: Minipass; + dest: Minipass; + opts: PipeOptions; + ondrain: () => any; + constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions); + unpipe(): void; + proxyErrors(_er: any): void; + end(): void; +} +/** + * Internal class representing a pipe to a destination stream where + * errors are proxied. + * + * @internal + */ +declare class PipeProxyErrors extends Pipe { + unpipe(): void; + constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions); +} +export declare namespace Minipass { + /** + * Encoding used to create a stream that outputs strings rather than + * Buffer objects. + */ + export type Encoding = BufferEncoding | 'buffer' | null; + /** + * Any stream that Minipass can pipe into + */ + export type Writable = Minipass | NodeJS.WriteStream | (NodeJS.WriteStream & { + fd: number; + }) | (EventEmitter & { + end(): any; + write(chunk: any, ...args: any[]): any; + }); + /** + * Any stream that can be read from + */ + export type Readable = Minipass | NodeJS.ReadStream | (NodeJS.ReadStream & { + fd: number; + }) | (EventEmitter & { + pause(): any; + resume(): any; + pipe(...destArgs: any[]): any; + }); + /** + * Utility type that can be iterated sync or async + */ + export type DualIterable = Iterable & AsyncIterable; + type EventArguments = Record; + /** + * The listing of events that a Minipass class can emit. + * Extend this when extending the Minipass class, and pass as + * the third template argument. The key is the name of the event, + * and the value is the argument list. + * + * Any undeclared events will still be allowed, but the handler will get + * arguments as `unknown[]`. + */ + export interface Events extends EventArguments { + readable: []; + data: [chunk: RType]; + error: [er: unknown]; + abort: [reason: unknown]; + drain: []; + resume: []; + end: []; + finish: []; + prefinish: []; + close: []; + [DESTROYED]: [er?: unknown]; + [ERROR]: [er: unknown]; + } + /** + * String or buffer-like data that can be joined and sliced + */ + export type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string; + export type BufferOrString = Buffer | string; + /** + * Options passed to the Minipass constructor. + */ + export type SharedOptions = { + /** + * Defer all data emission and other events until the end of the + * current tick, similar to Node core streams + */ + async?: boolean; + /** + * A signal which will abort the stream + */ + signal?: AbortSignal; + /** + * Output string encoding. Set to `null` or `'buffer'` (or omit) to + * emit Buffer objects rather than strings. + * + * Conflicts with `objectMode` + */ + encoding?: BufferEncoding | null | 'buffer'; + /** + * Output data exactly as it was written, supporting non-buffer/string + * data (such as arbitrary objects, falsey values, etc.) + * + * Conflicts with `encoding` + */ + objectMode?: boolean; + }; + /** + * Options for a string encoded output + */ + export type EncodingOptions = SharedOptions & { + encoding: BufferEncoding; + objectMode?: false; + }; + /** + * Options for contiguous data buffer output + */ + export type BufferOptions = SharedOptions & { + encoding?: null | 'buffer'; + objectMode?: false; + }; + /** + * Options for objectMode arbitrary output + */ + export type ObjectModeOptions = SharedOptions & { + objectMode: true; + encoding?: null; + }; + /** + * Utility type to determine allowed options based on read type + */ + export type Options = ObjectModeOptions | (T extends string ? EncodingOptions : T extends Buffer ? BufferOptions : SharedOptions); + export {}; +} +/** + * 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} + */ +export declare class Minipass = Minipass.Events> extends EventEmitter implements Minipass.DualIterable { + [FLOWING]: boolean; + [PAUSED]: boolean; + [PIPES]: Pipe[]; + [BUFFER]: RType[]; + [OBJECTMODE]: boolean; + [ENCODING]: BufferEncoding | null; + [ASYNC]: boolean; + [DECODER]: SD | null; + [EOF]: boolean; + [EMITTED_END]: boolean; + [EMITTING_END]: boolean; + [CLOSED]: boolean; + [EMITTED_ERROR]: unknown; + [BUFFERLENGTH]: number; + [DESTROYED]: boolean; + [SIGNAL]?: AbortSignal; + [ABORTED]: boolean; + [DATALISTENERS]: number; + [DISCARDED]: boolean; + /** + * true if the stream can be written + */ + writable: boolean; + /** + * true if the stream can be read + */ + readable: boolean; + /** + * 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: [Minipass.ObjectModeOptions] | (RType extends Buffer ? [] | [Minipass.Options] : [Minipass.Options])); + /** + * 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(): number; + /** + * The `BufferEncoding` currently in use, or `null` + */ + get encoding(): BufferEncoding | null; + /** + * @deprecated - This is a read only property + */ + set encoding(_enc: BufferEncoding | null); + /** + * @deprecated - Encoding may only be set at instantiation time + */ + setEncoding(_enc: Minipass.Encoding): void; + /** + * True if this is an objectMode stream + */ + get objectMode(): boolean; + /** + * @deprecated - This is a read-only property + */ + set objectMode(_om: boolean); + /** + * true if this is an async stream + */ + get ['async'](): boolean; + /** + * 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: boolean); + [ABORT](): void; + /** + * True if the stream has been aborted. + */ + get aborted(): boolean; + /** + * No-op setter. Stream aborted status is set via the AbortSignal provided + * in the constructor options. + */ + set aborted(_: boolean); + /** + * Write data into the stream + * + * If the chunk written is a string, and encoding is not specified, then + * `utf8` will be assumed. If the stream encoding matches the encoding of + * a written string, and the state of the string decoder allows it, then + * the string will be passed through to either the output or the internal + * buffer without any processing. Otherwise, it will be turned into a + * Buffer object for processing into the desired encoding. + * + * If provided, `cb` function is called immediately before return for + * sync streams, or on next tick for async streams, because for this + * base class, a chunk is considered "processed" once it is accepted + * and either emitted or buffered. That is, the callback does not indicate + * that the chunk has been eventually emitted, though of course child + * classes can override this function to do whatever processing is required + * and call `super.write(...)` only once processing is completed. + */ + write(chunk: WType, cb?: () => void): boolean; + write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean; + /** + * 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?: number | null): RType | null; + [READ](n: number | null, chunk: RType): RType; + /** + * End the stream, optionally providing a final write. + * + * See {@link Minipass#write} for argument descriptions + */ + end(cb?: () => void): this; + end(chunk: WType, cb?: () => void): this; + end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this; + [RESUME](): void; + /** + * 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(): void; + /** + * Pause the stream + */ + pause(): void; + /** + * true if the stream has been forcibly destroyed + */ + get destroyed(): boolean; + /** + * true if the stream is currently in a flowing state, meaning that + * any writes will be immediately emitted. + */ + get flowing(): boolean; + /** + * true if the stream is currently in a paused state + */ + get paused(): boolean; + [BUFFERPUSH](chunk: RType): void; + [BUFFERSHIFT](): RType; + [FLUSH](noDrain?: boolean): void; + [FLUSHCHUNK](chunk: RType): boolean; + /** + * Pipe all data emitted by this stream into the destination provided. + * + * Triggers the flow of data. + */ + pipe(dest: W, opts?: PipeOptions): W; + /** + * 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: W): void; + /** + * Alias for {@link Minipass#on} + */ + addListener(ev: Event, handler: (...args: Events[Event]) => any): this; + /** + * 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: Event, handler: (...args: Events[Event]) => any): this; + /** + * Alias for {@link Minipass#off} + */ + removeListener(ev: Event, handler: (...args: Events[Event]) => any): this; + /** + * 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: Event, handler: (...args: Events[Event]) => any): this; + /** + * 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?: Event): this; + /** + * true if the 'end' event has been emitted + */ + get emittedEnd(): boolean; + [MAYBE_EMIT_END](): void; + /** + * 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: Event, ...args: Events[Event]): boolean; + [EMITDATA](data: RType): boolean; + [EMITEND](): boolean; + [EMITEND2](): boolean; + /** + * Return a Promise that resolves to an array of all emitted data once + * the stream ends. + */ + collect(): Promise; + /** + * Return a Promise that resolves to the concatenation of all emitted data + * once the stream ends. + * + * Not allowed on objectMode streams. + */ + concat(): Promise; + /** + * Return a void Promise that resolves once the stream ends. + */ + promise(): Promise; + /** + * Asynchronous `for await of` iteration. + * + * This will continue emitting all chunks until the stream terminates. + */ + [Symbol.asyncIterator](): AsyncGenerator; + /** + * Synchronous `for of` iteration. + * + * The iteration will terminate when the internal buffer runs out, even + * if the stream has not yet terminated. + */ + [Symbol.iterator](): Generator; + /** + * 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?: unknown): this; + /** + * Alias for {@link isStream} + * + * Former export location, maintained for backwards compatibility. + * + * @deprecated + */ + static get isStream(): (s: any) => s is NodeJS.WriteStream | NodeJS.ReadStream | Minipass | (NodeJS.ReadStream & { + fd: number; + }) | (EventEmitter & { + pause(): any; + resume(): any; + pipe(...destArgs: any[]): any; + }) | (NodeJS.WriteStream & { + fd: number; + }) | (EventEmitter & { + end(): any; + write(chunk: any, ...args: any[]): any; + }); +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/minipass/dist/esm/index.d.ts.map b/node_modules/minipass/dist/esm/index.d.ts.map new file mode 100644 index 0000000..cac7e00 --- /dev/null +++ b/node_modules/minipass/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;GAEG;AACH,KAAK,EAAE,GAAG,aAAa,GAAG;IAAE,QAAQ,EAAE,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KG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;IAkCjD;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,CAAC,EAAE,OAAO;IA0BpB;;;;;;OAMG;IACH,MAAM,KAAK,QAAQ;;;;;;;;;;;OAElB;CACF"} \ No newline at end of file diff --git a/node_modules/minipass/dist/esm/index.js b/node_modules/minipass/dist/esm/index.js new file mode 100644 index 0000000..b5fa451 --- /dev/null +++ b/node_modules/minipass/dist/esm/index.js @@ -0,0 +1,1018 @@ +const proc = typeof process === 'object' && process + ? process + : { + stdout: null, + stderr: null, + }; +import { EventEmitter } from 'node:events'; +import Stream from 'node:stream'; +import { StringDecoder } from 'node:string_decoder'; +/** + * Return true if the argument is a Minipass stream, Node stream, or something + * else that Minipass can interact with. + */ +export const isStream = (s) => !!s && + typeof s === 'object' && + (s instanceof Minipass || + s instanceof Stream || + isReadable(s) || + isWritable(s)); +/** + * Return true if the argument is a valid {@link Minipass.Readable} + */ +export const isReadable = (s) => !!s && + typeof s === 'object' && + s instanceof EventEmitter && + typeof s.pipe === 'function' && + // node core Writable streams have a pipe() method, but it throws + s.pipe !== Stream.Writable.prototype.pipe; +/** + * Return true if the argument is a valid {@link Minipass.Writable} + */ +export const isWritable = (s) => !!s && + typeof s === 'object' && + s instanceof 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} + */ +export class Minipass extends 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 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 \ No newline at end of file diff --git a/node_modules/minipass/dist/esm/index.js.map b/node_modules/minipass/dist/esm/index.js.map new file mode 100644 index 0000000..741425a --- /dev/null +++ b/node_modules/minipass/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO;IACpC,CAAC,CAAC,OAAO;IACT,CAAC,CAAC;QACE,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACb,CAAA;AACP,OAAO,E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MAAM,EAAE,IAAI;YACZ,CAAC,MAAM,CAAC,QAAQ,CAAC;gBACf,OAAO,IAAI,CAAA;YACb,CAAC;SACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAY;QAClB,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACpB,IAAI,EAAE;gBAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;;gBACzB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACzB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;QACtB,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;QAEtB,sDAAsD;QACtD,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;QACvB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,EAAE,GAAG,IAEV,CAAA;QACD,IAAI,OAAO,EAAE,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;YAAE,EAAE,CAAC,KAAK,EAAE,CAAA;QAE/D,IAAI,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAC9B,qDAAqD;;YAChD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAEzB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;OAMG;IACH,MAAM,KAAK,QAAQ;QACjB,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF","sourcesContent":["const proc =\n typeof process === 'object' && process\n ? process\n : {\n stdout: null,\n stderr: null,\n }\nimport { EventEmitter } from 'node:events'\nimport Stream from 'node:stream'\nimport { StringDecoder } from 'node:string_decoder'\n\n/**\n * Same as StringDecoder, but exposing the `lastNeed` flag on the type\n */\ntype SD = StringDecoder & { lastNeed: boolean }\n\nexport type { SD, Pipe, PipeProxyErrors }\n\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nexport const isStream = (\n s: any\n): s is Minipass.Readable | Minipass.Writable =>\n !!s &&\n typeof s === 'object' &&\n (s instanceof Minipass ||\n s instanceof Stream ||\n isReadable(s) ||\n isWritable(s))\n\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nexport const isReadable = (s: any): s is Minipass.Readable =>\n !!s &&\n typeof s === 'object' &&\n s instanceof EventEmitter &&\n typeof (s as Minipass.Readable).pipe === 'function' &&\n // node core Writable streams have a pipe() method, but it throws\n (s as Minipass.Readable).pipe !== Stream.Writable.prototype.pipe\n\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nexport const isWritable = (s: any): s is Minipass.Readable =>\n !!s &&\n typeof s === 'object' &&\n s instanceof EventEmitter &&\n typeof (s as Minipass.Writable).write === 'function' &&\n typeof (s as Minipass.Writable).end === 'function'\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\nconst DATALISTENERS = Symbol('dataListeners')\nconst DISCARDED = Symbol('discarded')\n\nconst defer = (fn: (...a: any[]) => any) => Promise.resolve().then(fn)\nconst nodefer = (fn: (...a: any[]) => any) => fn()\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\ntype EndishEvent = 'end' | 'finish' | 'prefinish'\nconst isEndish = (ev: any): ev is EndishEvent =>\n ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBufferLike = (b: any): b is ArrayBufferLike =>\n b instanceof ArrayBuffer ||\n (!!b &&\n typeof b === 'object' &&\n b.constructor &&\n b.constructor.name === 'ArrayBuffer' &&\n b.byteLength >= 0)\n\nconst isArrayBufferView = (b: any): b is ArrayBufferView =>\n !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\n/**\n * Options that may be passed to stream.pipe()\n */\nexport interface PipeOptions {\n /**\n * end the destination stream when the source stream ends\n */\n end?: boolean\n /**\n * proxy errors from the source stream to the destination stream\n */\n proxyErrors?: boolean\n}\n\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n src: Minipass\n dest: Minipass\n opts: PipeOptions\n ondrain: () => any\n constructor(\n src: Minipass,\n dest: Minipass.Writable,\n opts: PipeOptions\n ) {\n this.src = src\n this.dest = dest as Minipass\n this.opts = opts\n this.ondrain = () => src[RESUME]()\n this.dest.on('drain', this.ondrain)\n }\n unpipe() {\n this.dest.removeListener('drain', this.ondrain)\n }\n // only here for the prototype\n /* c8 ignore start */\n proxyErrors(_er: any) {}\n /* c8 ignore stop */\n end() {\n this.unpipe()\n if (this.opts.end) this.dest.end()\n }\n}\n\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n unpipe() {\n this.src.removeListener('error', this.proxyErrors)\n super.unpipe()\n }\n constructor(\n src: Minipass,\n dest: Minipass.Writable,\n opts: PipeOptions\n ) {\n super(src, dest, opts)\n this.proxyErrors = er => dest.emit('error', er)\n src.on('error', this.proxyErrors)\n }\n}\n\nexport namespace Minipass {\n /**\n * Encoding used to create a stream that outputs strings rather than\n * Buffer objects.\n */\n export type Encoding = BufferEncoding | 'buffer' | null\n\n /**\n * Any stream that Minipass can pipe into\n */\n export type Writable =\n | Minipass\n | NodeJS.WriteStream\n | (NodeJS.WriteStream & { fd: number })\n | (EventEmitter & {\n end(): any\n write(chunk: any, ...args: any[]): any\n })\n\n /**\n * Any stream that can be read from\n */\n export type Readable =\n | Minipass\n | NodeJS.ReadStream\n | (NodeJS.ReadStream & { fd: number })\n | (EventEmitter & {\n pause(): any\n resume(): any\n pipe(...destArgs: any[]): any\n })\n\n /**\n * Utility type that can be iterated sync or async\n */\n export type DualIterable = Iterable & AsyncIterable\n\n type EventArguments = Record\n\n /**\n * The listing of events that a Minipass class can emit.\n * Extend this when extending the Minipass class, and pass as\n * the third template argument. The key is the name of the event,\n * and the value is the argument list.\n *\n * Any undeclared events will still be allowed, but the handler will get\n * arguments as `unknown[]`.\n */\n export interface Events\n extends EventArguments {\n readable: []\n data: [chunk: RType]\n error: [er: unknown]\n abort: [reason: unknown]\n drain: []\n resume: []\n end: []\n finish: []\n prefinish: []\n close: []\n [DESTROYED]: [er?: unknown]\n [ERROR]: [er: unknown]\n }\n\n /**\n * String or buffer-like data that can be joined and sliced\n */\n export type ContiguousData =\n | Buffer\n | ArrayBufferLike\n | ArrayBufferView\n | string\n export type BufferOrString = Buffer | string\n\n /**\n * Options passed to the Minipass constructor.\n */\n export type SharedOptions = {\n /**\n * Defer all data emission and other events until the end of the\n * current tick, similar to Node core streams\n */\n async?: boolean\n /**\n * A signal which will abort the stream\n */\n signal?: AbortSignal\n /**\n * Output string encoding. Set to `null` or `'buffer'` (or omit) to\n * emit Buffer objects rather than strings.\n *\n * Conflicts with `objectMode`\n */\n encoding?: BufferEncoding | null | 'buffer'\n /**\n * Output data exactly as it was written, supporting non-buffer/string\n * data (such as arbitrary objects, falsey values, etc.)\n *\n * Conflicts with `encoding`\n */\n objectMode?: boolean\n }\n\n /**\n * Options for a string encoded output\n */\n export type EncodingOptions = SharedOptions & {\n encoding: BufferEncoding\n objectMode?: false\n }\n\n /**\n * Options for contiguous data buffer output\n */\n export type BufferOptions = SharedOptions & {\n encoding?: null | 'buffer'\n objectMode?: false\n }\n\n /**\n * Options for objectMode arbitrary output\n */\n export type ObjectModeOptions = SharedOptions & {\n objectMode: true\n encoding?: null\n }\n\n /**\n * Utility type to determine allowed options based on read type\n */\n export type Options =\n | ObjectModeOptions\n | (T extends string\n ? EncodingOptions\n : T extends Buffer\n ? BufferOptions\n : SharedOptions)\n}\n\nconst isObjectModeOptions = (\n o: Minipass.SharedOptions\n): o is Minipass.ObjectModeOptions => !!o.objectMode\n\nconst isEncodingOptions = (\n o: Minipass.SharedOptions\n): o is Minipass.EncodingOptions =>\n !o.objectMode && !!o.encoding && o.encoding !== 'buffer'\n\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nexport class Minipass<\n RType extends unknown = Buffer,\n WType extends unknown = RType extends Minipass.BufferOrString\n ? Minipass.ContiguousData\n : RType,\n Events extends Minipass.Events = Minipass.Events\n >\n extends EventEmitter\n implements Minipass.DualIterable\n{\n [FLOWING]: boolean = false;\n [PAUSED]: boolean = false;\n [PIPES]: Pipe[] = [];\n [BUFFER]: RType[] = [];\n [OBJECTMODE]: boolean;\n [ENCODING]: BufferEncoding | null;\n [ASYNC]: boolean;\n [DECODER]: SD | null;\n [EOF]: boolean = false;\n [EMITTED_END]: boolean = false;\n [EMITTING_END]: boolean = false;\n [CLOSED]: boolean = false;\n [EMITTED_ERROR]: unknown = null;\n [BUFFERLENGTH]: number = 0;\n [DESTROYED]: boolean = false;\n [SIGNAL]?: AbortSignal;\n [ABORTED]: boolean = false;\n [DATALISTENERS]: number = 0;\n [DISCARDED]: boolean = false\n\n /**\n * true if the stream can be written\n */\n writable: boolean = true\n /**\n * true if the stream can be read\n */\n readable: boolean = true\n\n /**\n * If `RType` is Buffer, then options do not need to be provided.\n * Otherwise, an options object must be provided to specify either\n * {@link Minipass.SharedOptions.objectMode} or\n * {@link Minipass.SharedOptions.encoding}, as appropriate.\n */\n constructor(\n ...args:\n | [Minipass.ObjectModeOptions]\n | (RType extends Buffer\n ? [] | [Minipass.Options]\n : [Minipass.Options])\n ) {\n const options: Minipass.Options = (args[0] ||\n {}) as Minipass.Options\n super()\n if (options.objectMode && typeof options.encoding === 'string') {\n throw new TypeError(\n 'Encoding and objectMode may not be used together'\n )\n }\n if (isObjectModeOptions(options)) {\n this[OBJECTMODE] = true\n this[ENCODING] = null\n } else if (isEncodingOptions(options)) {\n this[ENCODING] = options.encoding\n this[OBJECTMODE] = false\n } else {\n this[OBJECTMODE] = false\n this[ENCODING] = null\n }\n this[ASYNC] = !!options.async\n this[DECODER] = this[ENCODING]\n ? (new StringDecoder(this[ENCODING]) as SD)\n : null\n\n //@ts-ignore - private option for debugging and testing\n if (options && options.debugExposeBuffer === true) {\n Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n }\n //@ts-ignore - private option for debugging and testing\n if (options && options.debugExposePipes === true) {\n Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n }\n\n const { signal } = options\n if (signal) {\n this[SIGNAL] = signal\n if (signal.aborted) {\n this[ABORT]()\n } else {\n signal.addEventListener('abort', () => this[ABORT]())\n }\n }\n }\n\n /**\n * The amount of data stored in the buffer waiting to be read.\n *\n * For Buffer strings, this will be the total byte length.\n * For string encoding streams, this will be the string character length,\n * according to JavaScript's `string.length` logic.\n * For objectMode streams, this is a count of the items waiting to be\n * emitted.\n */\n get bufferLength() {\n return this[BUFFERLENGTH]\n }\n\n /**\n * The `BufferEncoding` currently in use, or `null`\n */\n get encoding() {\n return this[ENCODING]\n }\n\n /**\n * @deprecated - This is a read only property\n */\n set encoding(_enc) {\n throw new Error('Encoding must be set at instantiation time')\n }\n\n /**\n * @deprecated - Encoding may only be set at instantiation time\n */\n setEncoding(_enc: Minipass.Encoding) {\n throw new Error('Encoding must be set at instantiation time')\n }\n\n /**\n * True if this is an objectMode stream\n */\n get objectMode() {\n return this[OBJECTMODE]\n }\n\n /**\n * @deprecated - This is a read-only property\n */\n set objectMode(_om) {\n throw new Error('objectMode must be set at instantiation time')\n }\n\n /**\n * true if this is an async stream\n */\n get ['async'](): boolean {\n return this[ASYNC]\n }\n /**\n * Set to true to make this stream async.\n *\n * Once set, it cannot be unset, as this would potentially cause incorrect\n * behavior. Ie, a sync stream can be made async, but an async stream\n * cannot be safely made sync.\n */\n set ['async'](a: boolean) {\n this[ASYNC] = this[ASYNC] || !!a\n }\n\n // drop everything and get out of the flow completely\n [ABORT]() {\n this[ABORTED] = true\n this.emit('abort', this[SIGNAL]?.reason)\n this.destroy(this[SIGNAL]?.reason)\n }\n\n /**\n * True if the stream has been aborted.\n */\n get aborted() {\n return this[ABORTED]\n }\n /**\n * No-op setter. Stream aborted status is set via the AbortSignal provided\n * in the constructor options.\n */\n set aborted(_) {}\n\n /**\n * Write data into the stream\n *\n * If the chunk written is a string, and encoding is not specified, then\n * `utf8` will be assumed. If the stream encoding matches the encoding of\n * a written string, and the state of the string decoder allows it, then\n * the string will be passed through to either the output or the internal\n * buffer without any processing. Otherwise, it will be turned into a\n * Buffer object for processing into the desired encoding.\n *\n * If provided, `cb` function is called immediately before return for\n * sync streams, or on next tick for async streams, because for this\n * base class, a chunk is considered \"processed\" once it is accepted\n * and either emitted or buffered. That is, the callback does not indicate\n * that the chunk has been eventually emitted, though of course child\n * classes can override this function to do whatever processing is required\n * and call `super.write(...)` only once processing is completed.\n */\n write(chunk: WType, cb?: () => void): boolean\n write(\n chunk: WType,\n encoding?: Minipass.Encoding,\n cb?: () => void\n ): boolean\n write(\n chunk: WType,\n encoding?: Minipass.Encoding | (() => void),\n cb?: () => void\n ): boolean {\n if (this[ABORTED]) return false\n if (this[EOF]) throw new Error('write after end')\n\n if (this[DESTROYED]) {\n this.emit(\n 'error',\n Object.assign(\n new Error('Cannot call write after a stream was destroyed'),\n { code: 'ERR_STREAM_DESTROYED' }\n )\n )\n return true\n }\n\n if (typeof encoding === 'function') {\n cb = encoding\n encoding = 'utf8'\n }\n\n if (!encoding) encoding = 'utf8'\n\n const fn = this[ASYNC] ? defer : nodefer\n\n // convert array buffers and typed array views into buffers\n // at some point in the future, we may want to do the opposite!\n // leave strings and buffers as-is\n // anything is only allowed if in object mode, so throw\n if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n if (isArrayBufferView(chunk)) {\n //@ts-ignore - sinful unsafe type changing\n chunk = Buffer.from(\n chunk.buffer,\n chunk.byteOffset,\n chunk.byteLength\n )\n } else if (isArrayBufferLike(chunk)) {\n //@ts-ignore - sinful unsafe type changing\n chunk = Buffer.from(chunk)\n } else if (typeof chunk !== 'string') {\n throw new Error(\n 'Non-contiguous data written to non-objectMode stream'\n )\n }\n }\n\n // handle object mode up front, since it's simpler\n // this yields better performance, fewer checks later.\n if (this[OBJECTMODE]) {\n // maybe impossible?\n /* c8 ignore start */\n if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n /* c8 ignore stop */\n\n if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n else this[BUFFERPUSH](chunk as unknown as RType)\n\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n if (cb) fn(cb)\n\n return this[FLOWING]\n }\n\n // at this point the chunk is a buffer or string\n // don't buffer it up or send it to the decoder\n if (!(chunk as Minipass.BufferOrString).length) {\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n if (cb) fn(cb)\n return this[FLOWING]\n }\n\n // fast-path writing strings of same encoding to a stream with\n // an empty buffer, skipping the buffer/decoder dance\n if (\n typeof chunk === 'string' &&\n // unless it is a string already ready for us to use\n !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)\n ) {\n //@ts-ignore - sinful unsafe type change\n chunk = Buffer.from(chunk, encoding)\n }\n\n if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n //@ts-ignore - sinful unsafe type change\n chunk = this[DECODER].write(chunk)\n }\n\n // Note: flushing CAN potentially switch us into not-flowing mode\n if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n else this[BUFFERPUSH](chunk as unknown as RType)\n\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n if (cb) fn(cb)\n\n return this[FLOWING]\n }\n\n /**\n * Low-level explicit read method.\n *\n * In objectMode, the argument is ignored, and one item is returned if\n * available.\n *\n * `n` is the number of bytes (or in the case of encoding streams,\n * characters) to consume. If `n` is not provided, then the entire buffer\n * is returned, or `null` is returned if no data is available.\n *\n * If `n` is greater that the amount of data in the internal buffer,\n * then `null` is returned.\n */\n read(n?: number | null): RType | null {\n if (this[DESTROYED]) return null\n this[DISCARDED] = false\n\n if (\n this[BUFFERLENGTH] === 0 ||\n n === 0 ||\n (n && n > this[BUFFERLENGTH])\n ) {\n this[MAYBE_EMIT_END]()\n return null\n }\n\n if (this[OBJECTMODE]) n = null\n\n if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n // not object mode, so if we have an encoding, then RType is string\n // otherwise, must be Buffer\n this[BUFFER] = [\n (this[ENCODING]\n ? this[BUFFER].join('')\n : Buffer.concat(\n this[BUFFER] as Buffer[],\n this[BUFFERLENGTH]\n )) as RType,\n ]\n }\n\n const ret = this[READ](n || null, this[BUFFER][0] as RType)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [READ](n: number | null, chunk: RType) {\n if (this[OBJECTMODE]) this[BUFFERSHIFT]()\n else {\n const c = chunk as Minipass.BufferOrString\n if (n === c.length || n === null) this[BUFFERSHIFT]()\n else if (typeof c === 'string') {\n this[BUFFER][0] = c.slice(n) as RType\n chunk = c.slice(0, n) as RType\n this[BUFFERLENGTH] -= n\n } else {\n this[BUFFER][0] = c.subarray(n) as RType\n chunk = c.subarray(0, n) as RType\n this[BUFFERLENGTH] -= n\n }\n }\n\n this.emit('data', chunk)\n\n if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n return chunk\n }\n\n /**\n * End the stream, optionally providing a final write.\n *\n * See {@link Minipass#write} for argument descriptions\n */\n end(cb?: () => void): this\n end(chunk: WType, cb?: () => void): this\n end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this\n end(\n chunk?: WType | (() => void),\n encoding?: Minipass.Encoding | (() => void),\n cb?: () => void\n ): this {\n if (typeof chunk === 'function') {\n cb = chunk as () => void\n chunk = undefined\n }\n if (typeof encoding === 'function') {\n cb = encoding\n encoding = 'utf8'\n }\n if (chunk !== undefined) this.write(chunk, encoding)\n if (cb) this.once('end', cb)\n this[EOF] = true\n this.writable = false\n\n // if we haven't written anything, then go ahead and emit,\n // even if we're not reading.\n // we'll re-emit if a new 'end' listener is added anyway.\n // This makes MP more suitable to write-only use cases.\n if (this[FLOWING] || !this[PAUSED]) this[MAYBE_EMIT_END]()\n return this\n }\n\n // don't let the internal resume be overwritten\n [RESUME]() {\n if (this[DESTROYED]) return\n\n if (!this[DATALISTENERS] && !this[PIPES].length) {\n this[DISCARDED] = true\n }\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this[BUFFER].length) this[FLUSH]()\n else if (this[EOF]) this[MAYBE_EMIT_END]()\n else this.emit('drain')\n }\n\n /**\n * Resume the stream if it is currently in a paused state\n *\n * If called when there are no pipe destinations or `data` event listeners,\n * this will place the stream in a \"discarded\" state, where all data will\n * be thrown away. The discarded state is removed if a pipe destination or\n * data handler is added, if pause() is called, or if any synchronous or\n * asynchronous iteration is started.\n */\n resume() {\n return this[RESUME]()\n }\n\n /**\n * Pause the stream\n */\n pause() {\n this[FLOWING] = false\n this[PAUSED] = true\n this[DISCARDED] = false\n }\n\n /**\n * true if the stream has been forcibly destroyed\n */\n get destroyed() {\n return this[DESTROYED]\n }\n\n /**\n * true if the stream is currently in a flowing state, meaning that\n * any writes will be immediately emitted.\n */\n get flowing() {\n return this[FLOWING]\n }\n\n /**\n * true if the stream is currently in a paused state\n */\n get paused() {\n return this[PAUSED]\n }\n\n [BUFFERPUSH](chunk: RType) {\n if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n else this[BUFFERLENGTH] += (chunk as Minipass.BufferOrString).length\n this[BUFFER].push(chunk)\n }\n\n [BUFFERSHIFT](): RType {\n if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n else\n this[BUFFERLENGTH] -= (\n this[BUFFER][0] as Minipass.BufferOrString\n ).length\n return this[BUFFER].shift() as RType\n }\n\n [FLUSH](noDrain: boolean = false) {\n do {} while (\n this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n this[BUFFER].length\n )\n\n if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n }\n\n [FLUSHCHUNK](chunk: RType) {\n this.emit('data', chunk)\n return this[FLOWING]\n }\n\n /**\n * Pipe all data emitted by this stream into the destination provided.\n *\n * Triggers the flow of data.\n */\n pipe(dest: W, opts?: PipeOptions): W {\n if (this[DESTROYED]) return dest\n this[DISCARDED] = false\n\n const ended = this[EMITTED_END]\n opts = opts || {}\n if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n else opts.end = opts.end !== false\n opts.proxyErrors = !!opts.proxyErrors\n\n // piping an ended stream ends immediately\n if (ended) {\n if (opts.end) dest.end()\n } else {\n // \"as\" here just ignores the WType, which pipes don't care about,\n // since they're only consuming from us, and writing to the dest\n this[PIPES].push(\n !opts.proxyErrors\n ? new Pipe(this as Minipass, dest, opts)\n : new PipeProxyErrors(this as Minipass, dest, opts)\n )\n if (this[ASYNC]) defer(() => this[RESUME]())\n else this[RESUME]()\n }\n\n return dest\n }\n\n /**\n * Fully unhook a piped destination stream.\n *\n * If the destination stream was the only consumer of this stream (ie,\n * there are no other piped destinations or `'data'` event listeners)\n * then the flow of data will stop until there is another consumer or\n * {@link Minipass#resume} is explicitly called.\n */\n unpipe(dest: W) {\n const p = this[PIPES].find(p => p.dest === dest)\n if (p) {\n if (this[PIPES].length === 1) {\n if (this[FLOWING] && this[DATALISTENERS] === 0) {\n this[FLOWING] = false\n }\n this[PIPES] = []\n } else this[PIPES].splice(this[PIPES].indexOf(p), 1)\n p.unpipe()\n }\n }\n\n /**\n * Alias for {@link Minipass#on}\n */\n addListener(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ): this {\n return this.on(ev, handler)\n }\n\n /**\n * Mostly identical to `EventEmitter.on`, with the following\n * behavior differences to prevent data loss and unnecessary hangs:\n *\n * - Adding a 'data' event handler will trigger the flow of data\n *\n * - Adding a 'readable' event handler when there is data waiting to be read\n * will cause 'readable' to be emitted immediately.\n *\n * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n * already passed will cause the event to be emitted immediately and all\n * handlers removed.\n *\n * - Adding an 'error' event handler after an error has been emitted will\n * cause the event to be re-emitted immediately with the error previously\n * raised.\n */\n on(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ): this {\n const ret = super.on(\n ev as string | symbol,\n handler as (...a: any[]) => any\n )\n if (ev === 'data') {\n this[DISCARDED] = false\n this[DATALISTENERS]++\n if (!this[PIPES].length && !this[FLOWING]) {\n this[RESUME]()\n }\n } else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n super.emit('readable')\n } else if (isEndish(ev) && this[EMITTED_END]) {\n super.emit(ev)\n this.removeAllListeners(ev)\n } else if (ev === 'error' && this[EMITTED_ERROR]) {\n const h = handler as (...a: Events['error']) => any\n if (this[ASYNC]) defer(() => h.call(this, this[EMITTED_ERROR]))\n else h.call(this, this[EMITTED_ERROR])\n }\n return ret\n }\n\n /**\n * Alias for {@link Minipass#off}\n */\n removeListener(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ) {\n return this.off(ev, handler)\n }\n\n /**\n * Mostly identical to `EventEmitter.off`\n *\n * If a 'data' event handler is removed, and it was the last consumer\n * (ie, there are no pipe destinations or other 'data' event listeners),\n * then the flow of data will stop until there is another consumer or\n * {@link Minipass#resume} is explicitly called.\n */\n off(\n ev: Event,\n handler: (...args: Events[Event]) => any\n ) {\n const ret = super.off(\n ev as string | symbol,\n handler as (...a: any[]) => any\n )\n // if we previously had listeners, and now we don't, and we don't\n // have any pipes, then stop the flow, unless it's been explicitly\n // put in a discarded flowing state via stream.resume().\n if (ev === 'data') {\n this[DATALISTENERS] = this.listeners('data').length\n if (\n this[DATALISTENERS] === 0 &&\n !this[DISCARDED] &&\n !this[PIPES].length\n ) {\n this[FLOWING] = false\n }\n }\n return ret\n }\n\n /**\n * Mostly identical to `EventEmitter.removeAllListeners`\n *\n * If all 'data' event handlers are removed, and they were the last consumer\n * (ie, there are no pipe destinations), then the flow of data will stop\n * until there is another consumer or {@link Minipass#resume} is explicitly\n * called.\n */\n removeAllListeners(ev?: Event) {\n const ret = super.removeAllListeners(ev as string | symbol | undefined)\n if (ev === 'data' || ev === undefined) {\n this[DATALISTENERS] = 0\n if (!this[DISCARDED] && !this[PIPES].length) {\n this[FLOWING] = false\n }\n }\n return ret\n }\n\n /**\n * true if the 'end' event has been emitted\n */\n get emittedEnd() {\n return this[EMITTED_END]\n }\n\n [MAYBE_EMIT_END]() {\n if (\n !this[EMITTING_END] &&\n !this[EMITTED_END] &&\n !this[DESTROYED] &&\n this[BUFFER].length === 0 &&\n this[EOF]\n ) {\n this[EMITTING_END] = true\n this.emit('end')\n this.emit('prefinish')\n this.emit('finish')\n if (this[CLOSED]) this.emit('close')\n this[EMITTING_END] = false\n }\n }\n\n /**\n * Mostly identical to `EventEmitter.emit`, with the following\n * behavior differences to prevent data loss and unnecessary hangs:\n *\n * If the stream has been destroyed, and the event is something other\n * than 'close' or 'error', then `false` is returned and no handlers\n * are called.\n *\n * If the event is 'end', and has already been emitted, then the event\n * is ignored. If the stream is in a paused or non-flowing state, then\n * the event will be deferred until data flow resumes. If the stream is\n * async, then handlers will be called on the next tick rather than\n * immediately.\n *\n * If the event is 'close', and 'end' has not yet been emitted, then\n * the event will be deferred until after 'end' is emitted.\n *\n * If the event is 'error', and an AbortSignal was provided for the stream,\n * and there are no listeners, then the event is ignored, matching the\n * behavior of node core streams in the presense of an AbortSignal.\n *\n * If the event is 'finish' or 'prefinish', then all listeners will be\n * removed after emitting the event, to prevent double-firing.\n */\n emit(\n ev: Event,\n ...args: Events[Event]\n ): boolean {\n const data = args[0]\n // error and close are only events allowed after calling destroy()\n if (\n ev !== 'error' &&\n ev !== 'close' &&\n ev !== DESTROYED &&\n this[DESTROYED]\n ) {\n return false\n } else if (ev === 'data') {\n return !this[OBJECTMODE] && !data\n ? false\n : this[ASYNC]\n ? (defer(() => this[EMITDATA](data as RType)), true)\n : this[EMITDATA](data as RType)\n } else if (ev === 'end') {\n return this[EMITEND]()\n } else if (ev === 'close') {\n this[CLOSED] = true\n // don't emit close before 'end' and 'finish'\n if (!this[EMITTED_END] && !this[DESTROYED]) return false\n const ret = super.emit('close')\n this.removeAllListeners('close')\n return ret\n } else if (ev === 'error') {\n this[EMITTED_ERROR] = data\n super.emit(ERROR, data)\n const ret =\n !this[SIGNAL] || this.listeners('error').length\n ? super.emit('error', data)\n : false\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'resume') {\n const ret = super.emit('resume')\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'finish' || ev === 'prefinish') {\n const ret = super.emit(ev)\n this.removeAllListeners(ev)\n return ret\n }\n\n // Some other unknown event\n const ret = super.emit(ev as string, ...args)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITDATA](data: RType) {\n for (const p of this[PIPES]) {\n if (p.dest.write(data as RType) === false) this.pause()\n }\n const ret = this[DISCARDED] ? false : super.emit('data', data)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITEND]() {\n if (this[EMITTED_END]) return false\n\n this[EMITTED_END] = true\n this.readable = false\n return this[ASYNC]\n ? (defer(() => this[EMITEND2]()), true)\n : this[EMITEND2]()\n }\n\n [EMITEND2]() {\n if (this[DECODER]) {\n const data = this[DECODER].end()\n if (data) {\n for (const p of this[PIPES]) {\n p.dest.write(data as RType)\n }\n if (!this[DISCARDED]) super.emit('data', data)\n }\n }\n\n for (const p of this[PIPES]) {\n p.end()\n }\n const ret = super.emit('end')\n this.removeAllListeners('end')\n return ret\n }\n\n /**\n * Return a Promise that resolves to an array of all emitted data once\n * the stream ends.\n */\n async collect(): Promise {\n const buf: RType[] & { dataLength: number } = Object.assign([], {\n dataLength: 0,\n })\n if (!this[OBJECTMODE]) buf.dataLength = 0\n // set the promise first, in case an error is raised\n // by triggering the flow here.\n const p = this.promise()\n this.on('data', c => {\n buf.push(c)\n if (!this[OBJECTMODE])\n buf.dataLength += (c as Minipass.BufferOrString).length\n })\n await p\n return buf\n }\n\n /**\n * Return a Promise that resolves to the concatenation of all emitted data\n * once the stream ends.\n *\n * Not allowed on objectMode streams.\n */\n async concat(): Promise {\n if (this[OBJECTMODE]) {\n throw new Error('cannot concat in objectMode')\n }\n const buf = await this.collect()\n return (\n this[ENCODING]\n ? buf.join('')\n : Buffer.concat(buf as Buffer[], buf.dataLength)\n ) as RType\n }\n\n /**\n * Return a void Promise that resolves once the stream ends.\n */\n async promise(): Promise {\n return new Promise((resolve, reject) => {\n this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n this.on('error', er => reject(er))\n this.on('end', () => resolve())\n })\n }\n\n /**\n * Asynchronous `for await of` iteration.\n *\n * This will continue emitting all chunks until the stream terminates.\n */\n [Symbol.asyncIterator](): AsyncGenerator {\n // set this up front, in case the consumer doesn't call next()\n // right away.\n this[DISCARDED] = false\n let stopped = false\n const stop = async (): Promise> => {\n this.pause()\n stopped = true\n return { value: undefined, done: true }\n }\n const next = (): Promise> => {\n if (stopped) return stop()\n const res = this.read()\n if (res !== null) return Promise.resolve({ done: false, value: res })\n\n if (this[EOF]) return stop()\n\n let resolve!: (res: IteratorResult) => void\n let reject!: (er: unknown) => void\n const onerr = (er: unknown) => {\n this.off('data', ondata)\n this.off('end', onend)\n this.off(DESTROYED, ondestroy)\n stop()\n reject(er)\n }\n const ondata = (value: RType) => {\n this.off('error', onerr)\n this.off('end', onend)\n this.off(DESTROYED, ondestroy)\n this.pause()\n resolve({ value, done: !!this[EOF] })\n }\n const onend = () => {\n this.off('error', onerr)\n this.off('data', ondata)\n this.off(DESTROYED, ondestroy)\n stop()\n resolve({ done: true, value: undefined })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise>((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return {\n next,\n throw: stop,\n return: stop,\n [Symbol.asyncIterator]() {\n return this\n },\n }\n }\n\n /**\n * Synchronous `for of` iteration.\n *\n * The iteration will terminate when the internal buffer runs out, even\n * if the stream has not yet terminated.\n */\n [Symbol.iterator](): Generator {\n // set this up front, in case the consumer doesn't call next()\n // right away.\n this[DISCARDED] = false\n let stopped = false\n const stop = (): IteratorReturnResult => {\n this.pause()\n this.off(ERROR, stop)\n this.off(DESTROYED, stop)\n this.off('end', stop)\n stopped = true\n return { done: true, value: undefined }\n }\n\n const next = (): IteratorResult => {\n if (stopped) return stop()\n const value = this.read()\n return value === null ? stop() : { done: false, value }\n }\n\n this.once('end', stop)\n this.once(ERROR, stop)\n this.once(DESTROYED, stop)\n\n return {\n next,\n throw: stop,\n return: stop,\n [Symbol.iterator]() {\n return this\n },\n }\n }\n\n /**\n * Destroy a stream, preventing it from being used for any further purpose.\n *\n * If the stream has a `close()` method, then it will be called on\n * destruction.\n *\n * After destruction, any attempt to write data, read data, or emit most\n * events will be ignored.\n *\n * If an error argument is provided, then it will be emitted in an\n * 'error' event.\n */\n destroy(er?: unknown) {\n if (this[DESTROYED]) {\n if (er) this.emit('error', er)\n else this.emit(DESTROYED)\n return this\n }\n\n this[DESTROYED] = true\n this[DISCARDED] = true\n\n // throw away all buffered data, it's never coming out\n this[BUFFER].length = 0\n this[BUFFERLENGTH] = 0\n\n const wc = this as Minipass & {\n close?: () => void\n }\n if (typeof wc.close === 'function' && !this[CLOSED]) wc.close()\n\n if (er) this.emit('error', er)\n // if no error to emit, still reject pending promises\n else this.emit(DESTROYED)\n\n return this\n }\n\n /**\n * Alias for {@link isStream}\n *\n * Former export location, maintained for backwards compatibility.\n *\n * @deprecated\n */\n static get isStream() {\n return isStream\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/minipass/dist/esm/package.json b/node_modules/minipass/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/minipass/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/minipass/package.json b/node_modules/minipass/package.json new file mode 100644 index 0000000..771969b --- /dev/null +++ b/node_modules/minipass/package.json @@ -0,0 +1,82 @@ +{ + "name": "minipass", + "version": "7.1.2", + "description": "minimal implementation of a PassThrough stream", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "tshy": { + "selfLink": false, + "main": true, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "devDependencies": { + "@types/end-of-stream": "^1.4.2", + "@types/node": "^20.1.2", + "end-of-stream": "^1.4.0", + "node-abort-controller": "^3.1.1", + "prettier": "^2.6.2", + "tap": "^19.0.0", + "through2": "^2.0.3", + "tshy": "^1.14.0", + "typedoc": "^0.25.1" + }, + "repository": "https://github.com/isaacs/minipass", + "keywords": [ + "passthrough", + "stream" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "tap": { + "typecheck": true, + "include": [ + "test/*.ts" + ] + } +} diff --git a/node_modules/mkdirp/LICENSE b/node_modules/mkdirp/LICENSE new file mode 100644 index 0000000..432d1ae --- /dev/null +++ b/node_modules/mkdirp/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +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. diff --git a/node_modules/mkdirp/bin/cmd.js b/node_modules/mkdirp/bin/cmd.js new file mode 100755 index 0000000..d95de15 --- /dev/null +++ b/node_modules/mkdirp/bin/cmd.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var mkdirp = require('../'); +var minimist = require('minimist'); +var fs = require('fs'); + +var argv = minimist(process.argv.slice(2), { + alias: { m: 'mode', h: 'help' }, + string: [ 'mode' ] +}); +if (argv.help) { + fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); + return; +} + +var paths = argv._.slice(); +var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; + +(function next () { + if (paths.length === 0) return; + var p = paths.shift(); + + if (mode === undefined) mkdirp(p, cb) + else mkdirp(p, mode, cb) + + function cb (err) { + if (err) { + console.error(err.message); + process.exit(1); + } + else next(); + } +})(); diff --git a/node_modules/mkdirp/bin/usage.txt b/node_modules/mkdirp/bin/usage.txt new file mode 100644 index 0000000..f952aa2 --- /dev/null +++ b/node_modules/mkdirp/bin/usage.txt @@ -0,0 +1,12 @@ +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories that + don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m, --mode If a directory needs to be created, set the mode as an octal + permission string. + diff --git a/node_modules/mkdirp/index.js b/node_modules/mkdirp/index.js new file mode 100644 index 0000000..0890ac3 --- /dev/null +++ b/node_modules/mkdirp/index.js @@ -0,0 +1,102 @@ +var path = require('path'); +var fs = require('fs'); +var _0777 = parseInt('0777', 8); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, opts, f, made) { + if (typeof opts === 'function') { + f = opts; + opts = {}; + } + else if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 + } + if (!made) made = null; + + var cb = f || /* istanbul ignore next */ function () {}; + p = path.resolve(p); + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p; + return cb(null, made); + } + switch (er.code) { + case 'ENOENT': + /* istanbul ignore if */ + if (path.dirname(p) === p) return cb(er); + mkdirP(path.dirname(p), opts, function (er, made) { + /* istanbul ignore if */ + if (er) cb(er, made); + else mkdirP(p, opts, cb, made); + }); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) cb(er, made) + else cb(null, made); + }); + break; + } + }); +} + +mkdirP.sync = function sync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 + } + if (!made) made = null; + + p = path.resolve(p); + + try { + xfs.mkdirSync(p, mode); + made = made || p; + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = sync(path.dirname(p), opts, made); + sync(p, opts, made); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p); + } + catch (err1) /* istanbul ignore next */ { + throw err0; + } + /* istanbul ignore if */ + if (!stat.isDirectory()) throw err0; + break; + } + } + + return made; +}; diff --git a/node_modules/mkdirp/package.json b/node_modules/mkdirp/package.json new file mode 100644 index 0000000..951e58d --- /dev/null +++ b/node_modules/mkdirp/package.json @@ -0,0 +1,33 @@ +{ + "name": "mkdirp", + "description": "Recursively mkdir, like `mkdir -p`", + "version": "0.5.6", + "publishConfig": { + "tag": "legacy" + }, + "author": "James Halliday (http://substack.net)", + "main": "index.js", + "keywords": [ + "mkdir", + "directory" + ], + "repository": { + "type": "git", + "url": "https://github.com/substack/node-mkdirp.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "minimist": "^1.2.6" + }, + "devDependencies": { + "tap": "^16.0.1" + }, + "bin": "bin/cmd.js", + "license": "MIT", + "files": [ + "bin", + "index.js" + ] +} diff --git a/node_modules/mkdirp/readme.markdown b/node_modules/mkdirp/readme.markdown new file mode 100644 index 0000000..fc314bf --- /dev/null +++ b/node_modules/mkdirp/readme.markdown @@ -0,0 +1,100 @@ +# mkdirp + +Like `mkdir -p`, but in node.js! + +[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) + +# example + +## pow.js + +```js +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); +``` + +Output + +``` +pow! +``` + +And now /tmp/foo/bar/baz exists, huzzah! + +# methods + +```js +var mkdirp = require('mkdirp'); +``` + +## mkdirp(dir, opts, cb) + +Create a new directory and any necessary subdirectories at `dir` with octal +permission string `opts.mode`. If `opts` is a non-object, it will be treated as +the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777`. + +`cb(err, made)` fires with the error or the first directory `made` +that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and +`opts.fs.stat(path, cb)`. + +## mkdirp.sync(dir, opts) + +Synchronously create a new directory and any necessary subdirectories at `dir` +with octal permission string `opts.mode`. If `opts` is a non-object, it will be +treated as the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777`. + +Returns the first directory that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and +`opts.fs.statSync(path)`. + +# usage + +This package also ships with a `mkdirp` command. + +``` +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories that + don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m, --mode If a directory needs to be created, set the mode as an octal + permission string. + +``` + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install mkdirp +``` + +to get the library, or + +``` +npm install -g mkdirp +``` + +to get the command. + +# license + +MIT diff --git a/node_modules/moo/LICENSE b/node_modules/moo/LICENSE new file mode 100644 index 0000000..3810d82 --- /dev/null +++ b/node_modules/moo/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2017, Tim Radvan (tjvr) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/moo/README.md b/node_modules/moo/README.md new file mode 100644 index 0000000..52b985e --- /dev/null +++ b/node_modules/moo/README.md @@ -0,0 +1,383 @@ +![](cow.png) + +Moo! +==== + +Moo is a highly-optimised tokenizer/lexer generator. Use it to tokenize your strings, before parsing 'em with a parser like [nearley](https://github.com/hardmath123/nearley) or whatever else you're into. + +* [Fast](#is-it-fast) +* [Convenient](#usage) +* uses [Regular Expressions](#on-regular-expressions) +* tracks [Line Numbers](#line-numbers) +* handles [Keywords](#keywords) +* supports [States](#states) +* custom [Errors](#errors) +* is even [Iterable](#iteration) +* has no dependencies +* 4KB minified + gzipped +* Moo! + +Is it fast? +----------- + +Yup! Flying-cows-and-singed-steak fast. + +Moo is the fastest JS tokenizer around. It's **~2–10x** faster than most other tokenizers; it's a **couple orders of magnitude** faster than some of the slower ones. + +Define your tokens **using regular expressions**. Moo will compile 'em down to a **single RegExp for performance**. It uses the new ES6 **sticky flag** where possible to make things faster; otherwise it falls back to an almost-as-efficient workaround. (For more than you ever wanted to know about this, read [adventures in the land of substrings and RegExps](http://mrale.ph/blog/2016/11/23/making-less-dart-faster.html).) + +You _might_ be able to go faster still by writing your lexer by hand rather than using RegExps, but that's icky. + +Oh, and it [avoids parsing RegExps by itself](https://hackernoon.com/the-madness-of-parsing-real-world-javascript-regexps-d9ee336df983#.2l8qu3l76). Because that would be horrible. + + +Usage +----- + +First, you need to do the needful: `$ npm install moo`, or whatever will ship this code to your computer. Alternatively, grab the `moo.js` file by itself and slap it into your web page via a ` +``` + +#### [Node.js](https://nodejs.org) (>= v13.2.0 or using --experimental-modules flag) + +```js +// index.mjs +import mustache from 'mustache/mustache.mjs' + +console.log(mustache.render('Hello {{name}}!', { name: 'Santa' })) +// Hello Santa! +``` + +ES Module support for Node.js will be improved in the future when [Conditional Exports](https://nodejs.org/api/esm.html#esm_conditional_exports) +is enabled by default rather than being behind an experimental flag. + +More info in [Node.js ECMAScript Modules docs](https://nodejs.org/api/esm.html). + +#### [Deno](https://deno.land/) + +```js +// index.ts +import mustache from 'https://unpkg.com/mustache@3.2.0/mustache.mjs' + +console.log(mustache.render('Hello {{name}}!', { name: 'Santa' })) +// Hello Santa! +``` + +## [3.1.0] / 13 September 2019 + +### Added + + * [#717]: Added support .js files as views in command line tool, by [@JEStaubach]. + +### Fixed + + * [#716]: Bugfix for indentation of inline partials, by [@yotammadem]. + +## [3.0.3] / 27 August 2019 + +### Added + + * [#713]: Add test cases for custom functions in partials, by [@wol-soft]. + +### Fixed + + * [#714]: Bugfix for wrong function output in partials with indentation, by [@phillipj]. + +## [3.0.2] / 21 August 2019 + +### Fixed + + * [#705]: Fix indentation of partials, by [@kevindew] and [@yotammadem]. + +### Dev + + * [#701]: Fix test failure for Node 10 and above, by [@andersk]. + * [#704]: Lint all test files just like the source files, by [@phillipj]. + * Start experimenting & comparing GitHub Actions vs Travis CI, by [@phillipj]. + +## [3.0.1] / 11 November 2018 + + * [#679]: Fix partials not rendering tokens when using custom tags, by [@stackchain]. + +## [3.0.0] / 16 September 2018 + +We are very happy to announce a new major version of mustache.js. We want to be very careful not to break projects +out in the wild, and adhering to [Semantic Versioning](http://semver.org/) we have therefore cut this new major version. + +The changes introduced will likely not require any actions for most using projects. The things to look out for that +might cause unexpected rendering results are described in the migration guide below. + +A big shout out and thanks to [@raymond-lam] for this release! Without his contributions with code and issue triaging, +this release would never have happened. + +### Major + +* [#618]: Allow rendering properties of primitive types that are not objects, by [@raymond-lam]. +* [#643]: `Writer.prototype.parse` to cache by tags in addition to template string, by [@raymond-lam]. +* [#664]: Fix `Writer.prototype.parse` cache, by [@seminaoki]. + +### Minor + +* [#673]: Add `tags` parameter to `Mustache.render()`, by [@raymond-lam]. + +### Migrating from mustache.js v2.x to v3.x + +#### Rendering properties of primitive types + +We have ensured properties of primitive types can be rendered at all times. That means `Array.length`, `String.length` +and similar. A corner case where this could cause unexpected output follows: + +View: +``` +{ + stooges: [ + { name: "Moe" }, + { name: "Larry" }, + { name: "Curly" } + ] +} +``` + +Template: +``` +{{#stooges}} + {{name}}: {{name.length}} characters +{{/stooges}} +``` + +Output with v3.0: +``` + Moe: 3 characters + Larry: 5 characters + Curly: 5 characters +``` + +Output with v2.x: +``` + Moe: characters + Larry: characters + Curly: characters +``` + +#### Caching for templates with custom delimiters + +We have improved the templates cache to ensure custom delimiters are taken into consideration for the cache. +This improvement might cause unexpected rendering behaviour for using projects actively using the custom delimiters functionality. + +Previously it was possible to use `Mustache.parse()` as a means to set global custom delimiters. If custom +delimiters were provided as an argument, it would affect all following calls to `Mustache.render()`. +Consider the following: + +```js +const template = "[[item.title]] [[item.value]]"; +mustache.parse(template, ["[[", "]]"]); + +console.log( + mustache.render(template, { + item: { + title: "TEST", + value: 1 + } + }) +); + +>> TEST 1 +``` + +The above illustrates the fact that `Mustache.parse()` made mustache.js cache the template without considering +the custom delimiters provided. This is no longer true. + +We no longer encourage using `Mustache.parse()` for this purpose, but have rather added a fourth argument to +`Mustache.render()` letting you provide custom delimiters when rendering. + +If you still need the pre-parse the template and use custom delimiters at the same time, ensure to provide +the custom delimiters as argument to `Mustache.render()` as well. + +## [2.3.2] / 17 August 2018 + +This release is made to revert changes introduced in [2.3.1] that caused unexpected behaviour for several users. + +### Minor + + * [#670]: Rollback template cache causing unexpected behaviour, by [@raymond-lam]. + +## [2.3.1] / 7 August 2018 + +### Minor + + * [#643]: `Writer.prototype.parse` to cache by tags in addition to template string, by [@raymond-lam]. + * [#664]: Fix `Writer.prototype.parse` cache, by [@seminaoki]. + +### Dev + + * [#666]: Install release tools with npm rather than pre-commit hook & `Rakefile`, by [@phillipj]. + * [#667], [#668]: Stabilize browser test suite, by [@phillipj]. + +### Docs + + * [#644]: Document global Mustache.escape overriding capacity, by [@paultopia]. + * [#657]: Correct `Mustache.parse()` return type documentation, by [@bbrooks]. + +## [2.3.0] / 8 November 2016 + +### Minor + + * [#540]: Add optional `output` argument to mustache CLI, by [@wizawu]. + * [#597]: Add compatibility with amdclean, by [@mightyplow]. + +### Dev + + * [#553]: Assert `null` lookup when rendering an unescaped value, by [@dasilvacontin]. + * [#580], [#610]: Ignore eslint for greenkeeper updates, by [@phillipj]. + * [#560]: Fix CLI tests for Windows, by [@kookookchoozeus]. + * Run browser tests w/node v4, by [@phillipj]. + +### Docs + + * [#542]: Add API documentation to README, by [@tomekwi]. + * [#546]: Add missing syntax highlighting to README code blocks, by [@pra85]. + * [#569]: Update Ctemplate links in README, by [@mortonfox]. + * [#592]: Change "loadUser" to "loadUser()" in README, by [@Flaque]. + * [#593]: Adding doctype to HTML code example in README, by [@calvinf]. + +### Dependencies + + * eslint -> 2.2.0. Breaking changes fix by [@phillipj]. [#548] + * eslint -> 2.5.1. + * mocha -> 3.0.2. + * zuul -> 3.11.0. + +## [2.2.1] / 13 December 2015 + +### Fixes + + * Improve HTML escaping, by [@phillipj]. + * Fix inconsistency in defining global mustache object, by [@simast]. + * Fix switch-case indent error, by [@norfish]. + * Unpin chai and eslint versions, by [@dasilvacontin]. + * Update README.md with proper grammar, by [@EvanLovely]. + * Update mjackson username in README, by [@mjackson]. + * Remove syntax highlighting in README code sample, by [@imagentleman]. + * Fix typo in README, by [@Xcrucifier]. + * Fix link typo in README, by [@keirog]. + +## [2.2.0] / 15 October 2015 + +### Added + + * Add Partials support to CLI, by [@palkan]. + +### Changed + + * Move install instructions to README's top, by [@mateusortiz] + * Improved devhook install output, by [@ShashankaNataraj]. + * Clarifies and improves language in documentation, by [@jfmercer]. + * Linting CLI tool, by [@phillipj]. + * npm 2.x and node v4 on Travis, by [@phillipj]. + +### Fixes + + * Fix README spelling error to "aforementioned", by [@djchie]. + * Equal error message test in .render() for server and browser, by [@phillipj]. + +### Dependencies + + * chai -> 3.3.0 + * eslint -> 1.6.0 + +## [2.1.3] / 23 July 2015 + +### Added + + * Throw error when providing .render() with invalid template type, by [@phillipj]. + * Documents use of string literals containing double quotes, by [@jfmercer]. + +### Changed + + * Move mustache gif to githubusercontent, by [@Andersos]. + +### Fixed + + * Update UMD Shim to be resilient to HTMLElement global pollution, by [@mikesherov]. + +## [2.1.2] / 17 June 2015 + +### Added + + * Mustache global definition ([#466]) by [@yousefcisco]. + +## [2.1.1] / 11 June 2015 + +### Added + + * State that we use semver on the change log, by [@dasilvacontin]. + * Added version links to change log, by [@dasilvacontin]. + +### Fixed + + * Bugfix for using values from view's context prototype, by [@phillipj]. + * Improve test with undefined/null lookup hit using dot notation, by [@dasilvacontin]. + * Bugfix for null/undefined lookup hit when using dot notation, by [@phillipj]. + * Remove moot `version` property from bower.json, by [@kkirsche]. + * bower.json doesn't require a version bump via hook, by [@dasilvacontin]. + + +## [2.1.0] / 5 June 2015 + + * Added license attribute to package.json, by [@pgilad]. + * Minor changes to make mustache.js compatible with both WSH and ASP, by [@nagaozen]. + * Improve CLI view parsing error, by [@phillipj]. + * Bugfix for view context cache, by [@phillipj]. + +## [2.0.0] / 27 Mar 2015 + + * Fixed lookup not stopping upon finding `undefined` or `null` values, by [@dasilvacontin]. + * Refactored pre-commit hook, by [@dasilvacontin]. + +## [1.2.0] / 24 Mar 2015 + + * Added -v option to CLI, by [@phillipj]. + * Bugfix for rendering Number when it serves as the Context, by [@phillipj]. + * Specified files in package.json for a cleaner install, by [@phillipj]. + +## [1.1.0] / 18 Feb 2015 + + * Refactor Writer.renderTokens() for better readability, by [@phillipj]. + * Cleanup tests section in readme, by [@phillipj]. + * Added JSHint to tests/CI, by [@phillipj]. + * Added node v0.12 on travis, by [@phillipj]. + * Created command line tool, by [@phillipj]. + * Added *falsy* to Inverted Sections description in README, by [@kristijanmatic]. + +## [1.0.0] / 20 Dec 2014 + + * Inline tag compilation, by [@mjackson]. + * Fixed AMD registration, volo package.json entry, by [@jrburke]. + * Added spm support, by [@afc163]. + * Only access properties of objects on Context.lookup, by [@cmbuckley]. + +## [0.8.2] / 17 Mar 2014 + + * Supporting Bower through a bower.json file. + +## [0.8.1] / 3 Jan 2014 + + * Fix usage of partial templates. + +## [0.8.0] / 2 Dec 2013 + + * Remove compile* writer functions, use mustache.parse instead. Smaller API. + * Throw an error when rendering a template that contains higher-order sections and + the original template is not provided. + * Remove low-level Context.make function. + * Better code readability and inline documentation. + * Stop caching templates by name. + +## [0.7.3] / 5 Nov 2013 + + * Don't require the original template to be passed to the rendering function + when using compiled templates. This is still required when using higher-order + functions in order to be able to extract the portion of the template + that was contained by that section. Fixes [#262]. + * Performance improvements. + +## [0.7.2] / 27 Dec 2012 + + * Fixed a rendering bug ([#274]) when using nested higher-order sections. + * Better error reporting on failed parse. + * Converted tests to use mocha instead of vows. + +## [0.7.1] / 6 Dec 2012 + + * Handle empty templates gracefully. Fixes [#265], [#267], and [#270]. + * Cache partials by template, not by name. Fixes [#257]. + * Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes + [#258]. + +## [0.7.0] / 10 Sep 2012 + + * Rename Renderer => Writer. + * Allow partials to be loaded dynamically using a callback (thanks + [@TiddoLangerak] for the suggestion). + * Fixed a bug with higher-order sections that prevented them from being + passed the raw text of the section from the original template. + * More concise token format. Tokens also include start/end indices in the + original template. + * High-level API is consistent with the Writer API. + * Allow partials to be passed to the pre-compiled function (thanks + [@fallenice]). + * Don't use eval (thanks [@cweider]). + +## [0.6.0] / 31 Aug 2012 + + * Use JavaScript's definition of falsy when determining whether to render an + inverted section or not. Issue [#186]. + * Use Mustache.escape to escape values inside {{}}. This function may be + reassigned to alter the default escaping behavior. Issue [#244]. + * Fixed a bug that clashed with QUnit (thanks [@kannix]). + * Added volo support (thanks [@guybedford]). + +[4.1.0]: https://github.com/janl/mustache.js/compare/v4.0.1...v4.1.0 +[4.0.1]: https://github.com/janl/mustache.js/compare/v4.0.0...v4.0.1 +[4.0.0]: https://github.com/janl/mustache.js/compare/v3.2.1...v4.0.0 +[3.2.1]: https://github.com/janl/mustache.js/compare/v3.2.0...v3.2.1 +[3.2.0]: https://github.com/janl/mustache.js/compare/v3.1.0...v3.2.0 +[3.1.0]: https://github.com/janl/mustache.js/compare/v3.0.3...v3.1.0 +[3.0.3]: https://github.com/janl/mustache.js/compare/v3.0.2...v3.0.3 +[3.0.2]: https://github.com/janl/mustache.js/compare/v3.0.1...v3.0.2 +[3.0.1]: https://github.com/janl/mustache.js/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/janl/mustache.js/compare/v2.3.2...v3.0.0 +[2.3.2]: https://github.com/janl/mustache.js/compare/v2.3.1...v2.3.2 +[2.3.1]: https://github.com/janl/mustache.js/compare/v2.3.0...v2.3.1 +[2.3.0]: https://github.com/janl/mustache.js/compare/v2.2.1...v2.3.0 +[2.2.1]: https://github.com/janl/mustache.js/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/janl/mustache.js/compare/v2.1.3...v2.2.0 +[2.1.3]: https://github.com/janl/mustache.js/compare/v2.1.2...v2.1.3 +[2.1.2]: https://github.com/janl/mustache.js/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/janl/mustache.js/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/janl/mustache.js/compare/v2.0.0...v2.1.0 +[2.0.0]: https://github.com/janl/mustache.js/compare/v1.2.0...v2.0.0 +[1.2.0]: https://github.com/janl/mustache.js/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/janl/mustache.js/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/janl/mustache.js/compare/0.8.2...v1.0.0 +[0.8.2]: https://github.com/janl/mustache.js/compare/0.8.1...0.8.2 +[0.8.1]: https://github.com/janl/mustache.js/compare/0.8.0...0.8.1 +[0.8.0]: https://github.com/janl/mustache.js/compare/0.7.3...0.8.0 +[0.7.3]: https://github.com/janl/mustache.js/compare/0.7.2...0.7.3 +[0.7.2]: https://github.com/janl/mustache.js/compare/0.7.1...0.7.2 +[0.7.1]: https://github.com/janl/mustache.js/compare/0.7.0...0.7.1 +[0.7.0]: https://github.com/janl/mustache.js/compare/0.6.0...0.7.0 +[0.6.0]: https://github.com/janl/mustache.js/compare/0.5.2...0.6.0 + +[#186]: https://github.com/janl/mustache.js/issues/186 +[#244]: https://github.com/janl/mustache.js/issues/244 +[#257]: https://github.com/janl/mustache.js/issues/257 +[#258]: https://github.com/janl/mustache.js/issues/258 +[#262]: https://github.com/janl/mustache.js/issues/262 +[#265]: https://github.com/janl/mustache.js/issues/265 +[#267]: https://github.com/janl/mustache.js/issues/267 +[#270]: https://github.com/janl/mustache.js/issues/270 +[#274]: https://github.com/janl/mustache.js/issues/274 +[#466]: https://github.com/janl/mustache.js/issues/466 +[#540]: https://github.com/janl/mustache.js/issues/540 +[#542]: https://github.com/janl/mustache.js/issues/542 +[#546]: https://github.com/janl/mustache.js/issues/546 +[#548]: https://github.com/janl/mustache.js/issues/548 +[#553]: https://github.com/janl/mustache.js/issues/553 +[#560]: https://github.com/janl/mustache.js/issues/560 +[#569]: https://github.com/janl/mustache.js/issues/569 +[#580]: https://github.com/janl/mustache.js/issues/580 +[#592]: https://github.com/janl/mustache.js/issues/592 +[#593]: https://github.com/janl/mustache.js/issues/593 +[#597]: https://github.com/janl/mustache.js/issues/597 +[#610]: https://github.com/janl/mustache.js/issues/610 +[#643]: https://github.com/janl/mustache.js/issues/643 +[#644]: https://github.com/janl/mustache.js/issues/644 +[#657]: https://github.com/janl/mustache.js/issues/657 +[#664]: https://github.com/janl/mustache.js/issues/664 +[#666]: https://github.com/janl/mustache.js/issues/666 +[#667]: https://github.com/janl/mustache.js/issues/667 +[#668]: https://github.com/janl/mustache.js/issues/668 +[#670]: https://github.com/janl/mustache.js/issues/670 +[#618]: https://github.com/janl/mustache.js/issues/618 +[#673]: https://github.com/janl/mustache.js/issues/673 +[#679]: https://github.com/janl/mustache.js/issues/679 +[#701]: https://github.com/janl/mustache.js/issues/701 +[#704]: https://github.com/janl/mustache.js/issues/704 +[#705]: https://github.com/janl/mustache.js/issues/705 +[#713]: https://github.com/janl/mustache.js/issues/713 +[#714]: https://github.com/janl/mustache.js/issues/714 +[#716]: https://github.com/janl/mustache.js/issues/716 +[#717]: https://github.com/janl/mustache.js/issues/717 +[#728]: https://github.com/janl/mustache.js/issues/728 +[#733]: https://github.com/janl/mustache.js/issues/733 +[#731]: https://github.com/janl/mustache.js/issues/731 +[#735]: https://github.com/janl/mustache.js/issues/735 +[#739]: https://github.com/janl/mustache.js/issues/739 +[#764]: https://github.com/janl/mustache.js/issues/764 +[#773]: https://github.com/janl/mustache.js/issues/773 + +[@afc163]: https://github.com/afc163 +[@aielo]: https://github.com/aielo +[@andersk]: https://github.com/andersk +[@Andersos]: https://github.com/Andersos +[@AndrewLeedham]: https://github.com/AndrewLeedham +[@bbrooks]: https://github.com/bbrooks +[@calvinf]: https://github.com/calvinf +[@cmbuckley]: https://github.com/cmbuckley +[@cweider]: https://github.com/cweider +[@dasilvacontin]: https://github.com/dasilvacontin +[@djchie]: https://github.com/djchie +[@eobrain]: https://github.com/eobrain +[@EvanLovely]: https://github.com/EvanLovely +[@fallenice]: https://github.com/fallenice +[@Flaque]: https://github.com/Flaque +[@guybedford]: https://github.com/guybedford +[@imagentleman]: https://github.com/imagentleman +[@JEStaubach]: https://github.com/JEStaubach +[@jfmercer]: https://github.com/jfmercer +[@jrburke]: https://github.com/jrburke +[@kannix]: https://github.com/kannix +[@keirog]: https://github.com/keirog +[@kkirsche]: https://github.com/kkirsche +[@kookookchoozeus]: https://github.com/kookookchoozeus +[@kristijanmatic]: https://github.com/kristijanmatic +[@kevindew]: https://github.com/kevindew +[@manzt]: https://github.com/manzt +[@mateusortiz]: https://github.com/mateusortiz +[@mightyplow]: https://github.com/mightyplow +[@mikesherov]: https://github.com/mikesherov +[@mjackson]: https://github.com/mjackson +[@mortonfox]: https://github.com/mortonfox +[@nagaozen]: https://github.com/nagaozen +[@norfish]: https://github.com/norfish +[@palkan]: https://github.com/palkan +[@paultopia]: https://github.com/paultopia +[@pgilad]: https://github.com/pgilad +[@phillipj]: https://github.com/phillipj +[@pineapplemachine]: https://github.com/pineapplemachine +[@pra85]: https://github.com/pra85 +[@raymond-lam]: https://github.com/raymond-lam +[@seminaoki]: https://github.com/seminaoki +[@ShashankaNataraj]: https://github.com/ShashankaNataraj +[@simast]: https://github.com/simast +[@stackchain]: https://github.com/stackchain +[@TiddoLangerak]: https://github.com/TiddoLangerak +[@tomekwi]: https://github.com/tomekwi +[@wizawu]: https://github.com/wizawu +[@wol-soft]: https://github.com/wol-soft +[@Xcrucifier]: https://github.com/Xcrucifier +[@yotammadem]: https://github.com/yotammadem +[@yousefcisco]: https://github.com/yousefcisco +[@zekth]: https://github.com/zekth diff --git a/node_modules/mustache/LICENSE b/node_modules/mustache/LICENSE new file mode 100644 index 0000000..4df7d1a --- /dev/null +++ b/node_modules/mustache/LICENSE @@ -0,0 +1,11 @@ +The MIT License + +Copyright (c) 2009 Chris Wanstrath (Ruby) +Copyright (c) 2010-2014 Jan Lehnardt (JavaScript) +Copyright (c) 2010-2015 The mustache.js community + +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. diff --git a/node_modules/mustache/README.md b/node_modules/mustache/README.md new file mode 100644 index 0000000..127dfe1 --- /dev/null +++ b/node_modules/mustache/README.md @@ -0,0 +1,621 @@ +# mustache.js - Logic-less {{mustache}} templates with JavaScript + +> What could be more logical awesome than no logic at all? + +[![Build Status](https://travis-ci.org/janl/mustache.js.svg?branch=master)](https://travis-ci.org/janl/mustache.js) + +[mustache.js](http://github.com/janl/mustache.js) is a zero-dependency implementation of the [mustache](http://mustache.github.com/) template system in JavaScript. + +[Mustache](http://mustache.github.com/) is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. + +We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values. + +For a language-agnostic overview of mustache's template syntax, see the `mustache(5)` [manpage](http://mustache.github.com/mustache.5.html). + +## Where to use mustache.js? + +You can use mustache.js to render mustache templates anywhere you can use JavaScript. This includes web browsers, server-side environments such as [Node.js](http://nodejs.org/), and [CouchDB](http://couchdb.apache.org/) views. + +mustache.js ships with support for the [CommonJS](http://www.commonjs.org/) module API, the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API (AMD) and [ECMAScript modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules). + +In addition to being a package to be used programmatically, you can use it as a [command line tool](#command-line-tool). + +And this will be your templates after you use Mustache: + +!['stache](https://cloud.githubusercontent.com/assets/288977/8779228/a3cf700e-2f02-11e5-869a-300312fb7a00.gif) + +## Install + +You can get Mustache via [npm](http://npmjs.com). + +```bash +$ npm install mustache --save +``` + +## Usage + +Below is a quick example how to use mustache.js: + +```js +var view = { + title: "Joe", + calc: function () { + return 2 + 4; + } +}; + +var output = Mustache.render("{{title}} spends {{calc}}", view); +``` + +In this example, the `Mustache.render` function takes two parameters: 1) the [mustache](http://mustache.github.com/) template and 2) a `view` object that contains the data and code needed to render the template. + +## Templates + +A [mustache](http://mustache.github.com/) template is a string that contains any number of mustache tags. Tags are indicated by the double mustaches that surround them. `{{person}}` is a tag, as is `{{#person}}`. In both examples we refer to `person` as the tag's key. There are several types of tags available in mustache.js, described below. + +There are several techniques that can be used to load templates and hand them to mustache.js, here are two of them: + +#### Include Templates + +If you need a template for a dynamic part in a static website, you can consider including the template in the static HTML file to avoid loading templates separately. Here's a small example: + +```js +// file: render.js + +function renderHello() { + var template = document.getElementById('template').innerHTML; + var rendered = Mustache.render(template, { name: 'Luke' }); + document.getElementById('target').innerHTML = rendered; +} +``` + +```html + + +
    Loading...
    + + + + + + +``` + +#### Load External Templates + +If your templates reside in individual files, you can load them asynchronously and render them when they arrive. Another example using [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch): + +```js +function renderHello() { + fetch('template.mustache') + .then((response) => response.text()) + .then((template) => { + var rendered = Mustache.render(template, { name: 'Luke' }); + document.getElementById('target').innerHTML = rendered; + }); +} +``` + +### Variables + +The most basic tag type is a simple variable. A `{{name}}` tag renders the value of the `name` key in the current context. If there is no such key, nothing is rendered. + +All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable. + +If you'd like to change HTML-escaping behavior globally (for example, to template non-HTML formats), you can override Mustache's escape function. For example, to disable all escaping: `Mustache.escape = function(text) {return text;};`. + +If you want `{{name}}` _not_ to be interpreted as a mustache tag, but rather to appear exactly as `{{name}}` in the output, you must change and then restore the default delimiter. See the [Custom Delimiters](#custom-delimiters) section for more information. + +View: + +```json +{ + "name": "Chris", + "company": "GitHub" +} +``` + +Template: + +``` +* {{name}} +* {{age}} +* {{company}} +* {{{company}}} +* {{&company}} +{{=<% %>=}} +* {{company}} +<%={{ }}=%> +``` + +Output: + +```html +* Chris +* +* <b>GitHub</b> +* GitHub +* GitHub +* {{company}} +``` + +JavaScript's dot notation may be used to access keys that are properties of objects in a view. + +View: + +```json +{ + "name": { + "first": "Michael", + "last": "Jackson" + }, + "age": "RIP" +} +``` + +Template: + +```html +* {{name.first}} {{name.last}} +* {{age}} +``` + +Output: + +```html +* Michael Jackson +* RIP +``` + +### Sections + +Sections render blocks of text zero or more times, depending on the value of the key in the current context. + +A section begins with a pound and ends with a slash. That is, `{{#person}}` begins a `person` section, while `{{/person}}` ends it. The text between the two tags is referred to as that section's "block". + +The behavior of the section is determined by the value of the key. + +#### False Values or Empty Lists + +If the `person` key does not exist, or exists and has a value of `null`, `undefined`, `false`, `0`, or `NaN`, or is an empty string or an empty list, the block will not be rendered. + +View: + +```json +{ + "person": false +} +``` + +Template: + +```html +Shown. +{{#person}} +Never shown! +{{/person}} +``` + +Output: + +```html +Shown. +``` + +#### Non-Empty Lists + +If the `person` key exists and is not `null`, `undefined`, or `false`, and is not an empty list the block will be rendered one or more times. + +When the value is a list, the block is rendered once for each item in the list. The context of the block is set to the current item in the list for each iteration. In this way we can loop over collections. + +View: + +```json +{ + "stooges": [ + { "name": "Moe" }, + { "name": "Larry" }, + { "name": "Curly" } + ] +} +``` + +Template: + +```html +{{#stooges}} +{{name}} +{{/stooges}} +``` + +Output: + +```html +Moe +Larry +Curly +``` + +When looping over an array of strings, a `.` can be used to refer to the current item in the list. + +View: + +```json +{ + "musketeers": ["Athos", "Aramis", "Porthos", "D'Artagnan"] +} +``` + +Template: + +```html +{{#musketeers}} +* {{.}} +{{/musketeers}} +``` + +Output: + +```html +* Athos +* Aramis +* Porthos +* D'Artagnan +``` + +If the value of a section variable is a function, it will be called in the context of the current item in the list on each iteration. + +View: + +```js +{ + "beatles": [ + { "firstName": "John", "lastName": "Lennon" }, + { "firstName": "Paul", "lastName": "McCartney" }, + { "firstName": "George", "lastName": "Harrison" }, + { "firstName": "Ringo", "lastName": "Starr" } + ], + "name": function () { + return this.firstName + " " + this.lastName; + } +} +``` + +Template: + +```html +{{#beatles}} +* {{name}} +{{/beatles}} +``` + +Output: + +```html +* John Lennon +* Paul McCartney +* George Harrison +* Ringo Starr +``` + +#### Functions + +If the value of a section key is a function, it is called with the section's literal block of text, un-rendered, as its first argument. The second argument is a special rendering function that uses the current view as its view argument. It is called in the context of the current view object. + +View: + +```js +{ + "name": "Tater", + "bold": function () { + return function (text, render) { + return "" + render(text) + ""; + } + } +} +``` + +Template: + +```html +{{#bold}}Hi {{name}}.{{/bold}} +``` + +Output: + +```html +Hi Tater. +``` + +### Inverted Sections + +An inverted section opens with `{{^section}}` instead of `{{#section}}`. The block of an inverted section is rendered only if the value of that section's tag is `null`, `undefined`, `false`, *falsy* or an empty list. + +View: + +```json +{ + "repos": [] +} +``` + +Template: + +```html +{{#repos}}{{name}}{{/repos}} +{{^repos}}No repos :({{/repos}} +``` + +Output: + +```html +No repos :( +``` + +### Comments + +Comments begin with a bang and are ignored. The following template: + +```html +

    Today{{! ignore me }}.

    +``` + +Will render as follows: + +```html +

    Today.

    +``` + +Comments may contain newlines. + +### Partials + +Partials begin with a greater than sign, like {{> box}}. + +Partials are rendered at runtime (as opposed to compile time), so recursive partials are possible. Just avoid infinite loops. + +They also inherit the calling context. Whereas in ERB you may have this: + +```html+erb +<%= partial :next_more, :start => start, :size => size %> +``` + +Mustache requires only this: + +```html +{{> next_more}} +``` + +Why? Because the `next_more.mustache` file will inherit the `size` and `start` variables from the calling context. In this way you may want to think of partials as includes, imports, template expansion, nested templates, or subtemplates, even though those aren't literally the case here. + + +For example, this template and partial: + + base.mustache: +

    Names

    + {{#names}} + {{> user}} + {{/names}} + + user.mustache: + {{name}} + +Can be thought of as a single, expanded template: + +```html +

    Names

    +{{#names}} + {{name}} +{{/names}} +``` + +In mustache.js an object of partials may be passed as the third argument to `Mustache.render`. The object should be keyed by the name of the partial, and its value should be the partial text. + +```js +Mustache.render(template, view, { + user: userTemplate +}); +``` + +### Custom Delimiters + +Custom delimiters can be used in place of `{{` and `}}` by setting the new values in JavaScript or in templates. + +#### Setting in JavaScript + +The `Mustache.tags` property holds an array consisting of the opening and closing tag values. Set custom values by passing a new array of tags to `render()`, which gets honored over the default values, or by overriding the `Mustache.tags` property itself: + +```js +var customTags = [ '<%', '%>' ]; +``` + +##### Pass Value into Render Method +```js +Mustache.render(template, view, {}, customTags); +``` + +##### Override Tags Property +```js +Mustache.tags = customTags; +// Subsequent parse() and render() calls will use customTags +``` + +#### Setting in Templates + +Set Delimiter tags start with an equals sign and change the tag delimiters from `{{` and `}}` to custom strings. + +Consider the following contrived example: + +```html+erb +* {{ default_tags }} +{{=<% %>=}} +* <% erb_style_tags %> +<%={{ }}=%> +* {{ default_tags_again }} +``` + +Here we have a list with three items. The first item uses the default tag style, the second uses ERB style as defined by the Set Delimiter tag, and the third returns to the default style after yet another Set Delimiter declaration. + +According to [ctemplates](https://htmlpreview.github.io/?https://raw.githubusercontent.com/OlafvdSpek/ctemplate/master/doc/howto.html), this "is useful for languages like TeX, where double-braces may occur in the text and are awkward to use for markup." + +Custom delimiters may not contain whitespace or the equals sign. + +## Pre-parsing and Caching Templates + +By default, when mustache.js first parses a template it keeps the full parsed token tree in a cache. The next time it sees that same template it skips the parsing step and renders the template much more quickly. If you'd like, you can do this ahead of time using `mustache.parse`. + +```js +Mustache.parse(template); + +// Then, sometime later. +Mustache.render(template, view); +``` + +## Command line tool + +mustache.js is shipped with a Node.js based command line tool. It might be installed as a global tool on your computer to render a mustache template of some kind + +```bash +$ npm install -g mustache + +$ mustache dataView.json myTemplate.mustache > output.html +``` + +also supports stdin. + +```bash +$ cat dataView.json | mustache - myTemplate.mustache > output.html +``` + +or as a package.json `devDependency` in a build process maybe? + +```bash +$ npm install mustache --save-dev +``` + +```json +{ + "scripts": { + "build": "mustache dataView.json myTemplate.mustache > public/output.html" + } +} +``` +```bash +$ npm run build +``` + +The command line tool is basically a wrapper around `Mustache.render` so you get all the features. + +If your templates use partials you should pass paths to partials using `-p` flag: + +```bash +$ mustache -p path/to/partial1.mustache -p path/to/partial2.mustache dataView.json myTemplate.mustache +``` + +## Plugins for JavaScript Libraries + +mustache.js may be built specifically for several different client libraries, including the following: + + - [jQuery](http://jquery.com/) + - [MooTools](http://mootools.net/) + - [Dojo](http://www.dojotoolkit.org/) + - [YUI](http://developer.yahoo.com/yui/) + - [qooxdoo](http://qooxdoo.org/) + +These may be built using [Rake](http://rake.rubyforge.org/) and one of the following commands: +```bash +$ rake jquery +$ rake mootools +$ rake dojo +$ rake yui3 +$ rake qooxdoo +``` + +## TypeScript + +Since the source code of this package is written in JavaScript, we follow the [TypeScript publishing docs](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) preferred approach +by having type definitions available via [@types/mustache](https://www.npmjs.com/package/@types/mustache). + +## Testing + +In order to run the tests you'll need to install [Node.js](http://nodejs.org/). + +You also need to install the sub module containing [Mustache specifications](http://github.com/mustache/spec) in the project root. +```bash +$ git submodule init +$ git submodule update +``` +Install dependencies. +```bash +$ npm install +``` +Then run the tests. +```bash +$ npm test +``` +The test suite consists of both unit and integration tests. If a template isn't rendering correctly for you, you can make a test for it by doing the following: + + 1. Create a template file named `mytest.mustache` in the `test/_files` + directory. Replace `mytest` with the name of your test. + 2. Create a corresponding view file named `mytest.js` in the same directory. + This file should contain a JavaScript object literal enclosed in + parentheses. See any of the other view files for an example. + 3. Create a file with the expected output in `mytest.txt` in the same + directory. + +Then, you can run the test with: +```bash +$ TEST=mytest npm run test-render +``` + +### Browser tests + +Browser tests are not included in `npm test` as they run for too long, although they are ran automatically on Travis when merged into master. Run browser tests locally in any browser: +```bash +$ npm run test-browser-local +``` +then point your browser to `http://localhost:8080/__zuul` + +## Who uses mustache.js? + +An updated list of mustache.js users is kept [on the Github wiki](https://github.com/janl/mustache.js/wiki/Beard-Competition). Add yourself or your company if you use mustache.js! + +## Contributing + +mustache.js is a mature project, but it continues to actively invite maintainers. You can help out a high-profile project that is used in a lot of places on the web. No big commitment required, if all you do is review a single [Pull Request](https://github.com/janl/mustache.js/pulls), you are a maintainer. And a hero. + +### Your First Contribution + +- review a [Pull Request](https://github.com/janl/mustache.js/pulls) +- fix an [Issue](https://github.com/janl/mustache.js/issues) +- update the [documentation](https://github.com/janl/mustache.js#usage) +- make a website +- write a tutorial + +## Thanks + +mustache.js wouldn't kick ass if it weren't for these fine souls: + + * Chris Wanstrath / defunkt + * Alexander Lang / langalex + * Sebastian Cohnen / tisba + * J Chris Anderson / jchris + * Tom Robinson / tlrobinson + * Aaron Quint / quirkey + * Douglas Crockford + * Nikita Vasilyev / NV + * Elise Wood / glytch + * Damien Mathieu / dmathieu + * Jakub Kuźma / qoobaa + * Will Leinweber / will + * dpree + * Jason Smith / jhs + * Aaron Gibralter / agibralter + * Ross Boucher / boucher + * Matt Sanford / mzsanford + * Ben Cherry / bcherry + * Michael Jackson / mjackson + * Phillip Johnsen / phillipj + * David da Silva Contín / dasilvacontin diff --git a/node_modules/mustache/bin/mustache b/node_modules/mustache/bin/mustache new file mode 100755 index 0000000..6db073f --- /dev/null +++ b/node_modules/mustache/bin/mustache @@ -0,0 +1,150 @@ +#!/usr/bin/env node + +var fs = require('fs'), + path = require('path'); + +var Mustache = require('..'); +var pkg = require('../package'); +var partials = {}; + +var partialsPaths = []; +var partialArgIndex = -1; + +while ((partialArgIndex = process.argv.indexOf('-p')) > -1) { + partialsPaths.push(process.argv.splice(partialArgIndex, 2)[1]); +} + +var viewArg = process.argv[2]; +var templateArg = process.argv[3]; +var outputArg = process.argv[4]; + +if (hasVersionArg()) { + return console.log(pkg.version); +} + +if (!templateArg || !viewArg) { + console.error('Syntax: mustache